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++
12748 Discussions

Interrupt from external device

Altera_Forum
Honored Contributor II
1,137 Views

Hi from a new member. 

 

I've interfaced an external device to Nios II using the "user logic" option. The external device is memory mapped, and the basic interface works OK...using the component editor I have successfully provided data, address, RdWrn, Wait, etc. I was able to peek and poke, as well as reading/writing with C code. 

 

Once this worked, I wanted to have the external device's IRQn pin cause a Nios interrupt. I added an IRQn signal in the component editor, but... 

 

no IRQn pin appeared on the SOPC symbol 

no IRQ number appeared in the System contents IRQ column. 

 

The conclusion I have reached is that adding the IRQn signal in the component editor pertains to the avalon bus, and that creating an external IRQ input pin is a separate matter. 

 

I imagine I can accomplish this by implementing a single-bit PIO that interrupts on falling edge and connecting the external device to this pin. Is this the way to go? Is there a better way? 

 

Thanks!
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
475 Views

I used the older "legacy components ->interface to userlogic" and it  

works with an external interrupt.  

 

I simply setup the interface as following 

 

Interface to user logic: 

 

PORTNAME WIDTH DIRECTION SHARED TYPE 

address 8 input yes address  

write_n 1 input yes write_n 

read_n 1 input yes read_n 

data 8 inout yes data 

chipselect_n 1 input --- chipselect_n 

irq_n 1 output --- irq_n 

 

After updating the symbol in quartus, there is the irq pin on the cpu symbol.  

 

I think there seems to be some problems with the new component editor, so perhaps  

try the old interface. 

 

Perhaps somebody from Altera can answer this question, 

i have read some problems about the new component editor, does it works ???
0 Kudos
Altera_Forum
Honored Contributor II
475 Views

Thanks for reply. 

 

Yes, that&#39;s basically what I did with the new component editor...the expected interrupt pin didn&#39;t show up http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif
0 Kudos
Reply