SWD pin 30 with PWM/IO - MKE02Z16VLC4

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

SWD pin 30 with PWM/IO - MKE02Z16VLC4

1,331 Views
_daniel_
Contributor II

Hi, greetings.

What's wrong? How to I use FTM1_CH0 as PWM output? 

(pin 30 = PTC4/RTCO/FTM1_CH0/ACMP0_IN2/SWD_CLK)

20200113_000739.png

PWM[Number, bits] > 9 x 16?

20200113_000820.png

It is an only input pin, do not possible set to output PWM. I am wrong?

Thanks.

Tonn.

4 Replies

1,214 Views
_daniel_
Contributor II

Hi, Sabina,

I'm sorry it was a misinterpretation of the datasheet made me doubt what I was doing, common when we read something technical in a language other than our daily lives. Not only, but I was also mistaken in thinking I was doing it the right way. In my case, I also did the bit mask incorrectly, now it's right, solved with these two lines:

SIM_SOPT &= ~SIM_SOPT_SWDE_MASK; //IO_map.h - clear bit SWDE now is right
SIM_SOPT &= ~SIM_SOPT_ACIC_MASK; //

20200117_003840.png

Thank you very much.
Solved.
Daniel.

0 Kudos
Reply

1,214 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Daniel,

Pin 30, is the Pin 4 of the Port C register. You have to initialize it as the alternative function 2 in order to use it as the FTM1_CH0 as you mention above. You can see this in the table 10-1 of the user manual.

pastedImage_1.png

I would recommend to download our SDK for the FRDM-KE02Z. Once downloaded you can import the SDK examples. Here you will find several that use the FTM module for the different modes it has. As you can see there is one for creating a PWM signal. You may use this as a reference.

pastedImage_3.png

Please let me know if you have further questions.

Best Regards,

Sabina

1,214 Views
_daniel_
Contributor II

Sabina, thanks for your response.

I want to use all outputs with PWM (ten). I'm using KDS IDE, processor expert for initializations.

After initialize program, guaranted disabled SWD pin functions in SIM_SOPT, bit 3. On program runing all pins responsed ok, howeder, FTM1_CH0 "thinking about life", no action.

In fact, this pin is input or output or all? Note: Capture mode, the pin = input, edge alined PWM mode = output...

Exists a equivalent schematic to specific I/O input in any tech document? I not ecountered, possibly wold understand better.

0 Kudos
Reply

1,214 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Daniel,

The FTM1 signal description are as follows:

pastedImage_1.png

This means that it is possible to use it as input or output. 

Make sure that SIM_SOPT, bit 3(SWDE) is equal to 0. Also check to see how the pin is routed as it could be PTC4 or PTH2.

pastedImage_2.png

If you still have problems. Please provide a code snippet of how you are initializing this pin.

Best Regards,

Sabina