How can I configure FTM_PWM_Config block?

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I configure FTM_PWM_Config block?

Jump to solution
338 Views
Contributor III

Hello,

I have a problem with FTM_PWM_Config block in simulink. When I try to add FTM_PWM_Config block from library to my simulink model, program is freezing and in Matlab Command Window thousand of this message type; Failure in mbd_s32k_isr_priority_cbk: Index exceeds the number of array elements (0). I waited about 8-10 minutes and block has added to my model but this time I can not change source clock or output pin configurations of block. How can I fix this problems?FTM_PWM_block_fail.PNGOutputSignalFail.PNGSourceClockFail.PNG

1 Solution
110 Views
NXP Employee
NXP Employee

Hello utkuckmgl@gmail.com,

Try to first add the main configuration block into your model, then put any other blocks. It should have shown a message warning you for this instead of the rest of the errors you get - I will investigate and fix it for the next release.

Thank you for reporting this.

pastedImage_2.png

Kind regards,

Razvan.

View solution in original post

8 Replies
110 Views
NXP Employee
NXP Employee

Hello utkuckmgl@gmail.com‌,

constantinrazvan.chivu is right.

I also think that before starting developing your model from scratch, you should have a look at one of our examples delivered with the toolbox. Based on your screenshot, the ftm_complementary_pwm_s32k14x.mdl is the closest to your scenario.

Try running up this and see if you have any errors.

pastedImage_1.png

Hope this helps,

Marius

110 Views
Contributor III

Hello mariuslucianandrei

I could run up this example and has no problem, thank you both constantinrazvan.chivu and mariuslucianandrei. But I have one more issue. I want to control LED with potentiometer. I'm using S32k148 development kit and as I read from datasheet, PTE21-22-23 are the LED pins. I modelled a design as below, I chose pot pin(PTC28) for ADC input but I can't choose LED pins for FTM_PWM_Config output pin. Dropdown items are PTB14,PTC2 and PTD0, include none of LED pins. Can you also help me for this?Ftm_Pwm_Config.PNG

0 Kudos
110 Views
NXP Employee
NXP Employee

Hello utkuckmgl@gmail.com,

You will have to connect with a wire the output of the PWM to the LED you want to control.

Kind regards,

Razvan.

0 Kudos
110 Views
Contributor III

Hello constantinrazvan.chivu‌,

I want to control directly internal LED on chip, that's why I thought that I need to configure the output of FTM_PWM_Config output to internal LED pin

0 Kudos
110 Views
NXP Employee
NXP Employee

Hello utkuckmgl@gmail.com‌,

On the S32K148 there are 8 modules of FTM and output pins differs for each instance. So, if you need to choose the PE21,PE22 and PE23, you have to change the PWM module from module 0 to module 4.

pastedImage_1.png

Now, if you enable the first two pairs, (0-1) and (2-3) You will be able to directly select the required pins.

pastedImage_2.png

Hope this helps,

Marius

110 Views
Contributor III

Hello mariuslucianandrei‌,

Thank you for this information, it's very clear, I'm appreciated.

111 Views
NXP Employee
NXP Employee

Hello utkuckmgl@gmail.com,

Try to first add the main configuration block into your model, then put any other blocks. It should have shown a message warning you for this instead of the rest of the errors you get - I will investigate and fix it for the next release.

Thank you for reporting this.

pastedImage_2.png

Kind regards,

Razvan.

View solution in original post

110 Views
Contributor III

Hello Constantin Razvan Chivu,

Yes, this works, thank you

0 Kudos