[En-Nut-Discussion] Difference between devUart0 & devUart1

ZIP zip357 at centrum.cz
Wed Aug 23 14:50:34 CEST 2006


Thanks,

  I've changed 2 things.

1 - switched off ATMEGA103 compatibility mode :(
2 - used the mode r+b.

Now everything seems ok .. probably the problem was ATMEGA103 
compatibility mode ...

Petr

Thiago A. Corrêa napsal(a):
> DEV_UART0 is defined as devUsartAvr0 in the ethernut headers, it should
> work. It is working for me.
> 
> Notice that the open mode in fopen isn't quite standard CRT complient, and
> it crash if you give "rw+b". I'm using "r+b" and it's working ok.
> 
> Friendly Regards,
>   Thiago A. Corrêa
> 
> On 8/23/06, ZIP <zip357 at centrum.cz> wrote:
>>
>> Hello,
>>
>>   I'm begginer with ethernut.
>>
>>   First I worked with examples from ethernut, where is the devDebug0. It
>> worked fine. Then I tryied devUart0 it was also OK. But when I started
>> to test UART1 a saw devUsartAVR0. I tried the simple program
>>
>>         u_long baud_uart0 = 19200;
>>
>>         init_dio();
>>         NutRegisterDevice(&DEV_UART0, 0, 0);
>>
>>         cd_serial1 = fopen(DEV_UART0_NAME, "w");
>>
>>         _ioctl(_fileno(cd_serial1), UART_SETSPEED, &baud_uart0);
>>
>>         fprintf(cd_serial1, "Hello world!\n");
>>
>> when I put DEV_UART as devUart0 it works, but when put devUsartAVR0, I
>> can't get it working. Something is sending to the serial line, but it's
>> not interpreted clearly.
>>
>> I also wanted to get UART1 working and don't know what to use. Because
>> when I tried &devUart1, I got even program crash.
>>
>> Please help,
>>
>> Petr
>>
>> _______________________________________________
>> En-Nut-Discussion mailing list
>> En-Nut-Discussion at egnite.de
>> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
> 
> 



More information about the En-Nut-Discussion mailing list