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?
Solved! Go to Solution.
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.
Kind regards,
Razvan.
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.
Hope this helps,
Marius
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?
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.
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
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.
Now, if you enable the first two pairs, (0-1) and (2-3) You will be able to directly select the required pins.
Hope this helps,
Marius
Hello mariuslucianandrei,
Thank you for this information, it's very clear, I'm appreciated.
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.
Kind regards,
Razvan.
Hello Constantin Razvan Chivu,
Yes, this works, thank you