FRDM-K64F FTM_CH5 output as PWM using KDS_3.2+KSDK_v2

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

FRDM-K64F FTM_CH5 output as PWM using KDS_3.2+KSDK_v2

779 Views
nadine
Contributor III

Hi,

I wrote a program using the FTM timer to configure a PWM clock and associate it

to a specific GPIO.

As described in the Reference Manual (section K64 Signal Multiplexing an PIn Assignments),

I used the GPIO PTA0  multipexed and set to FMT0_CH5 (ALT3).

 

The program is quite simple and linked to this message (main.c)

In the interrupt function, I made the red led blink. It looks ok, but if I plugged

an oscilloscope to the PTA0 pin, I have no signal output generated.

I probably made something wrong ...

 

Thanks for your support again

Best regards

Nadine

Original Attachment has been moved to: main.c.zip

Labels (1)
0 Kudos
2 Replies

351 Views
DavidS
NXP Employee
NXP Employee

Hi Nadine,

I branched this post since one question had been answered correctly.

Attached is your main.c updated to work with KDS_3.2 (Note I think you are using KDS3.0 so please update if you can) + KSDK_v2 for FRDM-K64F.

I have one #define to change the output from PTA0 to PTD5 so that I could debug the code.  PTA0 used for debugger interface.

#define OUTPUT_PIN 0//DES 1=PTD5 (can debug), 0=PTA0 (loose debugger interface)....read notes above main().

Please review my comments by looking for "//DES" comments.

I think the primary issue was setting duty cycle to 100.  I made following change:

ftmParam[0].dutyCyclePercent = 50U;//DES was 100U;  100% duty cycle means output will not change.

Regards,

David

351 Views
nadine
Contributor III

Hi David,

Thanks for the answer.

As you suggested, I have used another GPIO.

And, as the GPIO PTD5 is used for the SPI in my design,

I have used PTA2 (FTM0_CH7) and it works fine.

Best Regards

Nadine,

0 Kudos