New guy is lost ~~ Simple program doesn't execute correctly
I have created an extremely simple program that fires one output on and off yet all i get is one quick high pulse on the pin then nothing !!!!
Every download produces one quick pulse on the pin , yet never executes any commands after the first outa
[noparse][[/noparse]code]
CON
_clkmode = RCFAST
PUB MotorOnOff
dira[noparse][[/noparse]14..12] := %101
repeat
!outa[noparse][[/noparse]12]
waitcnt (500 + cnt)
!outa[noparse][[/noparse]14]
/[noparse][[/noparse]code]
Every download produces one quick pulse on the pin , yet never executes any commands after the first outa
[noparse][[/noparse]code]
CON
_clkmode = RCFAST
PUB MotorOnOff
dira[noparse][[/noparse]14..12] := %101
repeat
!outa[noparse][[/noparse]12]
waitcnt (500 + cnt)
!outa[noparse][[/noparse]14]
/[noparse][[/noparse]code]
Comments
waitcnt(clkfreq/2 + cnt)
Also the "/" goes inside the brackets.
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
If the indenting is indeed correct, what you posted should work ... toggle pin 12, then toggle again every 50us or so. Pin 14 will toggle roughly opposite to pin 12, again roughly every 50us or so depending on the actual clock speed with the RCFAST clock (8 to 20MHz).
You might slow this down by increasing the "500" in the waitcnt so you can more easily see what the program is doing.
I could be wrong but it looks like setting pin 14 to HIGH kills your setup, a short maybe?
BTW, your code clearly works, I just tested it (using different pins).
CON
··_clkmode·=·RCFAST
PUB·MotorOnOff
··dira[noparse][[/noparse]14..12]·:=·%101
···repeat
······!outa[noparse][[/noparse]12]
······waitcnt·(clkfreq/2·+·cnt)
······!outa[noparse][[/noparse]14]
And add a waitcnt delay line after '!outa[noparse][[/noparse]14]', does it change? Could it be the sample rate?
J-
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Signature space for rent!
Send $1 to CannibalRobotics.com.
I've tried everything from outa[noparse][[/noparse]12] := 1 to out[noparse][[/noparse]14] := 1 , to the old !outa[noparse][[/noparse]12] all produce the same results , one quick pulse on whatever pin i have specified and then dead.
There's something in how you have things wired that's probably causing the Propeller to reset ... some kind of short.
Have you connected all of the Vdd pins to 3.3V and all of the Vss pins to ground? Have you used bypass capacitors (0.1uF ceramic) on all of the Vdd/Vss pairs?
Have you grounded the BOEn pin?
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
Rich h
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
Okay then, is there any more to your program that what you posted? If so, that could be the problem. Otherwise I think the next step is to show us some pictures of your setup and post the code you are running as an attachment.
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
site to view and download pics , two with comments
.spin files are attached.
Can you remove the Propeller chip and put it in a breadboard with a LED just to test it? That would be the simplest way I think to determine if the chip is defective.
You could also remove the chip then measure the resistance from pin 14 to ground to see if there are any hidden shorts.
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
2.) Already did both of the above I truly believe ram is damaged on chip it acts the same even on the old solderless breadboard with only a simple red led connected.
1.) It was your accent.
2.) I don't know what would be wrong with it but if it doesn't work to toggle a simple LED then I would agree that something is fried on the chip.
Note that if you are using Spin.2 2.spin to test it with an LED that it will be toggling much too fast to see. That's where the waitcnt(clkfreq/2 + cnt) comes in.
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
Post Edited (W9GFO) : 4/10/2010 5:49:43 PM GMT
BTW, I just noticed that clkfreq/2 which should work as well but a constant is a constant.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
Post Edited (Peter Jakacki) : 4/10/2010 8:04:23 AM GMT
What interests me is that the last two posts referred to what are apparently two different versions of spin ? spin1 and spin2 please explain as maybe this is my issue ?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Landon Leigh
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
When all else fails.....procrastinate!