[51] Serial Communication in 8051

Status
Not open for further replies.

guravsid

Junior Member level 1
Joined
Oct 8, 2013
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
108
Hi...
I want to receive the data from sensor. The output of IR sensor is one bit i.e. either '1' or '0'. If I connect the IR sensor output to RxD pin of 8051 microcontroller, the it will receive only one bit at a time. Then how do I receive the series of 8 bits and save it to the other port. Can anyone give me the necessary C code for that ??
 

instead of connecting the output of ir sensor to rxd pin, you can simply connect the output to anyone of the i/o port pins, for example, pc.0 so that the output of ir sensor will be in the 8 bit port c.
if output of ir is 1 then the data in port c will be 00000001 .
 

u can connect it rx pin also and any GPIO but if you connect it to Rx then your baud rate should be maintain with UART protocols rules.
and best option go with any GPIO and shift the data reading some same interval of time and combine data like as we do in soft i2c protocol.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…