trigger ADC by FTM through PDB, used in motor control

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

trigger ADC by FTM through PDB, used in motor control

1,235 Views
Lilac
Contributor I

Hi,
I'm trying to use S32K144 EVB and a drive board to control PMSM, then I need to sample phase currents and phase voltage.
I used FTM0 channel 0-5 to generate 6-channel complementary PWM, and the AD interrupt should be triggered in the middle of the low PWM. I need to trigger AD in the middle of the rising edge of FTM0 channel 1 and channel 3, respectively, to obtain the current passing through the resistors of the two sampling points.
I referred to the doc: AN5303, and found the way to configurate ADC triggered by FTM through PDB, and i can read ADC0->R[0] to get the Ia result. But I don't know how to configurate to get Ib and phase voltage.

0 Kudos
Reply
3 Replies

1,227 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Lilac,

Would you please refer to AN12235: 3-Phase Sensorless PMSM Motor Control Kit with S32K144 Application Note

It will show you how to sample DC bus voltage and Phase B stator current.

AN12235 ADC1 sample DCbus IPHB.png

Please download MCSPTE1AK144 Development Kit Application Software

Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,218 Views
Lilac
Contributor I

Thanks for your reply. This helps a lot.

But I'm not used to use components, I want to modify the method of writing registers directly which is mentioned in AN5303.

Below are screenshots of my setup process, in the ADC0_IRQHandler, I can get the result of ADC0->R[0], but in ADC1_IRQHandler, I can't get any results from ADC1.

Thank you!

0 Kudos
Reply

1,176 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Sorry for the late reply.
I didn't find a bare metal example, but you can debug the (MCSPTE1AK144 Development Kit Application Software)project , and then write your bare metal code according to its configuration process.

0 Kudos
Reply