Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

Interrupt from external device

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!

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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 ???