[En-Nut-Discussion] Lost caracter with At91 UART0

Remi Bilodeau remi.bilodeau at gmail.com
Fri Dec 16 20:14:56 CET 2011


Here the test code:

    NutRegisterDevice(&DEV_UART0, 0, 0);
    stdout = fopen(DEV_UART0_NAME, "w+");  
    stdin=stdout;	

(other init code not displayed here...)

    freopen(DEV_UART0_NAME, "w+b", stdout);
    stdin=stdout;

	printf("\nWaiting 16 bytes transmission...\n");
	while(kbhit()==0);
	for(i=0; i<16; i++) {
		c = getchar();
		if(c==EOF) buf[i]=255;
		buf[i]=c;
	}
	
    freopen(DEV_UART0_NAME, "w+", stdout);
    stdin=stdout;

	printf("Result of 16 bytes receive:\n");
	for(i=0; i<16; i++) printf("%02X",buf[i]);
	printf("\nDone...");

I send in binary this hex string:
00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F (total 16 byte)

Result of 16 bytes receive:
00010203050607080B0C0D0E0F000102  (I send the 16 bytes twice, to complete
the 16 bytes on AT91)

Here other try I make:
00010203060708090B0C0D0E0F000102
01020304060708090C0D0E0F01020304
000203040508090A0B0D0E0F00020304
00010204050607080A0B0C0D0F000102

Always lost caracter, no buffering at all I think.. (no IRQ??????) ioctl
report 256 byte RX buffer.

I send only ASCII: ABCDEFGHIJKLMNOP in hex: 4142434445464748494A4B4C4D4E4F50

4142434445464748494A4B4C4D4E4F50 (good one)
4142434445464748494A4B4C4D4E4F50
4142434445464748494A4B4C4D4E4F50
4142434445464748494A4B4C4D4E4F50
4142434445464748494A4B4C4D4E4F50

Huh??????? I make the test in same time I wrote this e-mail... Why when I
use number 00-0F I lost caracter randomly and not with plain ASCII ????????
Very strange... 

I try with this: FFFEFDFCFBFAF9F8F7F6F5F4F3F2F1F0

Again, perfect receive of AT91... Seem the serial buffer is OK, but got
problem with 00-0F caracter...

idea ?????????????????







-- 
View this message in context: http://old.nabble.com/Lost-caracter-with-At91-UART0-tp32983427p32989204.html
Sent from the MicroControllers - Ethernut mailing list archive at Nabble.com.




More information about the En-Nut-Discussion mailing list