Click here to Skip to main content
15,886,661 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to use USART to receive continous data from RS232 port and not able to receive all the data.

What I have tried:

I previously tried using UART for RS232 port and the data was receiving properly but when I try to use it using USART the data is getting lost For example:
My data : 1234567890
I'm receiving: 06

Can anyone provide any suggestion ?
Is USART using is creating a problem? Can we not use USART for RS232 data sending and receiving?
Posted
Updated 18-Aug-22 0:33am

USARTs work fine with RS232 - but they need a 232 driver chip as the voltages are very different - USARTs use TTL levels, which run from 0V to at most 5V, while RS232 requires negative voltages and can be between +15V and -15V.

Feed that into a USART directly, and it'll probably receive, but you'll also probably damage the chip and lower it's life expectancy considerably. You probably won't be able to transmit successfully as you've seen!
 
Share this answer
 
v2
Quote:
using UART for RS232 port and the data was receiving properly

As OriginalGriff noted, logic levels usually differ. The above statement leads me to believe that either it is not a simple UART, or the RS232 does not follow the rules.
USART chips are "extensions" of the simple UART chips that additionally support synchronous communication modes.
So it could be that for the USART other (or more) settings are required, or the levels have changed due to the change. I would look first at the communication with an oscilloscope or similar and compare it with the working connection.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900