PDA

View Full Version : PE Lab - query on shifting LED display -IO&timing basics page 17



karli
05-19-2008, 04:32 AM
·· My Parallax Propeller apprenticeship is only going into week-2.
···I've done all the lab exercises to this point in that manual and all
·· spin routines worked fine but the ShiftRightP9toP9.spin has got
·· me stunned.·· I entered it· via F10 into RAM just like its printed
·· on page 17. but when I run it I see P9 flash and then P8 comes on
·· and stays on. I modified·· waitcnt(clkfreq + cnt) so I could see it
·· run slower.· I can do a manual· outa[9..4]·:= %100000·· entry
·· (with a repeat on the end)· and shift the P9..P4 bits· and each LED
·· turns on per each entry.
·· when I change the last line·· to >>= 3 and run the original code
·· I get P9 to blink and the· P6 stays·ON.
·· any pointers as to what's happening here ?
·· Thanks,
·····karli.

kuroneko
05-19-2008, 11:31 AM
I just adapted the program for the Hydra (2 LEDs) and it works as advertised. Are you sure your wiring is correct (it would appear so as you seem to be able to control each LED)?

Andy Lindsay (Parallax)
05-21-2008, 06:35 AM
Karli,

It's usually best to hand enter the code for the sake of letting it sink in as you type. However, to find out if there is a coding error, try the pre-written code that comes with the zipped lab. If the symptom persists even with the pre-written demo code, than move on to the circuit checking part that kuroneko suggested.

http://forums.parallax.com/showthread.php?p=617192

Andy

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay

Education Department
Parallax, Inc.