pwm with PICs

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
Bonanza
Posts: 6
Joined: Mon Dec 01, 2008 2:50 pm

pwm with PICs

Post by Bonanza »

I'm having a great time with the PIC tutorial - it is very well written and easy to understand. There is one specific application that is not covered however, and it is one that I really need to understand - how to use the pwm modules on the PIC. I am going to be programming a 16F616 and use its A/D to monitor 4 temps. The pwm output will be controlling the voltage applied to reach the temps. I am actually going to be using only one output rather than four, and I will be adjusting the pwm voltage output according to the range of readings I receive through the A/Ds. My question is - how do you use the pwm feature on the PIC? Do you have any code examples of a similiar application? I am programming in assembly. Thanks for any help!

Bonanza
Posts: 6
Joined: Mon Dec 01, 2008 2:50 pm

Re: pwm with PICs

Post by Bonanza »

Can anybody help?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: pwm with PICs

Post by Benj »

Hello Bonanza

I have attached an example for the 16F616 that takes a sample from ADC channel 0 and outputs the value as a PWM mark/space value on PWM pin CCP1. Hopefully it should be just what you require.
Attachments
pwm.asm
(6.49 KiB) Downloaded 376 times

Bonanza
Posts: 6
Joined: Mon Dec 01, 2008 2:50 pm

Re: pwm with PICs

Post by Bonanza »

Yeeehawww!!!! A big thank you from Texas USA!!! I am just now seeing this and won't have time to try it until later today, but I'll let you know how it goes. Thanks again for going the extra mile!!!

Post Reply