Are there any PWM examples for the Kinetis?
I've searched all the out of the box samples and MQX examples and have not found anything.
I'm currently trying to digest the 100+ pages about the FlexTimer in the K60 reference manual.
I feel your pain. I am new to MQX, and PWM was supposed to be our hello world. I have the TWR_MCF_52259, and I received this from freescale.
As for MQX, there are no drivers included in the BSP for the PWM peripheral. That’s why you haven’t found any examples. When you run into peripherals or features of the MCU not supported by MQX drivers, then you need to write the code for that peripheral. You could write a driver yourself and include it in the BSP, but in this case for a simple timer, I would recommend that you just include the timer initialization code in an MQX task.
To make initializing peripherals easier, CW includes the tool Processor Expert (PE). This is a GUI that lets you configure the MCU and peripherals, and then it generates the code. It’s a very handy tool for these jobs where you want to quickly learn how to initialize a peripheral.
But the problem today is that MQX and PE don’t play nice with each other. You can’t use them both in the same project. So what I recommend for people who want to use both is to create a new project with PE, and get the peripheral working the way you want. Then take the generated code, copy it into an MQX task, and integrate it with your MQX app. You’ll have to clean up the register and bit names to compile because MQX and PE refer to the registers slightly differently. But that is easy enough.
BTW, we are working on integrating PE and MQX, and have done that already with Kinetis. CW v10.1 and MQX v3.7 for Kinetis allow you to create device drivers with PE in MQX. One of the main examples shown for this is the timers because, as you found, MQX lacks timer support. I know this doesn’t help you with ColdFire, but I wanted to make you aware that PE and MQX working together has started coming.
Retrieving data ...