[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] help -- ATMEGA48 uart recv interrupt
From: |
Xing Yu |
Subject: |
[avr-gcc-list] help -- ATMEGA48 uart recv interrupt |
Date: |
Thu, 14 Jul 2005 20:45:15 +0100 (BST) |
Dear all,
I am having a problem with the ATMEGA48's uart receive
interrupt. In the program, I enabled both uart
receive and transmit interrupts. The transmit
interrupt seems doing ok -- it sends out characters
continuously; the receive interrupt doesn't work --
whenever the ATMEGA48 receives a character the
processor hangs.
Here's the ISRs used in my program --
/* UART receive interrupt handlers */
void SIG_USART_RECV (void) __attribute__
((interrupt));
void SIG_USART_RECV (void)
{
// if(UART_RxCount < UART_RxLen)
UART_RxBuf[UART_RxCount++] = UDR0;
// app_regs[LED_STATUS_REG] = UART_RxCount;
}
void SIG_USART_TRANS (void) __attribute__
((interrupt));
void SIG_USART_TRANS (void)
{
if(UART_TxCount < UART_TxLen)
UDR0 = UART_TxBuf[UART_TxCount++];
}
I've checked the map file -- the __vector_18 (UART
receive) and __vector_20 (UART_transmit) are there, so
I assume the compiler didn't ignore my ISRs.
UART reception using polling method is OK, but it is
bad for my state-machine :(...
I wonder if anyone has made the ATMEGA48 uart receive
interrupt working and could kindly help me on this
issue. I am using the lasest winavr 20050214 version.
Many thanks,
Xing Yu
___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail
http://uk.messenger.yahoo.com
- [avr-gcc-list] help -- ATMEGA48 uart recv interrupt,
Xing Yu <=