stand alone Propeller wont run code
stelath_shadow9
Posts: 23
Hey guys. new on here. having an issue with my prop.
issue is I can run my code (to blink an LED) just fine on my propeller activity board. However, when I try to so the same thing on my stand alone propeller (p8x32a1) the LED blinks very faintly and more rapid than it should.
I am using a prop plug to program my propeller. everything is connected correctly, as when I go to run>identify hardware the prop tool program see's the MC. So I am wondering where I am going wrong. Perhaps a piece of code to do with the clock setting?
here is the code I am using.
issue is I can run my code (to blink an LED) just fine on my propeller activity board. However, when I try to so the same thing on my stand alone propeller (p8x32a1) the LED blinks very faintly and more rapid than it should.
I am using a prop plug to program my propeller. everything is connected correctly, as when I go to run>identify hardware the prop tool program see's the MC. So I am wondering where I am going wrong. Perhaps a piece of code to do with the clock setting?
here is the code I am using.
{Object_Title_and_Purpose} CON _clkmode = xtal1 + pll16x 'Standard clock mode * crystal frequency = 80 MHz _xinfreq = 5_000_000 VAR long symbol OBJ bs2 : "bs2" PUB this bs2.start(31,30) repeat dira[1]~~ !outa[1] bs2.pause(1000)
Comments
Still, "pause" may not work exactly right since you don't have an accurate clock anymore. A lot will depend on how "pause" defines time.
Easy enough to add a crystal I suppose (caps not required, which is nice).
Them are fighting words around here. (Or so I've observed.)
We need to see the pause code and know what board/circuit you are using.
Just in case, if using a breadboard circuit, all power/ground pins must be connected and bypass caps must be used - else you risk damaging your prop.
Ah, yes. I don't use other microcontrollers much but now that I think about it, most of them require capacitors with the crystal.
Thanks for the correction.
So, instead of using this bs2 object you could replace it with just plain old spin... use waitcnt(clkfreq/n+cnt)... then we don't have to wonder about pause.
the next part was having to modify the code to use the waitcnt+cnt. so now it looks like this and works perfectly.
Thanks for all the replies.