The PIC16F876 Microcontroller has two precision PWM, Capture and Compare Module in it. The maximum frequency of the PWM signal is 32,768 Hz, but is easily changed from the minimum frequency (dependent on clock speed) up to 32 KHz. The Capture and Compare module is based on one of the Timers in the PIC, which drives a 10 bit accumulator in the Capture Module. Then the Compare Module will drive an output pin high or low depending on the duty cycle register. The resolution of the PWM is based on the size of the accumulators, and this PIC has 10 bit accumulators, or 1024 bits, so our duty cycle resolution is around 0.1 percent. Here is a pretty picture...
The first build is on a protoboard, so I can work out a logical parts placement, and make sure the circuit functions before I make printed boards. I have already built a few of these, and they are in service. This copy is going to be my reference design, and I'll be making printed boards after this point. This means I'll be able to take you through the layout process next. There is an extra part on the board which is a RS232 Communications Converter. This is to provide communications to the PC for debug, and adjustments. There is a tentative plan to make this a Dynamic PWM generator which can be adjusted by a computer interface, or the analog speed control knob. Probably for the printed design I will switch over to a USB interface to connect to computers that are more modern than my development machine.
No comments:
Post a Comment