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.

[SOLVED] Receiving Data on PIC UART (Quick Code Question)

Status
Not open for further replies.

ste2006

Advanced Member level 4
Joined
May 1, 2012
Messages
118
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
2,226
I have some code written that receives data from a PIC18F UART, When i use the "gets" routine from the peripheral library it works fine but when i write my own for loop it wont work at all,

Anyone any ideas??

Works perfectly

Code:
gets2USART((char *)RxData,9);

Wont Work

Code:
for (ccount=0;ccount < 10; ccount++)
         {
             RxData[ccount] = Read2USART();
         }

I cant see the difference,

Any thoughts??

Thanks

- - - Updated - - -

Its Ok i solved it,

For any one else with a similar issue you need to poll the receive bit and only call the Read2USART when new data is ready
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top