[Top][All Lists]

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

[avr-libc-dev] Interrupt and signal on UART

From: gianni rossi
Subject: [avr-libc-dev] Interrupt and signal on UART
Date: Mon, 9 May 2005 11:48:33 +0200 (CEST)

I'm a newbie to AVR & GCC and I'm trying to learn the
use of c to program my avr microcontrollers Atmega128.
I found a problem when I tried to handle INTERRUPT 
on UART:
If "SIGNAL" is used to define the handler function
it works, is I use "INTERRUPT" the function halts.

I think I need "INTERRUPT" because in real application
multiple events can happen at the same time.

I'm using WINAVR.

Thank you

Here is the simple code a wrote to test these 

#include <avr/io.h>
#include <stdlib.h>
#include <stdio.h>
#include <avr/signal.h>
#include <avr/interrupt.h>


char c;
        c = UDR0;
        loop_until_bit_is_set(UCSR0A, UDRE0);   //Send echo
        UDR0 = c;

int main (void) {

//UART0 19200 8 N 1
//RX Interrupt = ENABLE

        UBRR0H = 0x00;
        UBRR0L = 0X0B;
        UCSR0A = 0x00;
        UCSR0B = 0x98;
        UCSR0C = 0x06;

        while (1) {


Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam, 
Giochi, Rubrica… Scaricalo ora! 

reply via email to

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