Hi
also hiermit bekomme ich mein terminal mit 'c' s zugeschossen... wenn ich das ganze ohne funktion mache bekomme ich auch nur ein c! jemand ne idee woran das liegt?
Danke
Martin
Code:#include <avr/io.h> #include <avr/interrupt.h> #include <avr/iom128.h> #include <util/delay.h> #define BAUD 9600L #define UBRR_BAUD ((16000000/(16UL*BAUD))-1) void put_uart_c(uint8_t c) { while(!( UCSR0A & (1<<UDRE0))); UDR0 = c; _delay_ms(100); } ISR (USART0_RX_vect) { char c=UDR0; put_uart_c(c); } int main(void) { cli(); UBRR0H = (uint8_t) (UBRR_BAUD>>8); UBRR0L = (uint8_t) (UBRR_BAUD); UCSR0B = (1<<RXEN0)|(1<<TXEN0)|(1<<RXCIE0); UCSR0C = (1<<UCSZ01)|(1<<UCSZ00); sei(); put_uart_c('c'); while (1) { } return 0; }






Zitieren

Lesezeichen