Interrupt not serviced

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Interrupt not serviced

362 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mspahr on Thu Sep 05 10:41:48 MST 2013
I am using LPCXpresso V5.2.6
LPC11U37
The project is from LPWare/LPC11xx/Downloads/Software/Sample code bundle for LPC1xx peripherals using NXP LPCXpresso.
I have based my project on the example USB ROM MSC.

I have added I2C functionality (using I2C.c from the examples) to talk to an EEPROM.
I can read and write the EEPROM outside the USB.
However the USB is interrupt driven.
The I2C driver is also interrupt driven.

In the USB translate_read() function (which is called from a USB interrupt),
when I try to use the I2C to read the EEPROM,
the I2C interrupts are not serviced.

I can see from the NVIC registers that the I2C interrupt is enabled and pending.

What do I need to do to allow the nested interrupt to be serviced.


0 Kudos
3 Replies

311 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tsuneo on Sun Sep 08 12:42:50 MST 2013

Quote:
In the USB translate_read() function (which is called from a USB interrupt),
when I try to use the I2C to read the EEPROM,
the I2C interrupts are not serviced.


You may assign higher priority to the I2C interrupt than USB, for nested interrupts.

#define NVIC_PRIORITY_LOWEST   ((1<<__NVIC_PRIO_BITS) - 1)
#define NVIC_PRIORITY_LOWER    ((1<<__NVIC_PRIO_BITS) - 2)

int main (void)
{
  ...
  NVIC_SetPriority( I2C_IRQn, NVIC_PRIORITY_LOWER  );
  NVIC_SetPriority( USB_IRQn, NVIC_PRIORITY_LOWEST );

  NVIC_EnableIRQ( I2C_IRQn ); //  enable I2C interrrupt 
  NVIC_EnableIRQ( USB_IRQn ); //  enable USB interrrupt
  /* now connect */
  pUsbApi->hw->Connect( hUsb, 1 );


Tsuneo
0 Kudos

311 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mspahr on Fri Sep 06 09:46:00 MST 2013
I had a couple typos, it should read
The project is from LPCWare/LPC11Uxx/Downloads/Software/Sample code bundle for LPC11Uxx peripherals using NXP LPCXpresso.
I have the right examples for the processor I am using.
The USB_ROM_MSC and I2C examples work fine by themselves.
When the I2C is called from within the USB interrupt, the I2C interrupt is never serviced.
0 Kudos

311 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Fri Sep 06 01:04:31 MST 2013
In the first place, note that the LPC11Uxx and LPC11xx are distinctly different parts, with different peripheral sets and example code.

You can find basic examples for the LPC11U family inside your LPCXpresso installation at:

C:\nxp\LPCXpresso_5.2.6_2137\lpcxpresso\Examples\NXP\LPC1000\LPC11Uxx

Additional information and examples can be downloaded from LPCware at:

http://www.lpcware.com/node/11538/128

Regards,
LPCXpresso Support
0 Kudos