MarkDuncan34
New Member
Hi guys and girls,
Im a second year electronics BTEC national student.I should make it clear i have very litle knowldge of Picaxe (I have completed the basic dice and buggy project but thats it)
i am tryin to store NMEA 0183 marine comunication data into a picaxe chip then transmit it out at the correct baud rate to marine instruments.
i have writen a program
I am trying to use a 18X on a logger board currently, I have pasted my current program bellow (it does not work that well)
any help would be great
start:
if pin7 = 1 then gosub poweron
if pin7 = 1 then high output1
endif
goto start
poweron:
init: pause 500
serout 6,N2400,(254,128)
serout 6,n2400,("NMEA O183")
serout 6,n2400,(254,192) '
serout 6,n2400, ("DATA SIMULATOR")
pause 5000
selection:
serout 6,n2400,(254,1)
pause 10
serout 6,n2400,(254,128)
serout 6,n2400, ("PRESS BUTTON 1")
serout 6,n2400,(254,192)
serout 6,n2400,("TX POSITION DATA")
pause 5000
serout 6,n2400,(254,1)
pause 10
serout 6,n2400,(254,128)
serout 6,n2400, ("PRESS BUTTON 2")
serout 6,n2400,(254,192)
serout 6,n2400,("TX SPEED DATA")
pause 5000
serout 6,n2400,(254,1)
pause 10
serout 6,n2400,(254,128)
serout 6,n2400, ("PRESS BUTTON 3")
serout 6,n2400,(254,192)
serout 6,n2400,("TX DEPTH DATA")
pause 5000
serout 6,n2400,(254,1)
pause 10
serout 6,n2400,(254,128)
serout 6,n2400,("PRESS BUTTON")
serout 6,n2400,(254,192)
serout 6,n2400,("1 - 2 - 3 TO TX")
I2cslave %10100010, i2cfast,i2cbyte
writei2c 0, ("NMEA,0183,test,data,sample,one,of,three")
pause 500
I2cslave %10100100, i2cfast,i2cbyte
writei2c 1, ("NMEA,0183,test,data,sample,two,of,three")
pause 500
I2cslave %10101000, i2cfast,i2cbyte
writei2c 2, ("NMEA,0183,test,data,sample,three,of,three")
pause 500
again:
pause 1000
if pin0 = 1 then gosub subone
if pin1 = 1 then gosub subtwo
if pin2 = 1 then gosub subthree
goto again
subone:
i2cslave %10100010, i2cfast, i2cbyte
for b1 = 0 to 59
readi2c b1, (b0)
serout 6,n2400,(254,1)
pause 30
serout 7,n4800,(b0)
serout 6,N2400,(b0)
serout 6,n2400,(254,20,128)
next b1
pause 1000
serout 6,n2400,(254,1)
pause 10
serout 6,n2400,(254,128)
serout 6,n2400,("PRESS BUTTON")
serout 6,n2400,(254,192)
serout 6,n2400,("1 - 2 - 3 TO TX")
return
subtwo:
i2cslave %10100100, i2cfast, i2cbyte
for b2 = 0 to 59
readi2c b2, (b0)
serout 6,n2400,(254,1)
pause 30
serout 7,n4800,(b0)
serout 6,N2400,(b0)
serout 6,n2400,(254,20,128)
next b2
pause 1000
serout 6,n2400,(254,1)
pause 10
serout 6,n2400,(254,128)
serout 6,n2400,("PRESS BUTTON")
serout 6,n2400,(254,192)
serout 6,n2400,("1 - 2 - 3 TO TX")
return
subthree:
i2cslave %10101000, i2cfast, i2cbyte
for b3 = 0 to 59
readi2c b3, (b0)
serout 6,n2400,(254,1)
pause 30
serout 7,n4800,(b0)
serout 6,n2400,(b0)
serout 6,n2400,(254,20,128)
next b3
pause 1000
serout 6,n2400,(254,1)
pause 10
serout 6,n2400,(254,128)
serout 6,n2400,("PRESS BUTTON")
serout 6,n2400,(254,192)
serout 6,n2400,("1 - 2 - 3 TO TX")
return
thank you for your time and help
Im a second year electronics BTEC national student.I should make it clear i have very litle knowldge of Picaxe (I have completed the basic dice and buggy project but thats it)
i am tryin to store NMEA 0183 marine comunication data into a picaxe chip then transmit it out at the correct baud rate to marine instruments.
i have writen a program
I am trying to use a 18X on a logger board currently, I have pasted my current program bellow (it does not work that well)
any help would be great
start:
if pin7 = 1 then gosub poweron
if pin7 = 1 then high output1
endif
goto start
poweron:
init: pause 500
serout 6,N2400,(254,128)
serout 6,n2400,("NMEA O183")
serout 6,n2400,(254,192) '
serout 6,n2400, ("DATA SIMULATOR")
pause 5000
selection:
serout 6,n2400,(254,1)
pause 10
serout 6,n2400,(254,128)
serout 6,n2400, ("PRESS BUTTON 1")
serout 6,n2400,(254,192)
serout 6,n2400,("TX POSITION DATA")
pause 5000
serout 6,n2400,(254,1)
pause 10
serout 6,n2400,(254,128)
serout 6,n2400, ("PRESS BUTTON 2")
serout 6,n2400,(254,192)
serout 6,n2400,("TX SPEED DATA")
pause 5000
serout 6,n2400,(254,1)
pause 10
serout 6,n2400,(254,128)
serout 6,n2400, ("PRESS BUTTON 3")
serout 6,n2400,(254,192)
serout 6,n2400,("TX DEPTH DATA")
pause 5000
serout 6,n2400,(254,1)
pause 10
serout 6,n2400,(254,128)
serout 6,n2400,("PRESS BUTTON")
serout 6,n2400,(254,192)
serout 6,n2400,("1 - 2 - 3 TO TX")
I2cslave %10100010, i2cfast,i2cbyte
writei2c 0, ("NMEA,0183,test,data,sample,one,of,three")
pause 500
I2cslave %10100100, i2cfast,i2cbyte
writei2c 1, ("NMEA,0183,test,data,sample,two,of,three")
pause 500
I2cslave %10101000, i2cfast,i2cbyte
writei2c 2, ("NMEA,0183,test,data,sample,three,of,three")
pause 500
again:
pause 1000
if pin0 = 1 then gosub subone
if pin1 = 1 then gosub subtwo
if pin2 = 1 then gosub subthree
goto again
subone:
i2cslave %10100010, i2cfast, i2cbyte
for b1 = 0 to 59
readi2c b1, (b0)
serout 6,n2400,(254,1)
pause 30
serout 7,n4800,(b0)
serout 6,N2400,(b0)
serout 6,n2400,(254,20,128)
next b1
pause 1000
serout 6,n2400,(254,1)
pause 10
serout 6,n2400,(254,128)
serout 6,n2400,("PRESS BUTTON")
serout 6,n2400,(254,192)
serout 6,n2400,("1 - 2 - 3 TO TX")
return
subtwo:
i2cslave %10100100, i2cfast, i2cbyte
for b2 = 0 to 59
readi2c b2, (b0)
serout 6,n2400,(254,1)
pause 30
serout 7,n4800,(b0)
serout 6,N2400,(b0)
serout 6,n2400,(254,20,128)
next b2
pause 1000
serout 6,n2400,(254,1)
pause 10
serout 6,n2400,(254,128)
serout 6,n2400,("PRESS BUTTON")
serout 6,n2400,(254,192)
serout 6,n2400,("1 - 2 - 3 TO TX")
return
subthree:
i2cslave %10101000, i2cfast, i2cbyte
for b3 = 0 to 59
readi2c b3, (b0)
serout 6,n2400,(254,1)
pause 30
serout 7,n4800,(b0)
serout 6,n2400,(b0)
serout 6,n2400,(254,20,128)
next b3
pause 1000
serout 6,n2400,(254,1)
pause 10
serout 6,n2400,(254,128)
serout 6,n2400,("PRESS BUTTON")
serout 6,n2400,(254,192)
serout 6,n2400,("1 - 2 - 3 TO TX")
return
thank you for your time and help