Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[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
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 ??
 

For this, you have to shift the value from the rxd to any one of the register and then move to corresponding ports..
 

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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top