how to setup ADC temperature measurement_MPC5744P FOC motor control

cancel
Showing results for 
Search instead for 
Did you mean: 

how to setup ADC temperature measurement_MPC5744P FOC motor control

296 Views
liwuquan
Contributor III

NXP expert,

I am working on PMSM motor control application using MPC5744P. motor three phase current and dc bus voltage ADC measurement for FOC is done under CTU control mode every 100us(PWM Mater reload trigger CTU, CTU delayT0 trigger ADC to do the dual mode measurement). I have many temperatures need to be measured every 100ms, would you please suggest what is the best way to implement CTU and ADC for the temperature measurement?( according to MPC5744P RM, once in CTU mode the ADC normal mode request will be discarded.)

Thank you very much.

Susan Li

6 Replies

114 Views
petervlna
NXP Employee
NXP Employee

Hi,

The FIFO FULL is cleared by emptying the corresponding FIFO.

There is no possibility to clear it by SW.

Do you have your FIFO empty and you see your overflow flag set?

Do your conversion triggering give enough time for your FIFO read routing before it starts filling FIFO again?

Peter

114 Views
liwuquan
Contributor III

And how the FIFO can be cleared from inside ISR? Or before leaving the ISR, how to reset FIFO1 flags_OR1, OF1, EMP1, FULL1?

Thank you.

Susan Li

0 Kudos

114 Views
liwuquan
Contributor III

Peter,

I am trying to use MPC5744P CTU-mode to read ADC, the CTU triggered by FlexPWM0_Master Reload Signal. 

To know the conversion is finished, I want to use FIFO1 overflow flag to generate an ISR to read ADC result( FIFO Control register: OF_EN1 set to 1, using FIFO1, FIFO1 overflow threshold set to 3, I made the interrupt working, but the interrupt flag OF1 in FIFO Status Register is not able to be cleared, the interrupt happens all the times.

NXP has posted a similar example: Example-MPC5744P-FlexPWM-CTU-ADC-synchronization-v1_0   

0 Kudos

114 Views
petervlna
NXP Employee
NXP Employee

Hi,

First of all, could you be more specific.

How many signals you have to measure and how many of them are synchronous / asynchronous?

You have 4 ADCs and 2 CTU on MPC5744P, you also can implement DMA for measurement start.

But first you have to clearly state your requirements.

Peter

0 Kudos

114 Views
liwuquan
Contributor III

Peter, 

Would please let me know if I am using interrupt:

(uint32_t) &CTU_ADC_I_ISR, /* Vector # 713 ADC_I CTU_0 */

How many way I can clear the interrupt flag OF1 of CTU_0 register FST(MPC5744P 144-pin package)? I do not know how to clear it just before leaving the ISR.

Thank you.

Susan Li

0 Kudos

114 Views
petervlna
NXP Employee
NXP Employee

Hi,

I do not understand what you are trying to say. Could you rephrase it?

Peter

0 Kudos