cancel
Showing results for 
Search instead for 
Did you mean: 

V/F Converter

David Brooks
Associate II
Posted on September 08, 2016 at 22:31

Any Forum Discussions, App Notes or sample projects on using a micro to create a simple V/F converter? This isn't rocket science, but I do not want to reinvent the wheel either.

6 REPLIES 6
Rogers.Gary
Senior II
Posted on September 09, 2016 at 02:28

You might want to look at this device as a start:

http://www.digikey.ca/product-detail/en/microchip-technology/TC9400EOD/TC9400EOD-ND/6152269

from Microchip.

mark239955_stm1
Associate II
Posted on September 09, 2016 at 13:09

Use ADC samples to update a TIM configured for PWM.

As you say, not rocket science.

christoph2399
Associate II
Posted on September 09, 2016 at 13:56

what i would do configure both adc and timer in a way that the dma will transfere the adc-value directly into the timer-compare register without software interaction.

i just like to let the hardware do its job :D
mark239955_stm1
Associate II
Posted on September 10, 2016 at 01:59

Unfortunately, it's not that simple.  In order to change the frequency of a PWM signal, you need to change both the ARR and CCRx registers (or, just the PSC - but that gives poor granularity and linearity).  Some manipulation of the ADC value is probably required as well (e.g. divide-by-2 before loading into CCRx).  I can't see a way to make it a purely hardware process; CPU time is required, probably in an ADC interrupt, to process the ADC output and use the results to update multiple TIM registers.

Posted on September 10, 2016 at 22:26

For 50% duty the toggle mode can be used, with compare set very low. Then it's enough to manipulate ARR.

But I can't see why manipulating PSC would yield different resolution and ''linearity'' (except in the 32-bit timers). Period is always reciprocal to frequency.

JW

mark239955_stm1
Associate II
Posted on September 11, 2016 at 00:46

Toggle mode hadn't occurred to me, possibly because I've never had cause to use it.  That would solve one problem.

Fair point about PSC -v- ARR; they're on the same number line, which is always non-linear (y=1/x).  Some alternate approach - an NCO, perhaps - would be required for linearity.

I still can't see any way to avoid needing to process the ADC output.