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

samkol chea sophysamkol at hotmail.com
Thu Mar 19 19:57:02 CET 2009


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


More information about the En-Nut-Discussion mailing list