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.

LPC1227 help in receiving data from UART1

Status
Not open for further replies.

arunkollam

Junior Member level 2
Joined
Jun 26, 2008
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,412
Hi
i am writing a program which receives 0x03 and 0x04 strings continusly via UART0 and sends to a device through UART1.The device responds with a 3 bit data for each command(0x03 and 0x04).


DEVICE-1 sends 0x03 =>uart0----- LPC1227-----UART1=>0x03 to the device2
DEVICE-2 sends 0x01 0x0c 0xff =>uart1----- LPC1227-----UART0=>0x01 0x0c 0xffto the device1

DEVICE-1 sends 0x04 =>uart0----- LPC1227-----UART1=>0x04 to the device2
DEVICE-2 sends 0x01 0x0c 0xff =>uart1----- LPC1227-----UART0=>0x01 0x0c 0xffto the device1



The first bit of the receving bit is a command and it should be always 0x01.
my problem is in receiving the 3 bit data , some times the device 2 will not send 3 bits of data insted it will send 1 or 2 bits and my getchar waits for receiving it and the program enter into a endless loop.so any one can help me in writing a timer which waits for receiving the data for 5 ms and after 5ms , if there is no data received restart or clear the uart buffer.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top