How to trigger ADC using PDB and FTM?

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

How to trigger ADC using PDB and FTM?

2,055 Views
vigneshkumarp
Contributor III

Hi, I'm using my own board of MKV10Z32VLC7 for motor control applications. I'm using center aligned PWM generated from FTM0.  And I just want to measure the current at the center of PWM and referred some application notes(AN4410, AN5142) and processed as such but the trigger is not happens correctly.

For example, I need to generate a PWM of 10KHz, I used the following configurations in FTM(FTM0 is used) and PDB.

Capture.JPGCapture1.JPGCapture2.JPGCapture3.JPGCapture4.JPGCapture5.JPGCapture6.JPG

Configurations for PDB as follows:

Capture.JPGCapture1.JPGCapture2.JPG

The output waveform for the above configurations as below:

Channel 1(yellow) is FTM0_CH0 output and channel 2(green) is for LED toggle(450KHz as measured); the code shown below.

void PDB_ISR(void)
{
 DB_LED_NegVal();    
}

scope_0.png

I need to trigger at the center of PWM, so for that what should be the configurations. Due to this PDB_ISR the other interrupts(such as periodic interrupts) are disabled. MarMi pavelrechkubanbkubanbvicentegomezkhumphriMandardhaval

Thank you in advance .....

0 Kudos
4 Replies

1,119 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Vigne,

Do you want to control a PMSM with FOC? In the case, you need to sample two ADC channels simultaneouly at the center of bottom PWM High signal, the two ADC channels are from ADC0 and ADC1 module.

Do you control a BLDC? you just connect a shunt resistor in the poewer bus, it is okay.

BR

XiangJun Rong

0 Kudos

1,119 Views
vigneshkumarp
Contributor III

Hi XiangJun Rong,

Thanks for your response. Yes I'm using PMSM(BLDC) with FOC. I just triggered the PWM at the centre.

0 Kudos

1,119 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,Vigne

I attach an4410.pdf, which focuses on the ADC triggering.

I think it is helpful.

For PMSM FOC control, you have to sample two current ADC channels at the center of bottom PWM signal in center-alignment mode of PWM, in other words, the expected sampling instant is the center of bottom PWM high logic which means that that the bottom MOSFET is on. But PWM waveform is related to the FTM mode, some waveform is High-Low-High in "High true pulse" mode, in the case, you can see the Figure 3. Timing for one ADC instance in an4410.

some waveform is low-high-low in "Low true pulse" mode, the center of bottom PWM high logic is not at the start of PWM signal, you have to use PDB or unused FTM channel to set the sampling instant.

Hope it can help you.

BR

Xiangjun Rong

1,119 Views
vigneshkumarp
Contributor III

Hi XiangJun Rong,

Thanks for the document. I will look into that.

0 Kudos