Flex Timer use with Comparators

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

Flex Timer use with Comparators

Jump to solution
935 Views
ivekengineer
Contributor III

I want to implement a current controlled chopper using the internal comparator and FlexTimer module for stepper motor control.

I'll explain a simplified version of what I need in order to keep the response focused.


I need two independent PWM channels operating 99% duty cycle.  When an internal comparator output goes active, I need the PWM channel to go to the inactive state for the remainder of the present period, returning to the active state at the zero point.  I initially thought I could do this by using the Fault signals - however, upon closer inspection it appears that any enabled fault condition will affect both channels. Do I understand this correctly?  Is there a way for each channel to be affected by a specific fault signal independently?

If I can't use fault signals, is there some sort of synchronization method I can use?  Perhaps using the comparator outputs as hardware triggers to affect a change of the output mask, and then calling an ISR before the zero point in order to restore the output mask synchronously at the zero point?  However, I would prefer a hardware solution to this instead of using ISRs.


Labels (1)
0 Kudos
1 Solution
398 Views
adriansc
Contributor IV

Hi,

If you are using the same FTMx for two or more channels you will find that these channels have the same frequency (MOD field register) but you can change duty cycle.

Maybe you can check others Application Notes or RM:

http://cache.freescale.com/files/microcontrollers/doc/ref_manual/DRM128.pdf?fsrch=1&sr=1

http://cache.freescale.com/files/32bit/doc/app_note/AN4381.pdf

Hope this helps.

View solution in original post

0 Kudos
2 Replies
398 Views
ivekengineer
Contributor III

Let me see if I can ask this in a different way.

I want to implement Current-Limit PWM per 3.1.7 in App Note AN4485 - which is "Using eFlexPWM with MC56F82xx DSC".  It appears to me that the PWM module of the Kinetis does not have all the features of the eFlexPWM?  Specifically, it seems to be lacking independant fault control of individual PWM channels.  For example, I want the FAULT0 signal to disable PWM channels 0 & 1, FAULT1 signal to disable PWM channels 2 & 3, etc., but I don't see how to configure the FlexTimer to do that.

Can anyone help me?


0 Kudos
399 Views
adriansc
Contributor IV

Hi,

If you are using the same FTMx for two or more channels you will find that these channels have the same frequency (MOD field register) but you can change duty cycle.

Maybe you can check others Application Notes or RM:

http://cache.freescale.com/files/microcontrollers/doc/ref_manual/DRM128.pdf?fsrch=1&sr=1

http://cache.freescale.com/files/32bit/doc/app_note/AN4381.pdf

Hope this helps.

0 Kudos