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

Cyclone SL811HS interrupts

Altera_Forum
Honored Contributor II
1,236 Views

I think there's a problem with the Cyclone Development Board. 

 

I am using the NIOS-II Kitchen sink design, and I have coded a small USB driver for the board. I am now capable of performing a full enumeration sequence on Windows XP. 

 

However - I am unable to get interrupts from the SL811HS controller into the NIOS-II core. So the way I've implemented the "driver" is by having a loop continuously polling the SL811HS's interrupt status register. The sample code which was presented in this forum, uses the same technique. 

 

On the NIOS-1 examples, some sort of interrupt is used. I beleive it may run on a timer-interrupt instead of the "real" interrupt from the SL811HS - Is this correct? 

 

If there is an issue with the USB controller and Interrupts, please let me know.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
559 Views

The interface component we created to connect the SL811HS to the Avalon bus has an extra facility for enabling/diabling interrupts. The bit to allow interrupts to pass through lives in the 3rd register of our interface component (usb_base_address+8) at bit 2. Writing a 0x4 to this register will enable interrupts from the SL811HS to reach the Nios processor. 

 

I am emailing you the most recent version of our document describing our USB reference project (a similar document should have come on the CD with your board). It contains a description of our SL811HS-to-Avalon interface. 

 

Dennis Scott 

Microtronix Datacom Ltd.
0 Kudos
Altera_Forum
Honored Contributor II
559 Views

Wow.. again.. brilliant support - thanks guys. 

 

Yes - it did work, I am now getting interrupts - I don't know if I missed something in the docs.  

 

To anyone following this discussion here's how I enabled interrupts from the SL811HS to the NIOS-II core.. 

 

// you need this: 

//---------------------------------------------------------------------------------- 

volatile unsigned int *pAddrSel = (unsigned int*) (USB_BASE); 

 

// write a single byte to the controller at addr 

void Write ( unsigned int addr, unsigned int value ) 

pAddrSel[0] = addr; 

pAddrSel[1] = value; 

 

then somewhere in your code... 

// enable the interrupts to come through 

IOWR_ALTERA_AVALON_PIO_DATA(USB_BASE + 8, 0x04);  

 

// register an interrupt handler for the USB interrupts 

alt_irq_register (USB_IRQ, NULL, handle_USB_interrupts); 

 

// enable all interrupts from the controller 

Write ( REG_INTERRUPT_ENABLE, 0x7f ); 

 

that's it...
0 Kudos
Reply