Only works few seconds
sergioarasa
Posts: 3
Hello!
This program only works ok a few minutes.
Some body can tell me why?
Thank you very much.
Sergio.
CON
· _CLKMODE = XTAL1 + PLL8X
· _XINFREQ = 6_000_000
VAR
· long stack[noparse][[/noparse]40]
·
PUB Principal
· cognew(@terminal, @stack)
DAT
terminal
······· org 0
bucle··mov dira, pin24
······· mov outa, pin24
······· mov time,delay
······· add time,cnt
······· waitcnt time,delay
······· mov outa, #0
······· waitcnt time,delay
······· jmp bucle
'
pin24 long |< 24
time long 0
delay long 6_000_000
······· fit 496
This program only works ok a few minutes.
Some body can tell me why?
Thank you very much.
Sergio.
CON
· _CLKMODE = XTAL1 + PLL8X
· _XINFREQ = 6_000_000
VAR
· long stack[noparse][[/noparse]40]
·
PUB Principal
· cognew(@terminal, @stack)
DAT
terminal
······· org 0
bucle··mov dira, pin24
······· mov outa, pin24
······· mov time,delay
······· add time,cnt
······· waitcnt time,delay
······· mov outa, #0
······· waitcnt time,delay
······· jmp bucle
'
pin24 long |< 24
time long 0
delay long 6_000_000
······· fit 496
Comments
for testing purposes of assembler there are several options... you can simulate the code or you can step through it using one of the multiple options. See here : propeller.wikispaces.com/Debuggers+and+Emulators
All instructions have a source and destination part. The destination is always a position in cog's memory, the source can either be a position in cog's memory (where the value is stored) or the value itself (call literal) when it is between 0 and 511. In the case of the jump, the destination address is known at compile time, so a literal is used, denoted by the use of the '#' symbol. But an indirect addressing mode can be used, denoted by the lack of a '#' symbol, like in your example. Then, it is not working because it is using the value stored at bucle instead of the address itself.
Bienvenido a los foros. De d
Now my error·seems to me·obvious but i spend time enough to turn me crazy
I am from Barcelona, (Spain). Please excuse my poor english.
Thank you again.
Sergio.
propeller.wikispaces.com/Common+Assembler+Bugs
From time to time, that happens,