SERIN using 9 bit
Archiver
Posts: 46,084
Hello,
I'm talking to a sensor using 9 bits RS232 (instead of 8 bits). This
does not include the start and stop bit. I can tell the sensor (for
example):
SEROUT 15,T9600,[noparse][[/noparse]BIN9 %101010101]
But I can't receive the 9 bit "answer" back:
SERIN 14,T9600,2000,NoData,[noparse][[/noparse]BIN9 ANSWER] 'Answer is delcared
as a Word.
It time's out. Any suggestions?
Other notes:
1. My oscope shows a word is coming back-- with plenty of time to
receive (10ms).
2. I'm at the right baud rate
Thanx,
-Barry
I'm talking to a sensor using 9 bits RS232 (instead of 8 bits). This
does not include the start and stop bit. I can tell the sensor (for
example):
SEROUT 15,T9600,[noparse][[/noparse]BIN9 %101010101]
But I can't receive the 9 bit "answer" back:
SERIN 14,T9600,2000,NoData,[noparse][[/noparse]BIN9 ANSWER] 'Answer is delcared
as a Word.
It time's out. Any suggestions?
Other notes:
1. My oscope shows a word is coming back-- with plenty of time to
receive (10ms).
2. I'm at the right baud rate
Thanx,
-Barry
Comments
>I'm talking to a sensor using 9 bits RS232 (instead of 8 bits). This
>does not include the start and stop bit. I can tell the sensor (for
>example):
>SEROUT 15,T9600,[noparse][[/noparse]BIN9 %101010101]
That sends a string of 9 ascii characters as you would display them
on a screen, not what you might be expecting, a single unit
consisting of 9 bits.
>
>But I can't receive the 9 bit "answer" back:
>SERIN 14,T9600,2000,NoData,[noparse][[/noparse]BIN9 ANSWER] 'Answer is delcared
>as a Word.
That would only work if the answer is in fact 9 bytes containing the
ascii string "bbbbbbbbb". So if the system only answers back with
one 9-bit code, then SERIN will time out waiting for the other 8
bytes.
>
>It time's out. Any suggestions?
The Stamp cannot do 9 bit SERIN nor 9 bit SEROUT. The only options
are 8 bits, no parity, or 7 bits, even parity. To send and receive 9
bits you would have to go to an external UART, like the MAX3100
series from Maxim-ic.
>Other notes:
>1. My oscope shows a word is coming back-- with plenty of time to
>receive (10ms).
>2. I'm at the right baud rate
>
>Thanx,
>-Barry
Is this for your Prius?
-- Tracy
I'll try the UART.
This is not for my Prius (this time).
-Barry
--- In basicstamps@yahoogroups.com, Tracy Allen <tracy@e...> wrote:
> >Hello,
> >I'm talking to a sensor using 9 bits RS232 (instead of 8 bits).
This
> >does not include the start and stop bit. I can tell the sensor (for
> >example):
> >SEROUT 15,T9600,[noparse][[/noparse]BIN9 %101010101]
>
> That sends a string of 9 ascii characters as you would display them
> on a screen, not what you might be expecting, a single unit
> consisting of 9 bits.
>
> >
> >But I can't receive the 9 bit "answer" back:
> >SERIN 14,T9600,2000,NoData,[noparse][[/noparse]BIN9 ANSWER] 'Answer is delcared
> >as a Word.
>
> That would only work if the answer is in fact 9 bytes containing
the
> ascii string "bbbbbbbbb". So if the system only answers back with
> one 9-bit code, then SERIN will time out waiting for the other 8
> bytes.
>
>
> >
> >It time's out. Any suggestions?
>
>
> The Stamp cannot do 9 bit SERIN nor 9 bit SEROUT. The only options
> are 8 bits, no parity, or 7 bits, even parity. To send and receive
9
> bits you would have to go to an external UART, like the MAX3100
> series from Maxim-ic.
>
> >Other notes:
> >1. My oscope shows a word is coming back-- with plenty of time to
> >receive (10ms).
> >2. I'm at the right baud rate
> >
> >Thanx,
> >-Barry
>
>
> Is this for your Prius?
>
> -- Tracy