Hi. I want to design a circuitry that produces two types of PWM outputs using any 8 bit PIC microcontroller i.e. one PWM will be of fixed frequency type which is very easy to implement. The 2nd PWM is of variable frequency type whose frequency will be reduced linearly at our will for some fixed range of frequencies. Any idea how to implement this 2nd type? I don't need detailed coding just verbal understanding.
Maybe as "fixed ON time, flexible OFF time". Resulting in a PWM period time of "t_on + t_off".
Basically this is a counter with variable TOP value and fixed COMPARE value.
Usually the microcontroller datasheets explain how to setup the PWM periferal for:
* a dedicated PWM period time and
* a dedicated ON time.
The pic approach very doable, depending on overall requirements and other project needs.
One approach using a single chip would be -
This has advantage of onchip DDS derived clock, eg. linearity. Also if you needed a PWM > 16 bits,
say 24 or 32, thats relatively easy to do creating onchip a custom component, either with
Verilog or schematic capture of a logic design from its general purpose logic fabric. Or more
channels.....Right hand window shows resources used/left in chip for other tasks.