Program help, not making sence.....

I have the PropRPM & I'm having issues trying to create my first program using all 10 leds, to light em up 1 at a time. one per sec. Here's the problem. Instead of doing what I want, it's doing the exact opposite, starts with all on & turns em off 1 per sec, that orone of 2 other things, no leds come on or P17, 18, 19, 23, 24 & 25 light on at once & P16, 20, 21, 22 stay off. Pendinging how I try & figure out what I've done wrong. I also did a very similar program on my BS2 & it worked just fine, so I know the leds are fine. There's an error someplace, According to what I know on the BS2 it should work.
My problem prone program.
'Countup LEDs
I know the chip & LEDs are fine. This other program works flawlessly.
'Alternating LEDs
This don't make sence. Anytime I try & get all LED's to light up at once, they all stay off. I thought it was my 9V, 900 mA power supply, figured it wasn't enough mA to do it, so I put it on my old 486 pc Power supply, & taking my 10.1 VDC out of the power supply made a quick voltage divider out of 2 resistors & took the voltage to 9.17 VDC & same thing, so my problem isn't mA. According to what I've read soo far & from what I know on the BS2 Homeworkboard kit, my program should have worked correctly & done what I wanted it to do. What am I missing here??
Joe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm going insaine. It's SOOOOOO much fun. lol
Post Edited (jknightandkarr) : 11/7/2009 6:41:27 AM GMT
My problem prone program.
'Countup LEDs
Con _clkmode = xtal1+pll8x _xinfreq = 5_000_000 PUB Ledallon dira[noparse][[/noparse]16]:=1 dira[noparse][[/noparse]17]:=1 dira[noparse][[/noparse]18]:=1 dira[noparse][[/noparse]19]:=1 dira[noparse][[/noparse]20]:=1 dira[noparse][[/noparse]21]:=1 dira[noparse][[/noparse]22]:=1 dira[noparse][[/noparse]23]:=1 dira[noparse][[/noparse]24]:=1 dira[noparse][[/noparse]25]:=1 outa[noparse][[/noparse]16]:=1 repeat 25 waitcnt(80_000_000+cnt) outa[noparse][[/noparse]17]:=1 waitcnt(80_000_000+cnt) outa[noparse][[/noparse]18]:=1 waitcnt(80_000_000+cnt) outa[noparse][[/noparse]19]:=1 waitcnt(80_000_000+cnt) outa[noparse][[/noparse]20]:=1 waitcnt(80_000_000+cnt) outa[noparse][[/noparse]21]:=1 waitcnt(80_000_000+cnt) outa[noparse][[/noparse]22]:=1 waitcnt(80_000_000+cnt) outa[noparse][[/noparse]23]:=1 waitcnt(80_000_000+cnt) outa[noparse][[/noparse]24]:=1 waitcnt(80_000_000+cnt) outa[noparse][[/noparse]25]:=1 waitcnt(80_000_000+cnt)
I know the chip & LEDs are fine. This other program works flawlessly.
'Alternating LEDs
Con _clkmode = xtal1+pll16x _xinfreq = 5_000_000 PUB Ledallon dira[noparse][[/noparse]16]:=%1 outa[noparse][[/noparse]16]:=%1 dira[noparse][[/noparse]17]:=%1 outa[noparse][[/noparse]17]:=%0 dira[noparse][[/noparse]18]:=%1 outa[noparse][[/noparse]18]:=%1 dira[noparse][[/noparse]19]:=%1 outa[noparse][[/noparse]19]:=%0 dira[noparse][[/noparse]20]:=%1 outa[noparse][[/noparse]20]:=%1 dira[noparse][[/noparse]21]:=%1 outa[noparse][[/noparse]21]:=%0 dira[noparse][[/noparse]22]:=%1 outa[noparse][[/noparse]22]:=%1 dira[noparse][[/noparse]23]:=%1 outa[noparse][[/noparse]23]:=%0 dira[noparse][[/noparse]24]:=%1 outa[noparse][[/noparse]24]:=%1 dira[noparse][[/noparse]25]:=%1 outa[noparse][[/noparse]25]:=%0 REPEAT 25 !outa[noparse][[/noparse]16] !outa[noparse][[/noparse]17] !outa[noparse][[/noparse]18] !outa[noparse][[/noparse]19] !outa[noparse][[/noparse]20] !outa[noparse][[/noparse]21] !outa[noparse][[/noparse]22] !outa[noparse][[/noparse]23] !outa[noparse][[/noparse]24] !outa[noparse][[/noparse]25] waitcnt(clkfreq+cnt)
This don't make sence. Anytime I try & get all LED's to light up at once, they all stay off. I thought it was my 9V, 900 mA power supply, figured it wasn't enough mA to do it, so I put it on my old 486 pc Power supply, & taking my 10.1 VDC out of the power supply made a quick voltage divider out of 2 resistors & took the voltage to 9.17 VDC & same thing, so my problem isn't mA. According to what I've read soo far & from what I know on the BS2 Homeworkboard kit, my program should have worked correctly & done what I wanted it to do. What am I missing here??
Joe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm going insaine. It's SOOOOOO much fun. lol
Post Edited (jknightandkarr) : 11/7/2009 6:41:27 AM GMT
Comments
Second, are you sure you are indenting your code properly under your REPEAT command? It's hard to tell when your code is not using the CODE formatting mentioned above.
I/O pin ---\/\/\/\/\/---LED anode
LED cathode --- ground
The resistor can be anything from about 1K to 100 Ohms
Mike,
On the PropRPM my bargraph leds are built into the circuit board straight from parallax on Pins 16-25, while removable, I cannot change the pin wiring or anything like that I can only remove the bargraph leds & replace them. They are working, so I know there in the socket correctly. My Alternating LEDs program works perfictly as I wanted it too, it the one I posted above that's the problem. I want it to start with P16 & light each led up in sequance to P25 being the 10th led with about 1 second between them, I tested it on my BS2 I have & my program worked flawlessly, so I don't get why it's not working here.
Joe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm going insaine. It's SOOOOOO much fun. lol
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
3.3VDC to 10-180 Ohm Resistors, then to each led, & then to P16 to P25 of the Propeller Chip. All I had to do is change....
outa[noparse][[/noparse]16..25]:=%0000000000 to outa[noparse][[/noparse]16..25]:=%1111111111
& change the...
OUTA[noparse][[/noparse]pin]:=1 to OUTA[noparse][[/noparse]pin]:=0
to ground the leds & complete the circuit. I'll have to remember that & when I build a permant circuit with a Propeller to change them back to the way they was before.
Joe
Ok New problem. I get to P24, it lights up but VERY VERY breefly. Then restarts over odd, P25 don't even light up. I figured adding more pause time would help, but it didn't do anything to change it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm going insaine. It's SOOOOOO much fun. lol
Post Edited (jknightandkarr) : 11/7/2009 7:08:38 AM GMT
waitcnt(80_000_000+cnt)
waitcnt(80_000_000+cnt)
waitcnt(80_000_000+cnt)
waitcnt(80_000_000+cnt)
Either way it didn't seam to help. I've looked into alternative ways of pausing & all had the same effect.
Joe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm going insaine. It's SOOOOOO much fun. lol
Joe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm going insaine. It's SOOOOOO much fun. lol
The visual effect should be that all the LEDs initially turn on, then #16 turns off after a few microseconds, then one by one the others (#17 to #25) turn off at one second intervals.
The cog will die after 10 repeats as is. If you put the repeat at the end the cog will remain alive and the state of the LEDs will be the same as the code you have written.
Question. If I go over on mA, will the propeller reset itself? I ask this because after putting ' infront of outa[noparse][[/noparse]24] & outa[noparse][[/noparse]25] lines that turned them into the same as comments, the leds quit restarting & stayed lit. that is after I moved the repeat command down to the bottom to make it just repeat nothing. I think I'm just over on the mA is why my display is screwing up.
Joe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm going insaine. It's SOOOOOO much fun. lol
Joe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm going insaine. It's SOOOOOO much fun. lol
A voltage divider will only provide a stable voltage when the current drain is fixed. Work it out using Ohm's Law. You'll see.
There's about a 0.7V drop across the input diode of the PropRPM plus about 0.5V across the voltage regulator. The Prop requires something like 2.7V or better to work and really is supposed to get 3.3V. You need at least 4.5V at the power connector. The Propeller datasheet has graphs showing how much current per cog it draws at different clock speeds plus a base current for the hub. Have a look at the datasheet.
Post Edited (Mike Green) : 11/8/2009 6:16:54 AM GMT
Joe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm going insaine. It's SOOOOOO much fun. lol
Joe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm going insaine. It's SOOOOOO much fun. lol