Research website of Vyacheslav Gorchilin
All articles/Electronic circuits
Pulse generator on a PIC controller.
Fixed frequencies
In the second part we continue to talk about the square pulse generator on the PIC controller PIC16F684. In the circuitry of this part, a slightly different frequency-setting circuit of the DD1 controller will be used (Fig. 2): instead of an RC circuit - quartz resonators, allowing you to set the output frequency with an accuracy of 0.04%. Several of these resonators will allow you to quickly switch between the required frequencies using the SW1 switch. Otherwise, the circuit design and other settings are the same as previously.
  • 1st option for using this version of the generator. When the operating frequency of the device has already been selected by the circuit from previous part of this note. Then, instead of resistors R1-R2 (Fig. 1), we can install capacitor C3 and a quartz resonator (according to scheme 2);
  • 2nd option. When the exact operating frequency of the device is important, and it can have several discrete values.
The schematic diagram of this type of generator is shown in the following figure. Here the generator setting frequency is set discretely, changing using switch SW1:
Fig.2. Schematic diagram of a pulse generator on a DD1 microcontroller with fixed frequencies
Quartz resonators QR1-QR3 can be used at any frequency, but not more than 20 MHz. In this case, the output frequency on the CHA and CHB channels is calculated as follows: f = F/400, where F is the frequency of the quartz resonator, f is the output frequency of the generator.
Firmware file
Since the circuit that sets the frequency has changed, the firmware program will also be slightly different from previous. All other instructions and device settings remain the same.
The file for flashing the microcontroller can be downloaded from here.
Attention, paid content! To download files, you need to log in and pay for a subscription for a month or a year, and then refresh this page. If you are not registered yet, do it now!
Instructions for flashing the pic controller firmware can be found here.
Printed circuit board
Below is the PCB layout for the option with a power adapter. Please note that the DD1 controller is used here in a DIP14 package. Thus, as before, the entire circuit can be powered from a voltage source from 5 to 24 volts.
Production version: PCB (open)
The production option provides a set of documentation for manufacturing a printed circuit board in production: GERBER file for PCB, BOM file of the specification of components and a schematic diagram showing the values of the elements. All this allows you to immediately order a PCB, for example, here, and then quickly assemble it.
To download files, you need to log in and pay for a subscription for a month or a year, and then refresh this page. If you are not registered yet, do it now!
Here, switch SW1 is made in the form of jumpers JP1-JP3, which can be easily rearranged. Also, if the required operating frequency is finally selected, you can leave only one quartz resonator and one jumper.
1 2 3