pwm with PICs
pwm with PICs
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!
- 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
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.
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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: pwm with PICs
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!!!