Hi,
I'm trying to get interrupts on the serial transmitter to work. Its working for the timer and serial receiver, but not for the transmitter.
I do this for the receiver & transmitter to enable interrupts for receive and transmit:
usart_set_rx_interrupt_level( &USARTE0, USART_INT_LVL_MED ); usart_set_tx_interrupt_level( &USARTE0, USART_INT_LVL_MED );
I have ISR's set up for the RXC and TXC vectors and the RXC vector is being used as I get my incoming characters through it OK. The ISR code:
ISR(USARTE0_RXC_vect) { rcvCounter++; intChar = USARTE0.DATA; dataAvail = 1; USARTE0.STATUS |= USART_RXCIF_bm; }; ISR(USARTE0_TXC_vect) { txcCounter++; USARTE0.STATUS |= USART_TXCIF_bm; };
The txcCounter tracks exactly the rcvCounter value even though I transmit much more than I receive. The rcvCounter tracks exactly the # of characters that I send to the Xmega.
What am I missing? I removed all uses of the stdio-serial stuff, but I haven't taken it out of the project yet. Does that touch the interrupt programming I'm doing to the transmitter? I'm now hand encoding everything that's printed.
Thanks,
madGambol