Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

uart interrupt

Altera_Forum
Honored Contributor II
999 Views

hi ! 

i'm trying to use interrupt in NIOS II ide for the uart. 

Are two days that i study this problem . 

I saw sw development and reference handbooks , and found different informations about uart core and hal api functions , and also read a lot of  

driver devices and .h files . 

I found also an example writing by Kira and use it for my case  

the code is : 

 

# include "count_binary.h" 

 

volatile int t; 

volatile int uart_0; 

 

static void handle_uart_interrupt(void* context,alt_u32 id) 

t++; 

IOWR_ALTERA_AVALON_PIO_DATA(PM_OUT_BASE, t); 

 

 

 

 

int main(void) 

{  

 

IOWR_ALTERA_AVALON_UART_CONTROL(UART_0_BASE, 0x180); 

alt_irq_register(UART_0_IRQ,&uart_0,handle_uart_interrupt);  

 

 

while( 1 )  

 

 

 

return(0); 

 

but not run .On my development board i can see the led switch on when  

a caracter arrive , but the interrupt doesn't work  

Somebody know if i forget something else ? 

thanks 

ciao  

walter
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
301 Views

Hi, 

is it possible that your interrupt service routine does not clear the interrupt? may be, you can try to write zero to the status register?!
0 Kudos
Altera_Forum
Honored Contributor II
301 Views

thanks  

i resolved the problem and post the code  

to help if somedoby need something 

ciao
0 Kudos
Altera_Forum
Honored Contributor II
301 Views

 

--- Quote Start ---  

originally posted by pmicro@Mar 23 2006, 07:41 AM 

thanks  

i resolved the problem and post the code  

to help if somedoby need something 

ciao 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=13719) 

--- quote end ---  

 

--- Quote End ---  

 

 

Hi 

Can you post the correct code? 

 

PS: Are you italian?
0 Kudos
Reply