Forum Discussion
Altera_Forum
Honored Contributor
20 years agointerrupt handling for UART
hello everyone. I am trying to send and receive data between UART on UP3 and hyperterminal. But am not able to set the interrupts properly and as a result my program goes in an infinite loop. ...
Altera_Forum
Honored Contributor
19 years agoHey all,
Here is some working code for an UART RX interrupt: A interrupt function which takes the data from the serial port (and put it into for example in a char array) void UartReceiver1(void * content,alt_u32 id) { // get the uart data unsigned char * UartData = (unsigned char*)(UART1_BASE); // UART1_BASE is defined in system.h } } Setting up the interrupt: // UART1 interrupt routine declaration alt_irq_register(UART1_IRQ,NULL,UartReceiver1); IOWR_ALTERA_AVALON_UART_CONTROL(UART1_BASE, 0x80); Kind regards Karel