avr-gcc-list
[Top][All Lists]
Advanced

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

RE: [avr-gcc-list] help -- ATMEGA48 uart recv interrupt


From: Xing Yu
Subject: RE: [avr-gcc-list] help -- ATMEGA48 uart recv interrupt
Date: Fri, 15 Jul 2005 01:45:14 +0100 (BST)

Many thanks!  using 'signal' solves the problem.

Best regards,
Xing
--- Trampas <address@hidden> wrote:

> Use signal instead of interrupt. I find using the
> Interrupt will cause the
> ISR to be called twice and lock up as you mentioned.
> 
> 
> Regards,
> Trampas Stern 
>  
> 
> 
> -----Original Message-----
> From:
> address@hidden
>
[mailto:address@hidden
> On Behalf Of Xing
> Yu
> Sent: Thursday, July 14, 2005 3:45 PM
> To: address@hidden
> Subject: [avr-gcc-list] help -- ATMEGA48 uart recv
> interrupt
> 
> 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 mailing list
> address@hidden
>
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
> 
> 
> 



        
        
                
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com




reply via email to

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