It is possible for 89C51 to receive 7-bit RS232 data? - Arch
This is a discussion on It is possible for 89C51 to receive 7-bit RS232 data? - Arch ; I am building a Remote Large Display for a weighing machine. The weighing machine continuously send out readout data of the weight it measures via an RS-232 port, which I intend to connect to my 89C51-controlled 5 digit 7-segment display. ...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| machine continuously send out readout data of the weight it measures via an RS-232 port, which I intend to connect to my 89C51-controlled 5 digit 7-segment display. Unfortunately, the weighing machine can only communicate in 2400Bps 7-bit even parity format. I have tested my display successfully with Hyperterminal program at 2400Bps, 8bit, even parity format. I connected the display to the weighing machine, and no wonder that it only displayed garbage because of the frame error. The Atmel Datasheet does not mention about 7-bit format. Is there any solution for my problem? Please help...! |
|
#2
| |||
| |||
|
jusmansulaiman wrote: > Unfortunately, the weighing machine can only communicate in 2400Bps 7-bit > even parity format. 7 bit even parity: so set it for 8 bit, no parity, and strip the MSB of the characters that come in. You can use it to check the parity (by lookup table) if you're anal or the boss is standing over you. If you have to transmit to it, calculate the parity (by lookup table) and OR it with the transmitted character. JS |
|
#3
| |||
| |||
| "jusmansulaiman" news:WrqdnVzw2eSW7oDUnZ2dnUVZ_r3inZ2d@giganews.com ... >I am building a Remote Large Display for a weighing machine. The weighing > machine continuously send out readout data of the weight it measures via > an > RS-232 port, which I intend to connect to my 89C51-controlled 5 digit > 7-segment display. > > Unfortunately, the weighing machine can only communicate in 2400Bps 7-bit > even parity format. I have tested my display successfully with > Hyperterminal program at 2400Bps, 8bit, even parity format. I connected > the > display to the weighing machine, and no wonder that it only displayed > garbage because of the frame error. The Atmel Datasheet does not mention > about 7-bit format. > > Is there any solution for my problem? Please help...! > > Yes, implement the comms in software.... instead of using the on board UART. You can still use the RXD pin. |
|
#4
| |||
| |||
|
>jusmansulaiman wrote: > >> Unfortunately, the weighing machine can only communicate in 2400Bps 7-bit >> even parity format. > >7 bit even parity: so set it for 8 bit, no parity, and strip the MSB of >the characters that come in. You can use it to check the parity (by >lookup table) if you're anal or the boss is standing over you. > >If you have to transmit to it, calculate the parity (by lookup table) >and OR it with the transmitted character. > >JS > JS, Thank you very much for your suggestion. I am surprised that the solution is very simple. Furthermore I don't need to transmit to the machine, and don't use the parity bit. My working code with 2400,8,n (using PC as terminal) was : mov a,87h orl a,#10000000b mov 87h,a mov SCON,#50h mov TMOD,#20h mov TH1,#E8h setb TR1 I understand that the databits are received with LSB first, then the parity bit, so that when the character is received in SBUF, the parity is the MSB. So I use the above code and just AND the SBUF with 7Fh. However, when I set the terminal at 2400,7,e and sent characters to the display, it still didn't work. Please advice if you have any other idea, and thanks for your help. |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 12:06 AM.




Linear Mode