KE04 FTM OUTPUT COMPARE MODE

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

KE04 FTM OUTPUT COMPARE MODE

Jump to solution
1,620 Views
jun1
Contributor V

HI.

Thank you for your kindness.

I ask a question about the title. A sample source and Waveform screenshot attached.
(This is a modified version of SDK_2.6.0_MKE04Z128xxx4 \ boards \ frdmke06z \ driver_examples \ ftm \ output_compare)

・ Question
Modified to not output from the port. I set the FTM output port (PTC0 in this example) to GPIO output and toggle it with an FTM interrupt, but I can't. The neighboring PTC1 toggles, so I think the GPIO settings are correct.
What is missing?
According to the manual, if ELSnB: ELSnA = 00, the pin-channel pins not used for FTM are returned to general-purpose I / O or other peripheral device control.

Thank you.

jun.

Labels (1)
0 Kudos
Reply
1 Solution
1,445 Views
jun1
Contributor V

Hi.

Thank you for pointing out the mistake.
it is complete.

best regard.

jun.

View solution in original post

0 Kudos
Reply
7 Replies
1,445 Views
nxf56274
NXP Employee
NXP Employee

Hi,

d.PNG

The second parameter is the pin number. PTC0 should set 0 , not 1u<<1. "1<<1" is PTC2 

0 Kudos
Reply
1,446 Views
jun1
Contributor V

Hi.

Thank you for pointing out the mistake.
it is complete.

best regard.

jun.

0 Kudos
Reply
1,445 Views
nxf56274
NXP Employee
NXP Employee

Hi,

ss.PNG

Maybe the parameter is "kFTM_ToggleOnMatch"

0 Kudos
Reply
1,445 Views
jun1
Contributor V

Hi.

Thank you for your answer.

There was not enough explanation. I don't need output port access and just want to use FTM as a timer interrupt. I want to use FTM1 channels 0 and 1 for MODBUS T1.5 and T3.5 timers. Can the output compare mode be used for these two timers?

Jun

**********************************************

(株)中央製作所

http://www.cew.co.jp

技術部 開発設計課 山田 淳

E-Mail jun@cew.co.jp

TEL 022-382-8123

FAX 022-382-8136

〒981-1251

宮城県名取市愛島台7丁目101番地51

0 Kudos
Reply
1,445 Views
nxf56274
NXP Employee
NXP Employee

Hi,

In function "BOARD_InitPins"  , did you set the PTC0 as a FTM channel? If so, please comment it.

0 Kudos
Reply
1,445 Views
jun1
Contributor V

Hi.

Commented out but the same. Can't toggle. Attach the source.
Can I update GPIO with software even in FTM output compare mode?

jun.

0 Kudos
Reply
1,445 Views
jun1
Contributor V

Hi.

Sorry for lack of explanation. If it is that parameter, it will toggle output, but all I want is timer interrupt and I don't want FTM port output. I want to do port output at another timing in another task. What should I do in this case? Is it possible to access GPIO corresponding to FTM with software?

jun

0 Kudos
Reply