PDA

View Full Version : start/stop bit ????



electromanj
11-07-2010, 02:18 AM
Hello all!
I have a question about start and stop bits in a serial protocal. Modbus RTU.
The "telegram" I need to send is....
HEX 01_03_3F_01_00_01_D9_DE
The info that I have states that each byte should be 11 bits. 1 start bit, 8 data bits, and two stop bits, no parity. From what I've read the rx line of the device I'm sending to is idle high, and I'm guessing that my start bit needs to be a 0 and the stop bits need to be a 1.
Does this look even close to correct or am I way off?


vfd.tx (%0$01%1_1_0$03%1_1_0$3F%1_1_0$01%1_1_0$00%1_1_0$0 1%1_1_0$D9%1_1_0$DE%1_1)
'b^h--bs s ^h--bs s ^h--bs s ^h--bs s ^h--bs s ^h--bs s ^h--bs s ^h--bs s
' b = binary indicator
'^ = start bit
' h = hex indicator
' -- = hex byte
' s = stop bitThanks in advance.
Thanks in advance.

kwinn
11-07-2010, 04:50 AM
If you scoped the output of an RS232 driver chip HEX 01 would be: LHHHHHHHLHH
Where L is -3 to -15V (1) and H is +3 to + 15V (0), in binary 10000000100

Any hex or 8 bit character would be LxxxxxxxxHH, where the x represents the individual 8 bits.

Phil Pilgrim (PhiPi)
11-07-2010, 05:12 AM
kwinn,

The output from an RS232 driver is inverted, the idle state is 1 (mark) and serial data is sent LSB first. So the output from an RS232 driver for a HEX 01 would be



S
T SS
A TT
R OO
T PP
1111010000000111111 <- data
LLLLHLHHHHHHHLLLLLL <- RS232 output

electromanj
11-07-2010, 01:49 PM
Thanks for the replies.

I forgot to mention that I will be using a TTL to RS485 Converter. (SerialComm TTL-485-5P).

kwinn
11-07-2010, 03:44 PM
Phil, good catch. I should know better than to answer questions late at night when I am tired.