Whenever I use a gosub command in a program, the Macaxepad stops working and will not program the platform. The mac axepad states that the hardware cannot be found.
if I comment out the gosub it downloads the code. Is anyone else having this issue?
Attached is a sample program, that causes the problem
'New application to write the time to the
symbol COM = 44 'comma
symbol RET = 13 'carriage return
symbol LFEED = 10 'line feed
main:
b13=0
'set the clock
'Only used if required
'
'i2cslave %11010000,i2cslow, i2cbyte
'writei2c 0, ($20, $33, $16, $02, $02, $03, $09, $10)
'pause 100
'low 5
looppoint:
i2cslave %11010000,i2cslow, i2cbyte
readi2c 0,(b0,b1,b2,b3,b4,b5,b6)
'debug b3
'debug b4
'debug b5
'debug b6
let b7 = b0 & %11110000 / 16 * 10
let b0 = b0 & %00001111 + b7
let b7=b1 & %11110000 / 16 * 10
let b1 = b1 & %00001111 + b7
let b7 = b2 & %11110000 / 16 * 10
let b2 = b2 & %00001111 + b7
'debug secs
'debug mins
'debug hours
readtemp 7, w4 'Read the temp from pin 7 to b1
readadc 0,W5 'Read port 0 ligh
serout 7,n2400,("Time = ",#b2,":",#b1,":",#b0, " Date = ",b3, " ", #b4,"/",#b5,"/",#b6," Temp= ",#w4," Light =",#w5,RET,LFEED)
i2cslave %10100000,i2cfast, i2cbyte
gosub write2memory
readi2c 0,(w5)
serout 7,n2400,(#w5," ")
readi2c 1,(w5)
serout 7,n2400,(#w5," ")
readi2c 2,(w5)
serout 7,n2400,(#w5," ")
readi2c 3,(w5)
serout 7,n2400,(#w5," ")
readi2c 4,(w5)
serout 7,n2400,(#w5," ")
readi2c 5,(w5)
serout 7,n2400,(#w5," ")
low 2
high 3
pause 2480 'Wait
low 3
high 2
pause 2500
'pause 55000
goto looppoint ' goto start and do it again
write2memory:
writei2c b13,(w0)
pause 20
b13=b13+1
writei2c b13,(w1)
pause 20
writei2c b13,(w2)
b13=b13+1
pause 20
writei2c b13,(w3)
b13=b13+1
pause 20
writei2c b13,(w4)
b13=b13+1
pause 20
writei2c b13,(w5)
b13=b13+1
debug w2
if b13>200 then resetb
return
resetb:
b13=0
return
if I comment out the gosub it downloads the code. Is anyone else having this issue?
Attached is a sample program, that causes the problem
'New application to write the time to the
symbol COM = 44 'comma
symbol RET = 13 'carriage return
symbol LFEED = 10 'line feed
main:
b13=0
'set the clock
'Only used if required
'
'i2cslave %11010000,i2cslow, i2cbyte
'writei2c 0, ($20, $33, $16, $02, $02, $03, $09, $10)
'pause 100
'low 5
looppoint:
i2cslave %11010000,i2cslow, i2cbyte
readi2c 0,(b0,b1,b2,b3,b4,b5,b6)
'debug b3
'debug b4
'debug b5
'debug b6
let b7 = b0 & %11110000 / 16 * 10
let b0 = b0 & %00001111 + b7
let b7=b1 & %11110000 / 16 * 10
let b1 = b1 & %00001111 + b7
let b7 = b2 & %11110000 / 16 * 10
let b2 = b2 & %00001111 + b7
'debug secs
'debug mins
'debug hours
readtemp 7, w4 'Read the temp from pin 7 to b1
readadc 0,W5 'Read port 0 ligh
serout 7,n2400,("Time = ",#b2,":",#b1,":",#b0, " Date = ",b3, " ", #b4,"/",#b5,"/",#b6," Temp= ",#w4," Light =",#w5,RET,LFEED)
i2cslave %10100000,i2cfast, i2cbyte
gosub write2memory
readi2c 0,(w5)
serout 7,n2400,(#w5," ")
readi2c 1,(w5)
serout 7,n2400,(#w5," ")
readi2c 2,(w5)
serout 7,n2400,(#w5," ")
readi2c 3,(w5)
serout 7,n2400,(#w5," ")
readi2c 4,(w5)
serout 7,n2400,(#w5," ")
readi2c 5,(w5)
serout 7,n2400,(#w5," ")
low 2
high 3
pause 2480 'Wait
low 3
high 2
pause 2500
'pause 55000
goto looppoint ' goto start and do it again
write2memory:
writei2c b13,(w0)
pause 20
b13=b13+1
writei2c b13,(w1)
pause 20
writei2c b13,(w2)
b13=b13+1
pause 20
writei2c b13,(w3)
b13=b13+1
pause 20
writei2c b13,(w4)
b13=b13+1
pause 20
writei2c b13,(w5)
b13=b13+1
debug w2
if b13>200 then resetb
return
resetb:
b13=0
return