Altera_Forum
Honored Contributor
20 years agoUART ISR
Has Anyone implemented ISRs with AVALON UART?
I'm trying to implement an ISR using the RRDY Interrupt bit in the STATUS register but it seems not work... has anyone an idea? i past and copy the functions: -- ISR instantiation -- void init_seriale_ext (void) { // Dichiarazione delle Variabili Interne // // Recast the _edge_capture pointer to match the alt_irq_register() // function prototype. void* serial_rcv_exception_ptr = (void*) &_serial_rcv_exception; // Register the interrupt handler. // alt_irq_register(SERIALE_EXT_IRQ, serial_rcv_exception_ptr, handle_seriale_ext_interrupt); } // END init_seriale_ext() // -- ISR ROUTINE -- void handle_seriale_ext_interrupt (void *context, alt_u32 id) { // It is important to keep this volatile, // to avoid compiler optimization issues. volatile int* serial_rcv_exception_ptr = (volatile int*) context; // Store the value in the Serial exception register in *context. // *serial_rcv_exception_ptr = IORD_ALTERA_AVALON_UART_STATUS(SERIALE_EXT_BASE); // Reset the Serial exception register. // IOWR_ALTERA_AVALON_UART_STATUS(SERIALE_EXT_BASE, (*serial_rcv_exception_ptr & 0xFF7F)); // richiamo la funzione che gestisce la ricezione di un pacchetto serial_protocol_ext(IORD_ALTERA_AVALON_UART_RXDATA(SERIALE_EXT_BASE)); } // END handle_serial_ext_interrupt // No errors were found in compilation, but it doesn't jump to the ISR function when I send anythink using the UART. Help... shadowice