Forum Discussion
Altera_Forum
Honored Contributor
21 years agoHi again!
I'll repeat my problem again. I want to CATCH the moment by UART interrupt handler, when UART already received data via rxd and to READ these data, character. Now I realized timer and wrote the timer interrupt handler, which allows to read status register of UART. So I see how the condition of UART status register is changed after receiving data. Here my steps: 1. In the beginning I set control register 0x180. So I set IRRDY and IE bits. IRRDY - Enable interrupt for a read ready. IE - Enable interrupt for an exception. 2. then I define alt_irq_register( UART_0_IRQ , &uart_0, handle_uart_interrupt ); 3.static void handle_uart_interrupt (void* context, alt_u32 id)
{
uval++;
IOWR_ALTERA_AVALON_PIO_DATA( PIO_0_BASE ,uval);
} 4. When character is received via rx UART, the condition of status register become 0xE0. RRDY is 1, so the interrupt for read ready must appear. If the condition of status register is changed, then corresponding interrupts must appear. But I didn’t see the results of handle_uart_interrupt function. How can I catch this UART interrupt (for receiving) ? Thank you.