[En-Nut-Discussion] Troubles with uart1
Stephen Noftall
stephenn at lcsaudio.com
Tue Feb 4 17:20:41 CET 2003
Hello Maurilo;
I have been able to get UART0 and 1 to work with Ethernut. There is an
option in the programming flags for Atmega103 (?) compatibility mode. When
this is enabled, UART1 is disabled, I think. So you must be in full
Atmega128 mode to have UART1 enabled. I think you also need to disable the
JTAG port in the options as well, but I do not know for sure.
Good luck!
Stephen Noftall
----- Original Message -----
From: <maurilio.bortolussi at ade.it>
To: <en-nut-discussion at egnite.de>
Sent: Monday, February 03, 2003 11:22 PM
Subject: [En-Nut-Discussion] Troubles with uart1
> Hello,
>
> i am a newbie of Nut/OS i am working with Nut/OS 2.6.0 and GCC 3.3;
>
> i want to use the uart1 with httpd example but i have some troubles.
> I introduced the code below and the result is that uart0 works but the
> uart1 doesn't work.
>
> Why ?
>
> Maurilio
>
>
>
>
> #define _UART1
>
> #ifdef _UART1
> NUTDEVICE *uart0;
> NUTDEVICE *uart1;
> #endif
>
>
> THREAD(NutMain, arg)
> {
> u_long baud = 115200;
> u_char i;
>
> /*
> * Initialize the uart device.
> */
> #ifdef _UART1
> NutRegisterDevice(&devUart0, 0, 0);
> uart0 = NutDeviceOpen("uart0");
> NutDeviceIOCtl(uart0, UART_SETSPEED, &baud);
>
> NutRegisterDevice(&devUart1, 0, 0);
> uart1 = NutDeviceOpen("uart1");
> NutDeviceIOCtl(uart1, UART_SETSPEED, &baud);
> #else
> NutDeviceIOCtl(0, UART_SETSPEED, &baud);
> outp(BV(RXEN) | BV(TXEN), UCR);
> #endif
>
>
> #ifdef _UART1
> NutPrintString_P(uart0, PSTR("\r\n uart0 HTTP Daemon..."));
> NutPrintFlush(uart0);
> NutPrintString_P(uart1, PSTR("\r\n uart1 HTTP Daemon..."));
> NutPrintFlush(uart1);
> #else
> NutPrintString_P(0, PSTR("\r\nHTTP Daemon..."));
> #endif
>
> ........
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo/en-nut-discussion
More information about the En-Nut-Discussion
mailing list