alistairsam
Senior Member
Hi,
I need to interpret ascii data sent from a software via the programming cable and perform relevant tasks on a 28x2, but am having some trouble parsing the data.
the software is an autoguiding software (guidemaster) for sending correction pulses to a telescope controller when a star drifts from the software's monitored position.
there are 8 commands delimited with a #.
#:Mw# for "move west", #:Me# for "move east and so on.
I used a serial to serial cable between two laptops, ran hyperterm on one, and the astro software on the other. below is the data captured in hyperterminal.
#:RG# ; initialize
#:Me##:Qw##:Qe# ;Move east, quit west, quit east
#:Mw##:Qw##:Qe# ;move west, quit west, quit east
#:Ms##:Qn##:Qs#
#:Mn##:Qn##:Qs#
#:Q#
I wrote the code below to see if the picaxe (28x2) recognizes the # as a qualifier and stores the following 3 bytes into the scratchpad and then display it in the terminal. But the output I'm getting from the terminal reading the 3 pointer values is as below
§5þEnd
§5þEnd
§5þEnd
§5þEnd
I'm expecting :RG
code is as below
I kept the timeout value high so I can see if the LED goes off before the timeout when the qualifier is recognized and it does.
am I doing something wrong?
this is following my earlier thread http://www.picaxeforum.co.uk/showthread.php?19292-Serial-interface-to-a-PC&highlight=serrxd+ascii
as for raising an interrupt when data is received, are the hsersetup and setint commands more relevant to hserin data over the hardware serial pins?
thanks
I need to interpret ascii data sent from a software via the programming cable and perform relevant tasks on a 28x2, but am having some trouble parsing the data.
the software is an autoguiding software (guidemaster) for sending correction pulses to a telescope controller when a star drifts from the software's monitored position.
there are 8 commands delimited with a #.
#:Mw# for "move west", #:Me# for "move east and so on.
I used a serial to serial cable between two laptops, ran hyperterm on one, and the astro software on the other. below is the data captured in hyperterminal.
#:RG# ; initialize
#:Me##:Qw##:Qe# ;Move east, quit west, quit east
#:Mw##:Qw##:Qe# ;move west, quit west, quit east
#:Ms##:Qn##:Qs#
#:Mn##:Qn##:Qs#
#:Q#
I wrote the code below to see if the picaxe (28x2) recognizes the # as a qualifier and stores the following 3 bytes into the scratchpad and then display it in the terminal. But the output I'm getting from the terminal reading the 3 pointer values is as below
§5þEnd
§5þEnd
§5þEnd
§5þEnd
I'm expecting :RG
code is as below
Code:
#picaxe 28x2
symbol led = b.7
main:
ptr=1
high led
disconnect
serrxd [5000,timeout],("#"),@ptrinc,@ptrinc,@ptr
timeout:
low led
reconnect
ptr=1
for b10=1 to 4
sertxd (@ptrinc)
next b10
pause 1000
sertxd ("End",CR,LF)
goto main
am I doing something wrong?
this is following my earlier thread http://www.picaxeforum.co.uk/showthread.php?19292-Serial-interface-to-a-PC&highlight=serrxd+ascii
as for raising an interrupt when data is received, are the hsersetup and setint commands more relevant to hserin data over the hardware serial pins?
thanks