[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] Re: USART interrupts
From: |
Bob Halford |
Subject: |
[avr-gcc-list] Re: USART interrupts |
Date: |
Tue, 15 Apr 2003 10:05:42 +1200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 |
This is most likely an FAQ but it would seem (with the mega8 at least)
that you
have to use SIGNAL rather than INTERRUPT for SIG_UART_RECV as
the code produced by the C-compiler does not read the UDR until after
whole bunch
of registers have been pushed on the stack..... Difficult to say with
the limited
in-circuit tools to hand but my guess is that when using INTERRUPT, as
soon as the
interrupt is re-enabled, the un-cleared RXC flags immediately causes
another interrupt
and so on until the stack is full.
Is this really what happens? If so, surely this is a bug.... the
interrupt arbritation logic
should not allow this (ie one way of avoiding this is to make the
interrupt transition
rather than level sensitive.. but preferable is to disallow recursive
interrupts).
You can kind of work round the problem by using SIGNAL and doing an
sei() just after
reading the UDR but does this mean that if the SIG_UART_RECV s/r does
not get done
before the next RXC, we are in the shit?
Cheers, Bob
- [avr-gcc-list] Re: USART interrupts,
Bob Halford <=