M0_SGPIO_IRQHandler query

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

M0_SGPIO_IRQHandler query

436 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JohnR on Tue Sep 11 14:09:22 MST 2012
Hi,

I have developed a SGPIO interface on M4 to talk to an SPI-based ADC, using the example in AN11210 cut down to a single interface rather than the original dual. Works fine but I am now trying to get SGPIO working from M0, as I would like to use M0 as the interface, leaving M4 to do the subsequent data processing/display etc.

So far I have not been able get M0_SGPIO_IRQHandler to respond. I can generate the SPI drive waveform from code in M0 that drives the ADC and I can see the serial data from it, exactly the same as the earlier M4 version. But the handler never gets called?

In the M0 main I call NVIC_EnableIRQ(M0_SGPIO_IRQn). Are there any other changes needed?

Thanks for any help.

John.
Labels (1)
0 Kudos
5 Replies

420 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JohnR on Sat Oct 13 10:48:13 MST 2012
Hi,

I have now modified the g_pfnVectors list in the M0 startup file to agree with the User Manual. The only difference now between the two is that the exception number 30, PIN_INT4_IRQHandle, was not recognised and has now been replaced by M0_RESERVED2_IRQHandler.

The M0_SGPIO_IRQHandler works fine now. I have not checked the opertion of any of the interrupts with exception numbers above 35 other than M0_SGPIO but I hope they are correct.

Thanks again for your help,

John.
0 Kudos

420 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JohnR on Thu Sep 13 07:11:49 MST 2012
Thanks again for your help.

The CodeRed NXP compiler uses a startup file, cr_startup_lpc43xx-m0.c, rather than the Keil's .s file.

I thought I could avoid modifying this compiler-generated file by using M0_I2C0_OR_I2C1_IRQHandler, // 35 I2C0 or I2C1, instead of
M0_SGPIO_IRQHandler, // 36 Serial GPIO. I have had no success so far using either M0_I2C0_OR_I2C1_IRQn or M0_SGPIO_IRQn as the interrupt ID.

I have the SGPIO system working in M0 by running the SGPIO calls from a while(1) loop in the main code, a bit crude but it is a start.

Any more ideas as still welcome.

John.

0 Kudos

420 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Thu Sep 13 01:41:42 MST 2012
I used the constant M0_SGPIO_IRQn which has the value 19, from the LPC43xx.h in Keil MDK.
This is the interrupt id.

The 36 is supposed to be the exception number, but it is incorrect.
The correct exception number is 35 = 19 + 16, so you need to update your vector table
in the startup file (startup_LPC43xx_M0.s for me).
See the chapter on the Cortex M0 NVIC in the user manual.
0 Kudos

420 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JohnR on Wed Sep 12 07:40:06 MST 2012
Thanks for the reply.

What number did you use for NVIC_EnableIRQ() for the M0 interrupt M0_SGPIO_IRQn?

from LPC43xx.h date     9. December 2011

M0_SGPIO_IRQHandler,                    // 36 Serial GPIO

From cr_startup_lpc43xx-m0.c

M0_SGPIO_IRQn                     =  19,  /*!<  19  SGPIO                            */

I have tried both NVIC_EnableIRQ(36)and NVIC_EnableIRQ(19)without success.

John.



0 Kudos

420 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Wed Sep 12 00:41:04 MST 2012
I found that the vector table for the M0 was incorrect (probably outdated), so the SGPIO interrupt ended up in the default handler.
After updating it the SGPIO interrupt on the M0 works for me.
0 Kudos