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.