Propeller randomly stops executing Spin Code
DarkWarrior
Posts: 5
Hi,
I ran into an issue with the Propeller which I cant solve myself. It seems to me that the Propeller randomly stops executing SPIN code. Running PASM code in a seperat cog is working fine.
I wrote a simple program which blinks leds in 3 different ways.
1. Start a cog with PASM Code
2. Start an additional cog with SPIN Code
3. Run SPIN Code on the main cog
Both methods which execute SPIN code stop toggling the LED after a few seconds. Sometimes the LED dont even blink once.
Number 2 with PASM code is toggling the LED endlessly and is unaffected when the other Methods stops.
Methods 2 or 3 stops after a few seconds and the LEDs. But Method 3 is unaffected and toggles endlessly the Led´s.
I also have to say that i have problems programming with the Serial Port. I need several tries until the Propeller tool finds the Propeller on the Port, maybe this can be a reason for this odd behaviour.
So can it be that the Propeller is broken ?
I ran into an issue with the Propeller which I cant solve myself. It seems to me that the Propeller randomly stops executing SPIN code. Running PASM code in a seperat cog is working fine.
I wrote a simple program which blinks leds in 3 different ways.
1. Start a cog with PASM Code
2. Start an additional cog with SPIN Code
3. Run SPIN Code on the main cog
Both methods which execute SPIN code stop toggling the LED after a few seconds. Sometimes the LED dont even blink once.
Number 2 with PASM code is toggling the LED endlessly and is unaffected when the other Methods stops.
Methods 2 or 3 stops after a few seconds and the LEDs. But Method 3 is unaffected and toggles endlessly the Led´s.
I also have to say that i have problems programming with the Serial Port. I need several tries until the Propeller tool finds the Propeller on the Port, maybe this can be a reason for this odd behaviour.
So can it be that the Propeller is broken ?
CON _clkmode = xtal1 + pll16x 'Standard clock mode * crystal frequency = 80 MHz _xinfreq = 5_000_000 PUB public_method_name 'start a cog with PASM code cognew(@entry,0) 'start an additional cog with SPIN code cognew(blink,0) 'use current cog dira[16] := 1 repeat waitcnt(cnt + 20_000_000) !outa[16] PUB blink dira[18] := 1 repeat waitcnt(cnt + 20_000_000) !outa[18] DAT org entry mov r0,#1 shl r0,#17 mov dira,r0 loop xor outa,r0 mov r1,cnt add r1,wait waitcnt r1,#0 jmp #loop r0 long 1 r1 long 1 wait long 20_000_000
Comments
and when i deleted the method like this its still the same
Here's an example of blinking three LEDs: one with PASM, one in a secondary Spin cog, one in the main Spin cog. This is running on a demo board so I know it works.
Your Code seems to work.
I ran your second program (above my last post) and it seems to work fine.
I have now 0,1uF caps there, and it seem all the codes with the Led´s work fine.
But the Problem with the Grafic Demos are still there , they are little bit better but not much.
When i take the GraficsTest.spin that comes with the Propeller Tool, i get only a Black and White screen that starts moving for short time (0.5 - 1,5 sec sometimes 3-5 but not very often) and then hang up.
I Try other Grafic demos too but non of them work fine, i checked the Crystal and the Resistors.
So any ideas what´s the Problem ?