SPI interface at fixed intervals based on eTimer_0 in MPC5744P

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

SPI interface at fixed intervals based on eTimer_0 in MPC5744P

513 Views
azeemsha_poyil
Contributor I

Hi All

I am stuck with an issue using MPC5744P for SPI interface with an external sensor. I want to set the rate of calling the readSensor() function to 1KHz. I am trying to use the eTimer 0 based ISR to call the function at this rate.

Both the SPI interface and eTimer 0 works completely fine when run independently.

However, when I combine these two functions, the timer ISR is never entered. There seems a mismatch in the Mode or Clock configuration or in setting the interrupt priority.

It works if I comment out the below code, but then, only SPI works fine.

// INTC_0.PSR[611].R = 0x8001;    //set interrupt priority for eTimer 0

If I keep this line, neither the timer ISR nor the SPI works.

Please see the code attached.

Am I missing something here?

Thanks

Az

0 Kudos
2 Replies

461 Views
azeemsha_poyil
Contributor I

Hi

Thanks for your comments. I was doubting the project settings too. Just ported the code to an existing timer project, which solved this issue. I am not sure what exactly fixed this.

0 Kudos

462 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi  Az,

the piece of code you provided looks normal, so hard to suggest. It is needed to debug full project to find the issue.

Are you able to upload the project so we can debug it on the EVB?

BR, Petr

0 Kudos