[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] USART - Interrupt - problem
From: |
Theodore A. Roth |
Subject: |
Re: [avr-gcc-list] USART - Interrupt - problem |
Date: |
Sat, 22 May 2004 14:26:05 -0700 (PDT) |
On Sat, 22 May 2004, Onno van Eijk wrote:
> Hi,
>
> Just recently I have started programming micro controllers. I am using
> the ATMega32 on an stk500 with avr-gcc (on Debian), and I have run into
> trouble I cannot solve.
> I just want to use receive data by Interrupt, but I can't get it going.
> See the sample code below. While running this code nothing happens. I
> have tried different variations but nothing seems to help.
> (Disabling the interrupt and enabling the code in the main.while loop
> does work; so the serial USART + Connection work fine)
>
> settings
> lfuse: 0xca
> hfuse: 0x59
> lock: 0x3f
>
> Any Idea's?
> grz,
> Onno
>
> #include <avr/io.h>
> #include <avr/signal.h>
> #include <avr/interrupt.h>
>
> SIGNAL(SIG_USART_RECV)
The mega32 header defines this:
#define SIG_UART_RECV _VECTOR(13)
Fix that and you should get things working.
> {
> while ( !(UCSRA & (1 << RXC) ) );
I don't think you need this while loop.
---
Ted Roth
PGP Key ID: 0x18F846E9
Jabber ID: address@hidden