Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Understanding the PWM module of a microcontroller?

Status
Not open for further replies.
T

treez

Guest
Newbie level 1
Can the “Programmable switch mode controller” in the PIC16F1789 microcontroller provide a PWM output which is anything up to 25KHz, and with a duty cycle between 10% and 95%? (to control a 48V fan with)

PIC16F1789 microcontroller datasheet:
**broken link removed**

Can I also have (simultaneously , on a different pin), a 200KHz , 50% duty cycle square wave output from the PWM module? (aswell as the above 25KHz PWM output.)

Also what is the difference between a “PWM channel” and a “PWM output”? –And surely, if a microcontroller has a PWM output capability, then it must have a “PWM timebase”. –On the microchip microcontroller selector tool, it says I can’t have a “PWM timebase”, but I can have a “PWM output”…does that make any sense?

Microchip microcontroller selector tool:
https://www.microchip.com/maps/microcontroller.aspx
 

Hi,

Regarding basic pwm you might find this tutorial of use
https://ww1.microchip.com/downloads/en/DeviceDoc/ccpwm.pdf

As for the PSMC have not used that module or seen any easy code examples of how to use it, though there is lots of info in Microchips site like this page and video
**broken link removed**

However do wonder if Flowcode or the version you have is up to date enough to be able to handle PSMC ?

Long time since I tried flowcode for a few minutes, but think you have a chip selector option, does the 1789 show on that ? same point for some of the other chips you are looking at ..?


Edit - might have missed it, but cannot see the 16F1789 on the "PIC" list of chips for the latest Flowcode 6; seems you also need a separate add on pack for DS chips, do you have it ?
**broken link removed**
 

Attachments

  • 000082.jpg
    000082.jpg
    132.6 KB · Views: 123
Last edited:

thanks, but we do not wish to do pwm via the capture compare module....we wish for a "pwm module", where you simply load the duty cycle and frequency registers and job done.
 

thanks, but we do not wish to do pwm via the capture compare module....we wish for a "pwm module", where you simply load the duty cycle and frequency registers and job done.


Hi,

Not aware you can do a PWM on its own as its part of the whole CCP module.
Did you look down towards the last pages of that CCP tutorial which shows the PWM section ?

If you were using Assembler then you could probably write your own software PWM but expect Flowcode would only allow you to do PWM via the standard microchip CCP module ... ?
 

PWM is so trivial with analog threshold and triangle wave ( LPF after Pulse ) into a comparator or gate, why in software? unless going for <5% extreme ends of range or wishing to use programmable current levels.
 

Can the “Programmable switch mode controller” in the PIC16F1789 microcontroller provide a PWM output which is anything up to 25KHz, and with a duty cycle between 10% and 95%? (to control a 48V fan with)
Yes, surely.

I believe that the PSMC datasheet chapter is quite descriptive.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top