dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

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. ...


Home > Database Forum > Other Technologies > Arch > It is possible for 89C51 to receive 7-bit RS232 data?

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 11-14-2008, 08:46 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default It is possible for 89C51 to receive 7-bit RS232 data?

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...!


Reply With Quote
  #2  
Old 11-14-2008, 08:53 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: It is possible for 89C51 to receive 7-bit RS232 data?

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
Reply With Quote
  #3  
Old 11-14-2008, 10:10 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: It is possible for 89C51 to receive 7-bit RS232 data?


"jusmansulaiman" wrote in message
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.


Reply With Quote
  #4  
Old 11-14-2008, 10:00 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: It is possible for 89C51 to receive 7-bit RS232 data?

>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.


Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 12:06 AM.