Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How do I determine how fast my PIC18F can update (refresh) the PWM duty?

Status
Not open for further replies.

liche

New Member
I'm planning on using a PIC18F uProc for use as a power supply controller where I control the switch FET directly from the PWM of the PIC. There are some functions which require open loop control in which the PWM is required to provide custom duty ramps for various conditions.

My question is that I've been trying to search how quickly the PIC can change duty cycle given a user input but have not been successful in finding anything.

Anyone know what the easiest way to do this?

The time would be from the time I wrote a new duty cycle (to register) and the time the PIC implemented it.

Thanks
-Liche
 
It's all in the PDF of your PIC.
 
It's all in the PDF of your PIC.

Well, yeah. Could you be a little more specific though? I've already spent a lot of time looking through the nearly 300 pages PDF of the PIC datasheet and haven't found anything that popped out at me.
Plus, i don't think its something that defined specifically. I think its something that has to be derived, and thats where i'm asking for the help as my experience with uProc is very limited being a analog / high voltage engineer.

Thanks
 
It will load the new duty cycle whenever timer2 rolls over. So, whatever you have PR2 (and the prescaler) set to is the longest time between updates. As we know, PR2 sets the frequency and so it will change every cycle.

Edit, to be more specific, looking at the 18F2520 data sheet, see table 16-2. The fastest you can update it is the PWM frequency.

Mike.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top