@Jon
Thanks again for you careful and patient answer.
I will have to re read the data sheets with much more care again this time and in future
I had completely ignored the timing diagrams as being too advanced for the interests of beginners.
Not so. Not so!
H
I reviewed and ran your program
It runs OK right after loading it. Once
Then will not run again properly if F10 is pressed.
Dark boxes on first line. O'scope shown no activity on enable line.
I tried to troubleshoot it to no real avail.
Will you please take another look at your code to see what might be hanging things up.
seems to be a problem with the jmp #$ command on the last line of the LCD_Init method
If I replace it with jmp LCD_Init it works but it should not need that and the display is not really right.
H
The code is meant to display the message once and then stop; jmp #$ is an in-line jump. Running the code a second time without resetting the display causes a glitch because the display is already configured in 4-bit mode. The following lines send one nibble to the display, while the display is expecting two nibbles.
You could comment those lines out when reloading, or power the display down between reloads.
If you simply want to keep the display alive to see activity on the lines, execute a jump to the clear LCD line.
@JonnyMac: The Data delay time T_ddr specifies 160ns as the maximum amount of time it might take for data to be valid after E goes high. I've written mine to check the busy flag after clocking Enable low following an on time of 250ns (actually closer to 350ns due to instruction overhead). The data sheet specifies PW_eh a minimum of 230ns, so I've got plenty of time there. I'm not following the Enable cycle T_cycE time of 500ns while checking the busy flag, my cycle time is slightly faster, but even so the display seems fine with it.
Just had another look at it, and it seems to do fine even if I only mov Delay_cnt,#1, which produces a ~200ns on time. The attachments didn't come through as clearly as I'd hoped, but the first one shows a nine byte message to the LCD, with lots of busy flag checks. The second image is a closeup of one byte 0xC0, followed by busy flag checking.
@Chris
Thank you Chris. I appreciate the time you take to respond to this thread in some detail.
Lets consider the 2 x 16 display done for now. Lets close the discussion of this device for now.
Next let us go onto controlling a 7 segment display to see how that might be implemented in PASM
I will consider one digit only at this time. One of the ones on the PD Board provided by Parallax.
The resistors for each segment are in place, in series, already for these devices.
A simple rapid serial illumination of 7 segments will be implemented.
[FONT=Arial, sans-serif]I am posting this first so that those who want to do some PASM on their own to control a 7 segment display can get going and we can all share the same wiring model.[/FONT]
[FONT=Arial, sans-serif]The hardware used will be as provided on the PDB by Parallax. There are six 17segmented displays on this board. We will address the rightmost of these displays in our program. We will ignore the decimal point.[/FONT]
[FONT=Arial, sans-serif]We will consider one digit with the equivalent of seven standard segments. The displays on the PDB have 17 segments each but we can treat them a 7 segment displays by combining the segments that form the top middle and low crossbars and ignoring the other 6 segments used for alphabetic character displays.[/FONT]
[FONT=Arial, sans-serif]We have the following tasks ahead of us:[/FONT]
[FONT=Arial, sans-serif]Wire up the display so that[/FONT]
[FONT=Arial, sans-serif]The software sets up the segment control constants so that they are easy to change without having to rewire the experimental set up.[/FONT]
[FONT=Arial, sans-serif]We will need the following methods[/FONT] [FONT=Arial, sans-serif] Identify number to be displayed. 0 to 9 in a loop[/FONT] [FONT=Arial, sans-serif] Assign consecutive addresses to the 10 number masks[/FONT] [FONT=Arial, sans-serif] Identify segment to be highlighted 01 to 7[/FONT] [FONT=Arial, sans-serif] Highlight the segment with programmable delay[/FONT]
[FONT=Arial, sans-serif]Here is the code to display form 0 to 9 on the rightmost display on the PDB.[/FONT] [FONT=Arial, sans-serif]This method displays to numbers by turning on the needed segments for a short[/FONT] [FONT=Arial, sans-serif]period of time, there is no display loop for each segment. The display for each number is static.[/FONT]
Basic techniques
Beginners code examples:
Here is the basic code for looping through any number of lines of code a fixed, given number of times
{{ Program 022 PASM Repeat loop
Cog in PASM to demonstrate loop repeat code
}}CON
_clkmode = XTAL1 + PLL16x
_xinfreq = 5_000_000
VAR
long shared
OBJ
fds: "FullDuplexSerial"
PUB FirstCog 'displays par value on console,, if set
fds.start(31,30,0,115200) 'start console at 115200 for debug output
cognew(@PCog, @Shared) 'Cog in PASM for 7 Seg display
waitcnt(clkfreq/4+cnt) 'wait 1/4 for everything to stabilize.
repeat 'main loop
fds.tx($1) 'clear screen
fds.dec(shared[0]) 'display number of loops in PASM code
fds.tx(" ") 'print space
repeat shared[0] 'subordinate loop
fds.tx("A") 'print A for each count
waitcnt(clkfreq/60+cnt) 'flicker free pause
'-----------------------------------------------
DAT
org 0 'start at 0 location in the cog
PCog
do_it 'main loop
call #demo_Repeat 'calls sbroutine repeatedly
jmp #do_it 'do again
'-----------------------------------------------
demo_Repeat 'demonstration loop
mov repeats, number 'set up number of cycles
mov counter, #0 'set counter to 0
:loop
add counter, #1 'add one to counter
'the code for whatever you want to
'do for any number of times
'goes here
sub number, #1 wz 'subtract from number
if_nz jmp #:loop 'do again
wrlong counter, par 'store in par for display in FirstCog
demo_Repeat_ret ret
'------------------------------------------------
number long 10
repeats res 1
counter res 1
mem res 1
DAT
org 0 'start at 0 location in the cog
PCog
do_it 'main loop
call #demo_Repeat 'calls sbroutine repeatedly
jmp #do_it 'do again
'-----------------------------------------------
demo_Repeat 'demonstration loop
mov repeats, number 'set up number of cycles
mov counter, #0 'set counter to 0
:loop
add counter, #1 'add one to counter
'the code for whatever you want to
'do for any number of times
'goes here
sub number, #1 wz 'subtract from number
if_nz jmp #:loop 'do again
wrlong counter, par 'store in par for display in FirstCog
demo_Repeat_ret ret
'------------------------------------------------
number long 10
repeats res 1
counter res 1
mem res 1
The first call to demo_Repeat takes about 150 cycles. How long does the second call take?
@kuroneko
Your question is not specific enough for me at my level of expertise. It might have more interest for other readers.
Do you mean to the beginning of the call or the end of the call and return
And the same would be true for the second call
But my guess is almost the same. Though, I do not know and did not run a test.
@Jon
That is why you are an expert programmer and I am a beginner.
Of course you are right though I did not fully appreciate why the status of the Z flag would need preservation beyond its immediate use here. Or for that matter at another time beyond its immediate use though I can see where that may be useful in a complicated logical construct in at more advanced stage of programming proficiency.
Right now I'm keeping it as simple as possible to follow.
On another question, I am thinking of providing a short simple example of the use of each instruction in PASM (but not the operators) in the book. But me being a beginner these would be fairly quick, simple constructs. Would that be useful enough to do or it this just another not a very good idea. The PM lacks this feature and I felt I would have benefited from it if it has been there. Comments are invited from all readers of the forum.
H.
ps. I'm off to the north woods next week so will not be posting anything.
The program runs and there is no delay. I run all my programs before posting. There is no delay.
I don't see a problem in that I am not using the CTR.
However your observations are very important so I need to take another look.
AH, I think I see it!!!!
Apparently, the SPIN cog is repeating the results of the first pass through the PASM cog so I don't see the the hang up on the second pass of the PASM routine. However I don't see why the first pass works at all.
I will have to check this out after I get back from vacation to see if I got it right.
OK. I give up
I have racked my brain as to what is wrong with this and cannot figure it out
There is certainly something wrong because the subroutine is called only once and then the hangup.
Help
H
DAT
org 0 'start at 0 location in the cog
PCog
do_it 'main loop
call #demo_Repeat 'calls sbroutine repeatedly
jmp #do_it 'do again
'-----------------------------------------------
demo_Repeat 'demonstration loop
mov [COLOR="blue"]repeats[/COLOR], number 'set up number of cycles
mov counter, #0 'set counter to 0
:loop
add counter, #1 'add one to counter
'the code for whatever you want to
'do for any number of times
'goes here
sub [COLOR="red"]number[/COLOR], #1 wz 'subtract from number
if_nz jmp #:loop 'do again
wrlong counter, par 'store in par for display in FirstCog
demo_Repeat_ret ret
'------------------------------------------------
number long 10
repeats res 1
counter res 1
mem res 1
For the second call number is 0 which takes a long time to get down to 0 again. You really want to decrement repeats instead.
DAT
org 0 'start at 0 location in the cog
PCog
do_it 'main loop
call #demo_Repeat 'calls sbroutine repeatedly
jmp #do_it 'do again
'-----------------------------------------------
demo_Repeat 'demonstration loop
mov [COLOR="blue"]repeats[/COLOR], number 'set up number of cycles
mov counter, #0 'set counter to 0
:loop
add counter, #1 'add one to counter
'the code for whatever you want to
'do for any number of times
'goes here
sub [COLOR="red"]number[/COLOR], #1 wz 'subtract from number
if_nz jmp #:loop 'do again
wrlong counter, par 'store in par for display in FirstCog
demo_Repeat_ret ret
'------------------------------------------------
number long 10
repeats res 1
counter res 1
mem res 1
For the second call number is 0 which takes a long time to get down do 0 again. You really want to decrement repeats instead.
Good to show beginner the verbose way to loop, but follow up with using djnz. It is there, and saves writting an instruction, and as Jon points out, you may not want to mess with the state of the zero flag. The djnz,tjz and tjnz do not alter the Z flag unless you specify it.
BTW, I may be wrong, but it looks like the code shown here will jump the track again after the first pass. I was hoping that Kuroneko was going to point out that you don't ever want to work directly on cells storing your constants unless you are deliberately altering them for some purpose. That goes for constants stored as part of the code or parameters passed in to the cog. Here, you are moving number into the repeats cell, but then you are actually operating on the constant again. When you head into the loop after the first pass, and you save number to repeat, the first thing you will do is wipe out the only copy of your constant you saved on the first pass. Then you move on and subtract 1 from zero which the core will happily do, and you will be stuck in the loop for 2^32 passes. A good example of what happens when your code wipes out parameters/constants.
The solution is to create a working cell for the loop count. Start by pre-loading it with the constant prior to entering the loop. Once in the loop, do your thing and test on the working cell and djnz'ing until hitting 0. When you return to repeat, you should at some point hit the preload the working cell again and then call the loop.
So it looks like
DAT
org 0 'start at 0 location in the cog
'main loop
do_it mov [COLOR="blue"]repeats[/COLOR], number 'set up number of cycles
call #demo_Repeat 'calls sbroutine repeatedly
jmp #do_it 'do again
'-----------------------------------------------
demo_Repeat 'demonstration loop
mov counter, #0 'set counter to 0
:loop
add counter, #1 'add one to counter
'the code for whatever you want to
'do for any number of times
'goes here
sub [COLOR="red"]repeats[/COLOR], #1 wz 'subtract from number
if_nz jmp #:loop 'do again
wrlong counter, par 'store in par for display in FirstCog
demo_Repeat_ret ret
'------------------------------------------------
number long 10
repeats res 1
counter res 1
mem res 1
Frank
Note that while I said saves writting an instruction, it may not save you an instruction time. The propman states that if the jump is NOT taken then it is a four cycle instruction otherwise it is 8.
BTW, I may be wrong, but it looks like the code shown here will jump the track again after the first pass.
The code was left as is with emphasis on the mismatch (if that's what you meant). I'd have thought the textual reference to "decrementing repeats" made that clear
Thanks guys. It never dawned on me that I had used the wrong variable.
I have to be gone again till the 18th so I will pick up on this thread again after that
H
On another thread, I asked if there was an object to read the Chinese DRO scales. No response so far .
So.....
Looks like the next exercise for beginners is going to have to be reading a Chinese DRO.
I need that for my current Mill CNC project.
Which is why I needed to learn PASM in the first place!
Lets see if I can do it. (Of course with significant help of the experts here).
The first thing we need to know is what the interface looks like.
It is a 4 wire interface. Power, clock, signal and ground. Since the battery power is at 1.5 volts, we cannot read the signal directly into the Propeller. We need at least 1.65 volts or better. Higher would be even better. I am going to use a Op Amp to see if I can read the signal into the Prop. I am using a Chinese scale with a standard Little Machine Shop cable. The cable plugs into the keyboard connector provided by Parallax to go directly into the Prof Dev Board. No soldering or other cable modifications are necessary. This is good because these cables are quite expensive. Those following along can set up accordingly and report how they got a readable signal. Next I'll report on the success of this scheme and what I found.
I read that and everything else I could find on the internet
Am trying to get a clean TTL signal from that signal at this time.
Only then can I read it
Bob:
Sorry for the delayed response.
No I am not and I am not familiar with it.
Right now I am waiting for parts for Jameco etc and getting all the fall preparations that are necessary in this part of the world done so I can settle into some serious experimentation for the winter shut in.
I will look into your suggestion soon.
H
All:
This business of reading scales is a lot harder than I thought. I need more experience.
I am going to stop on them for now
I am going back to the book I am writing. I have about 120 pages of notes that need attention
I guess that's about 1/3 to about 1/2 of the book for beginners for now
I'm going to organize that work and see what else needs to be done and what else I need to learn
Then get back to the programming and post back to the group
It will be a while
H
Here is my initial outline for the book.
I am covering what I have in my other books
How to run motors with Pic micros
Making PIC Instruments and controllers
Programming the Prop.
Except covering the material with programming in PASM
[FONT=Arial, sans-serif]Outline [/FONT]
[FONT=Arial, sans-serif]PASM for beginners Propeller 102[/FONT]
[FONT=Arial, sans-serif]Preface[/FONT]
[FONT=Arial, sans-serif]Table of contents[/FONT]
[FONT=Arial, sans-serif]Part one What we have to work with[/FONT]
[FONT=Arial, sans-serif]Book resources[/FONT]
[FONT=Arial, sans-serif]OBEX shared resources[/FONT]
[FONT=Arial, sans-serif]Forum[/FONT]
[FONT=Arial, sans-serif]Propeller Chip[/FONT]
[FONT=Arial, sans-serif]This book[/FONT]
[FONT=Arial, sans-serif]Program listings on the Net[/FONT]
[FONT=Arial, sans-serif]Propeller manual and how to use it and what it does not tell[/FONT]
[FONT=Arial, sans-serif]Binary math beginnings[/FONT]
[FONT=Arial, sans-serif]Simple register manipulations[/FONT]
[FONT=Arial, sans-serif]Part two Simple Output[/FONT]
[FONT=Arial, sans-serif]LEDs[/FONT]
[FONT=Arial, sans-serif]7404 buffers[/FONT]
[FONT=Arial, sans-serif]The PST Duplex Full Serial interfacing to PST[/FONT]
[FONT=Arial, sans-serif]Part Four The projects[/FONT]
[FONT=Arial, sans-serif]Solenoids and relays[/FONT]
[FONT=Arial, sans-serif]Self leveling Table[/FONT]
[FONT=Arial, sans-serif]440 cps tone[/FONT]
[FONT=Arial, sans-serif]Metronome[/FONT]
[FONT=Arial, sans-serif]Tachometer[/FONT]
[FONT=Arial, sans-serif]Servo motor R/C[/FONT]
[FONT=Arial, sans-serif]Temperature reading devices[/FONT]
[FONT=Arial, sans-serif]Clock chip interfacing[/FONT]
[FONT=Arial, sans-serif]DC motor[/FONT]
[FONT=Arial, sans-serif]DC Motor with encoder[/FONT]
[FONT=Arial, sans-serif]Stepper motors[/FONT]
[FONT=Arial, sans-serif]Data collection from a solar collector.[/FONT]
[FONT=Arial, sans-serif]Part five Appendices[/FONT]
[FONT=Arial, sans-serif]Equipment needs[/FONT]
[FONT=Arial, sans-serif]PASM words used in text with short meanings.[/FONT]
[FONT=Arial, sans-serif]Epilogue[/FONT]
Lets see what it ends up looking like by the time I get done
Suggestions are welcome
Introduction) A basic explanation of why PASM isn't magic.
1) Basic components of the Propeller
2) Free tools used in the book
3) Number and logic systems, addition, and subtraction
4) Organization of a PASM program
5) Introduction to PASM
6) Flags
7) Flow control
8) Logic instructions, and counters
9) Hub and cog ram
10) Arrays and addressing modes
11) Strings and Text display
12) IC communication protocols
13) Multiple cogs
This my idea of how a book should be laid out, similar to a college text book.
Respectfully, I think there is drawbacks to the number of projects, the cost involved.
Also, I think, a book format that uses projects as titles reduces the books worth as a post
reference material.
On the other hand, I previously posted that I learn best when I use my hands--working on a project that is important to me.
Constant rereading of a section, or chapter drives me crazy-- like some over-edited calculus or physics books.
I am certain you can create readable a format that is both interesting, and covers the basics I outlined.
Something that would become a good post reference material.
A font selection like "Sabon" would help readability too.
Bill M.
It would be great if the book continued on to to at least cover:
Added your list to mine. Some additions are a must but I felt some might be too much for beginners. Will consider everything you said as I get along. Thanks
Comments
Thanks again for you careful and patient answer.
I will have to re read the data sheets with much more care again this time and in future
I had completely ignored the timing diagrams as being too advanced for the interests of beginners.
Not so. Not so!
H
I reviewed and ran your program
It runs OK right after loading it. Once
Then will not run again properly if F10 is pressed.
Dark boxes on first line. O'scope shown no activity on enable line.
I tried to troubleshoot it to no real avail.
Will you please take another look at your code to see what might be hanging things up.
seems to be a problem with the jmp #$ command on the last line of the LCD_Init method
If I replace it with jmp LCD_Init it works but it should not need that and the display is not really right.
H
If you simply want to keep the display alive to see activity on the lines, execute a jump to the clear LCD line.
@JonnyMac: The Data delay time T_ddr specifies 160ns as the maximum amount of time it might take for data to be valid after E goes high. I've written mine to check the busy flag after clocking Enable low following an on time of 250ns (actually closer to 350ns due to instruction overhead). The data sheet specifies PW_eh a minimum of 230ns, so I've got plenty of time there. I'm not following the Enable cycle T_cycE time of 500ns while checking the busy flag, my cycle time is slightly faster, but even so the display seems fine with it.
Just had another look at it, and it seems to do fine even if I only mov Delay_cnt,#1, which produces a ~200ns on time. The attachments didn't come through as clearly as I'd hoped, but the first one shows a nine byte message to the LCD, with lots of busy flag checks. The second image is a closeup of one byte 0xC0, followed by busy flag checking.
Thank you Chris. I appreciate the time you take to respond to this thread in some detail.
Lets consider the 2 x 16 display done for now. Lets close the discussion of this device for now.
Next let us go onto controlling a 7 segment display to see how that might be implemented in PASM
I will consider one digit only at this time. One of the ones on the PD Board provided by Parallax.
The resistors for each segment are in place, in series, already for these devices.
A simple rapid serial illumination of 7 segments will be implemented.
H
[FONT=Arial, sans-serif]The hardware used will be as provided on the PDB by Parallax. There are six 17segmented displays on this board. We will address the rightmost of these displays in our program. We will ignore the decimal point.[/FONT]
[FONT=Arial, sans-serif]We will consider one digit with the equivalent of seven standard segments. The displays on the PDB have 17 segments each but we can treat them a 7 segment displays by combining the segments that form the top middle and low crossbars and ignoring the other 6 segments used for alphabetic character displays.[/FONT]
[FONT=Arial, sans-serif]We have the following tasks ahead of us:[/FONT]
[FONT=Arial, sans-serif]Wire up the display so that[/FONT]
[FONT=Arial, sans-serif]Pin 12 controls segments B[/FONT]
[FONT=Arial, sans-serif]Pin 13 controls segment C[/FONT]
[FONT=Arial, sans-serif]Pin 14 controls segment E[/FONT]
[FONT=Arial, sans-serif]Pin 15 controls segment F[/FONT]
[FONT=Arial, sans-serif]Pin 16 controls segment A1, A2[/FONT]
[FONT=Arial, sans-serif]Pin 17 controls segment G1. G2[/FONT]
[FONT=Arial, sans-serif]Pin 18 controls segment D1, D2[/FONT]
[FONT=Arial, sans-serif]The software sets up the segment control constants so that they are easy to change without having to rewire the experimental set up.[/FONT]
[FONT=Arial, sans-serif]We will need the following methods[/FONT]
[FONT=Arial, sans-serif] Identify number to be displayed. 0 to 9 in a loop[/FONT]
[FONT=Arial, sans-serif] Assign consecutive addresses to the 10 number masks[/FONT]
[FONT=Arial, sans-serif] Identify segment to be highlighted 01 to 7[/FONT]
[FONT=Arial, sans-serif] Highlight the segment with programmable delay[/FONT]
[FONT=Arial, sans-serif]Then the software[/FONT]
[FONT=Arial, sans-serif]H[/FONT]
[FONT=Arial, sans-serif]This method displays to numbers by turning on the needed segments for a short[/FONT]
[FONT=Arial, sans-serif]period of time, there is no display loop for each segment. The display for each number is static.[/FONT]
Beginners code examples:
Here is the basic code for looping through any number of lines of code a fixed, given number of times
Harprit
Why not used djnz?
Your question is not specific enough for me at my level of expertise. It might have more interest for other readers.
Do you mean to the beginning of the call or the end of the call and return
And the same would be true for the second call
But my guess is almost the same. Though, I do not know and did not run a test.
@Jon
That is why you are an expert programmer and I am a beginner.
Of course you are right though I did not fully appreciate why the status of the Z flag would need preservation beyond its immediate use here. Or for that matter at another time beyond its immediate use though I can see where that may be useful in a complicated logical construct in at more advanced stage of programming proficiency.
Right now I'm keeping it as simple as possible to follow.
On another question, I am thinking of providing a short simple example of the use of each instruction in PASM (but not the operators) in the book. But me being a beginner these would be fairly quick, simple constructs. Would that be useful enough to do or it this just another not a very good idea. The PM lacks this feature and I felt I would have benefited from it if it has been there. Comments are invited from all readers of the forum.
H.
ps. I'm off to the north woods next week so will not be posting anything.
The program runs and there is no delay. I run all my programs before posting. There is no delay.
I don't see a problem in that I am not using the CTR.
However your observations are very important so I need to take another look.
AH, I think I see it!!!!
Apparently, the SPIN cog is repeating the results of the first pass through the PASM cog so I don't see the the hang up on the second pass of the PASM routine. However I don't see why the first pass works at all.
I will have to check this out after I get back from vacation to see if I got it right.
Very, very interesting THANK YOU.
H
I have racked my brain as to what is wrong with this and cannot figure it out
There is certainly something wrong because the subroutine is called only once and then the hangup.
Help
H
Good to show beginner the verbose way to loop, but follow up with using djnz. It is there, and saves writting an instruction, and as Jon points out, you may not want to mess with the state of the zero flag. The djnz,tjz and tjnz do not alter the Z flag unless you specify it.
BTW, I may be wrong, but it looks like the code shown here will jump the track again after the first pass. I was hoping that Kuroneko was going to point out that you don't ever want to work directly on cells storing your constants unless you are deliberately altering them for some purpose. That goes for constants stored as part of the code or parameters passed in to the cog. Here, you are moving number into the repeats cell, but then you are actually operating on the constant again. When you head into the loop after the first pass, and you save number to repeat, the first thing you will do is wipe out the only copy of your constant you saved on the first pass. Then you move on and subtract 1 from zero which the core will happily do, and you will be stuck in the loop for 2^32 passes. A good example of what happens when your code wipes out parameters/constants.
The solution is to create a working cell for the loop count. Start by pre-loading it with the constant prior to entering the loop. Once in the loop, do your thing and test on the working cell and djnz'ing until hitting 0. When you return to repeat, you should at some point hit the preload the working cell again and then call the loop.
So it looks like
Frank
Note that while I said saves writting an instruction, it may not save you an instruction time. The propman states that if the jump is NOT taken then it is a four cycle instruction otherwise it is 8.
I have to be gone again till the 18th so I will pick up on this thread again after that
H
So.....
Looks like the next exercise for beginners is going to have to be reading a Chinese DRO.
I need that for my current Mill CNC project.
Which is why I needed to learn PASM in the first place!
Lets see if I can do it. (Of course with significant help of the experts here).
I am getting the hardware set up right now.
All information will be posted here.
H
http://forums.parallax.com/showthread.php?117331-DRO-using-Chinese-%28caliper%29-scales
Then try to create code beginners can understand.
H
The first thing we need to know is what the interface looks like.
It is a 4 wire interface. Power, clock, signal and ground.
Since the battery power is at 1.5 volts, we cannot read the signal directly into the Propeller.
We need at least 1.65 volts or better. Higher would be even better.
I am going to use a Op Amp to see if I can read the signal into the Prop.
I am using a Chinese scale with a standard Little Machine Shop cable.
The cable plugs into the keyboard connector provided by Parallax to go directly into the Prof
Dev Board.
No soldering or other cable modifications are necessary.
This is good because these cables are quite expensive.
Those following along can set up accordingly and report how they got a readable signal.
Next I'll report on the success of this scheme and what I found.
H
You cannot use the keyboard connector. Parallax #28060 Rev A
The data line does not carry through.
Need to make up special cable connector
H
[h=3](Data Output on a Scope and Logic Analyzer)[/h] [h=3]Chinese Scale Protocol[/h]
http://www.shumatech.com/support/chinese_scales.htm#Chinese%20Scale%20Protocol
I read that and everything else I could find on the internet
Am trying to get a clean TTL signal from that signal at this time.
Only then can I read it
H
Only then can I read it
Are you using Viewport?
http://hannoware.com/viewport/features.php
Sorry for the delayed response.
No I am not and I am not familiar with it.
Right now I am waiting for parts for Jameco etc and getting all the fall preparations that are necessary in this part of the world done so I can settle into some serious experimentation for the winter shut in.
I will look into your suggestion soon.
H
This business of reading scales is a lot harder than I thought. I need more experience.
I am going to stop on them for now
I am going back to the book I am writing. I have about 120 pages of notes that need attention
I guess that's about 1/3 to about 1/2 of the book for beginners for now
I'm going to organize that work and see what else needs to be done and what else I need to learn
Then get back to the programming and post back to the group
It will be a while
H
I am covering what I have in my other books
How to run motors with Pic micros
Making PIC Instruments and controllers
Programming the Prop.
Except covering the material with programming in PASM
[FONT=Arial, sans-serif]Outline [/FONT]
[FONT=Arial, sans-serif]PASM for beginners Propeller 102[/FONT]
[FONT=Arial, sans-serif]Preface[/FONT]
[FONT=Arial, sans-serif]Table of contents[/FONT]
[FONT=Arial, sans-serif]Part one What we have to work with[/FONT]
[FONT=Arial, sans-serif]Book resources[/FONT]
[FONT=Arial, sans-serif]OBEX shared resources[/FONT]
[FONT=Arial, sans-serif]Forum[/FONT]
[FONT=Arial, sans-serif]Propeller Chip[/FONT]
[FONT=Arial, sans-serif]This book[/FONT]
[FONT=Arial, sans-serif]Program listings on the Net[/FONT]
[FONT=Arial, sans-serif]Propeller manual and how to use it and what it does not tell[/FONT]
[FONT=Arial, sans-serif]Binary math beginnings[/FONT]
[FONT=Arial, sans-serif]Simple register manipulations[/FONT]
[FONT=Arial, sans-serif]Part two Simple Output[/FONT]
[FONT=Arial, sans-serif]LEDs[/FONT]
[FONT=Arial, sans-serif]7404 buffers[/FONT]
[FONT=Arial, sans-serif]The PST Duplex Full Serial interfacing to PST[/FONT]
[FONT=Arial, sans-serif]Development board[/FONT]
[FONT=Arial, sans-serif]7 segment displays[/FONT]
[FONT=Arial, sans-serif]2 lines by 16 char display[/FONT]
[FONT=Arial, sans-serif]Extended to 4 lines by 20 chars[/FONT]
[FONT=Arial, sans-serif]Speaker[/FONT]
[FONT=Arial, sans-serif]Servo motor[/FONT]
[FONT=Arial, sans-serif]Frequency[/FONT]
[FONT=Arial, sans-serif]PWM generation[/FONT]
[FONT=Arial, sans-serif]Part three Simple Input[/FONT]
[FONT=Arial, sans-serif]read one push button[/FONT]
[FONT=Arial, sans-serif]read Switches[/FONT]
[FONT=Arial, sans-serif]Read Keyboard[/FONT]
[FONT=Arial, sans-serif]read Potentiometer[/FONT]
[FONT=Arial, sans-serif]read Voltage[/FONT]
[FONT=Arial, sans-serif]Count pulses.[/FONT]
[FONT=Arial, sans-serif]read frequency[/FONT]
[FONT=Arial, sans-serif]1302 interface[/FONT]
[FONT=Arial, sans-serif]single wire clock/other interface.[/FONT]
[FONT=Arial, sans-serif]LM34 interface[/FONT]
[FONT=Arial, sans-serif]Part Four The projects[/FONT]
[FONT=Arial, sans-serif]Solenoids and relays[/FONT]
[FONT=Arial, sans-serif]Self leveling Table[/FONT]
[FONT=Arial, sans-serif]440 cps tone[/FONT]
[FONT=Arial, sans-serif]Metronome[/FONT]
[FONT=Arial, sans-serif]Tachometer[/FONT]
[FONT=Arial, sans-serif]Servo motor R/C[/FONT]
[FONT=Arial, sans-serif]Temperature reading devices[/FONT]
[FONT=Arial, sans-serif]Clock chip interfacing[/FONT]
[FONT=Arial, sans-serif]DC motor[/FONT]
[FONT=Arial, sans-serif]DC Motor with encoder[/FONT]
[FONT=Arial, sans-serif]Stepper motors[/FONT]
[FONT=Arial, sans-serif]Data collection from a solar collector.[/FONT]
[FONT=Arial, sans-serif]Part five Appendices[/FONT]
[FONT=Arial, sans-serif]Equipment needs[/FONT]
[FONT=Arial, sans-serif]PASM words used in text with short meanings.[/FONT]
[FONT=Arial, sans-serif]Epilogue[/FONT]
Lets see what it ends up looking like by the time I get done
Suggestions are welcome
H
1) Basic components of the Propeller
2) Free tools used in the book
3) Number and logic systems, addition, and subtraction
4) Organization of a PASM program
5) Introduction to PASM
6) Flags
7) Flow control
8) Logic instructions, and counters
9) Hub and cog ram
10) Arrays and addressing modes
11) Strings and Text display
12) IC communication protocols
13) Multiple cogs
This my idea of how a book should be laid out, similar to a college text book.
Respectfully, I think there is drawbacks to the number of projects, the cost involved.
Also, I think, a book format that uses projects as titles reduces the books worth as a post
reference material.
On the other hand, I previously posted that I learn best when I use my hands--working on a project that is important to me.
Constant rereading of a section, or chapter drives me crazy-- like some over-edited calculus or physics books.
I am certain you can create readable a format that is both interesting, and covers the basics I outlined.
Something that would become a good post reference material.
A font selection like "Sabon" would help readability too.
Bill M.
It would be great if the book continued on to to at least cover:
I/O functions
Graphics
Advanced Math
Added your list to mine. Some additions are a must but I felt some might be too much for beginners. Will consider everything you said as I get along. Thanks
H