CliveWilcox
Member
I have just started a little project which goes like this.
A Gas sensor module outputs data at 9600 baud, 8 bit, no parity, 1 stop bit, No hardware flow control (only RX TX and GND) Inverted output.
The format of the data stream is as follows:
A 12345 B 12345 C 12345 D 12345 <CR.<LF>
The output is updated about 4 times a second.
What I want to do: read D 12345 part of the data once a second and display it on LCD
So I came up with...
Clock a 18x1 chip to 8mhz to get 9600
main:
setfreq m8 ‘ set freq to 8MHz
serin 1,N9600,(“D”),b1 ‘ receive serial value
write b0,b1 ‘ write value into b1
serout 7,N2400,(b1) ‘ transmit value to serial LCD
pause 20000 ‘ wait 1 second
goto main
Questions:
Will the 18x ok to do this or do i need a 28x?
Will the chip need a buffer or serial driver rsb509B/MAX232 for the incoming data?
Will I need to clear b1 before the next loop?
Any comments would be welcome before i start to solder bits to boards.
Not had much experience with serial data, so i don't really know if the picaxe can handle this type of thing. I did something like this years ago on an old Nascom - but even that was a Z80. Still use them in my CNC Mill
A Gas sensor module outputs data at 9600 baud, 8 bit, no parity, 1 stop bit, No hardware flow control (only RX TX and GND) Inverted output.
The format of the data stream is as follows:
A 12345 B 12345 C 12345 D 12345 <CR.<LF>
The output is updated about 4 times a second.
What I want to do: read D 12345 part of the data once a second and display it on LCD
So I came up with...
Clock a 18x1 chip to 8mhz to get 9600
main:
setfreq m8 ‘ set freq to 8MHz
serin 1,N9600,(“D”),b1 ‘ receive serial value
write b0,b1 ‘ write value into b1
serout 7,N2400,(b1) ‘ transmit value to serial LCD
pause 20000 ‘ wait 1 second
goto main
Questions:
Will the 18x ok to do this or do i need a 28x?
Will the chip need a buffer or serial driver rsb509B/MAX232 for the incoming data?
Will I need to clear b1 before the next loop?
Any comments would be welcome before i start to solder bits to boards.
Not had much experience with serial data, so i don't really know if the picaxe can handle this type of thing. I did something like this years ago on an old Nascom - but even that was a Z80. Still use them in my CNC Mill