[En-Nut-Discussion] Problem: read uart port

samkol649 sophysamkol at hotmail.com
Sun Mar 22 18:00:30 CET 2009


Thanks to all who particapted in this thread.
By using your comments, I am able to get the what I am looking for. You are
right that we need to use a loop to get all the bytes we want.

So, thank you very much,
Sam

samkol649 wrote:
> 
> 
> Hi all,
> 
> I have a problem when I try to read from the UART port. I follow the
> uart.c sample application.
> Below are code snap
> 
> int got;
> static char inbuf[58];
> got = _read(_fileno(uart), inbuf, 58);
> 
> The
> problem is that I want to read 58 bytes from the UART port, but the
> read function always returns 'got' less than 58. Do you know why?
> Is there a way to tell the microcontroller to read exactly 58 bytes before
> returning. 
> In other words, if got < 58, keep on reading until got = 58. 
> 
> I have tried with both version: 3.9.7 and 4.6.3. I have ethernut board
> version 1.3f
> 
> Regards,
> Samkol
> _________________________________________________________________
> Share photos with friends on Windows Live Messenger
> http://go.microsoft.com/?linkid=9650734
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem%3A-read-uart-port-tp22607576p22648023.html
Sent from the MicroControllers - Ethernut mailing list archive at Nabble.com.




More information about the En-Nut-Discussion mailing list