[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Problems with UART

From: Olav Torheim
Subject: [avr-gcc-list] Problems with UART
Date: Fri, 25 Apr 2003 16:02:17 +0200 (CEST)


Our original problem with writing to the UART has now been solved. Now we have another problem with running the gccctest7-example. The UART simply won't read the received characters after entering the for-loop. When removing line 13 and line 25, the program executes fine, running from top to bottom of the c-source. But as soon as we insert the for-statement, it seems like the program is running through the loop without being able to read anything else than zeroes. UART_ReceiveByte() makes the program wait until a character is being sent. It detects that a character is being sent, but the program only gives out zeroes when returning the input on line 20 and 22.

Do anybody know how to solve this problem?

Olav Torheim

1 #include "uart.h"
2#include <progmem.h>
4 int main(void)
5 {
6   u08 data;
7    /* Initialise UART */
8    UART_Init();
10  PRINT("Hello World !");
11  EOL();
13 for (;;) {  /* loop forever */
14        PRINT("Press any key...");
15        EOL();
17        data = "">18   
19        PRINT("You pressed '");
20        UART_SendByte(data);
21        PRINT("' which is 0x");
22        UART_Printfu08(data);
23        PRINT(" in hexadecimal.");
24        EOL();
25    }
26 }

Ny versjon av Yahoo! Messenger
Nye ikoner og bakgrunner, webkamera med superkvalitet og dobbelt så morsom

reply via email to

[Prev in Thread] Current Thread [Next in Thread]