This project is based on the Function Generator described on Mondo Technology web site. I just did very slight changes and fixed some obvious typos in schematic. The code is rewritten for the Microchip MPLAB IDE syntax.
|
|
The device is powered from 12VAC which provides a sufficiently high (over 18V) DC voltage needed for a normal operation of 78L15 and 79L15. The 12V power supplies are replaced with 15V ones. This is done in order to LF353 Op-amp could output the full range of signals to a 1K load. By using a ±12V supply this resistor must be at least 3K.
Schematic | DAC network | PCBs layout | ||
The rotary encoder I used is ALPS SRBM1L0800 and it is shown in a circle on the schematics. The designer probably used another one, so some changes in the code were necessary. My encoder has two groups of contacts which are normally OFF and one of them becomes ON when the rotor is moved in the corresponding direction. Therefore, PORTB change interrupt should be generated if either pair of contacts becomes ON. This is achieved by putting both groups of contacts on PIC's pins RB4 - RB7 which are monitored for the state change. Fortunately, RB4 was not used in the original design, so I just redirected RB3 to RB4. Another modification caused by the encoder is a different timing for its bouncing routine. I request the encoder to have the same state for 100 consecutive measurements instead of 10 in the original design. Note that some PIC pins are used for redirecting +5V to simplify PCB the layout, so they are configured as input ones.
The PCBs assume mounting of 3 resistor networks. The R/2R one for the DAC is from Bourns 4310R series. The DAC resistor network can be built on discrete resistors according to the schematic above. One should use resistors with ±1% tolerance or better. The LED current limiting resistors are from Bourns 4306R series. The LED brightness can be increased depending on one's preference by lowing their resistance down to 220 - 330Ohm. The generator is assembled in Hammond 1598BBSGY 7.05x6.06x1.42" (179x154x36mm) plastic enclosure with aluminum front and back panels. The output level regulating resistor is from Taiwan Alpha 1902F series. All the other components mounted on the front and back panels (buttons, knobs, RCA jacks, LED assembly, power connector) are from RadioShack. The PCBs are mounted to the enclosure with #4-40 bolts and 6mm plastic spacers. The nuts are glued to the bottom of the enclosure with a hot glue gun, see the left picture below. The smaller PCB carries just power supply parts, all the other ones are mounted on a larger PCB. The left button on the middle image below is for changing the mode, the right one is for selecting the speed rate.
Nuts mounting | Front panel | Back view | ||
The generator produces 9 various waveforms and works in three modes, which are selected by the "Select" button and indicated by the three upper (on schematic) LEDs. The rotary encoder adjusts the waveform parameters according to the following table:
Mode\Waveform | Sine | Triangle | Square | Saw | H-pulse | L-pulse | Burst | Sweep | Noise |
---|---|---|---|---|---|---|---|---|---|
Mode 1 | freq | freq | freq | freq | freq | freq | freq | freq | - |
Mode 2 | - | - | - | - | width | width | cycles | cycles | - |
Mode 3 | - | - | - | - | - | - | rate | delta | rate |
Right after tuning on, it is in Mode 1 generating sine. However, the initial frequency is pretty low and at least one click of the rotary encoder is needed to increase it. The PCB has a 5-pic header for connecting the device to a programmer, which allows to operatively modify its functionality, if needed.
Last modified:Mon, Jan 23, 2023.