[En-Nut-Discussion] _ioctl transmitting 0x00 upon startup?

Anton Veldhuizen emtech at telkomsa.net
Wed Oct 5 17:34:40 CEST 2005


Hi all,

I seem to get 0x00 transmitted whenever the following code executes:
unsigned long commsBaud = 9600;
NutRegisterDevice(&devUsartAvr0, 0, 0);
General.usart0FilePtr = fopen("uart0", "w+b");
_ioctl(_fileno(General.usart0FilePtr), UART_SETSPEED, &commsBaud);

I am using WinAVR 20050214 and NutOs 3.9.8.  I also use my own PCB layout of
ethernut.  However, when I use the Uart manually, using WinAVR only (i.e. no
NutOs), I do not get 0x00 transmitted.

The problem seem to come from _ioctl(), but I can't say for sure, bacause my
baud rate/settings could be incorrect.  Any one ever spotted this?

Best regards,
Anton Veldhuizen




More information about the En-Nut-Discussion mailing list