PICsynth Technical Information - 19 Oct 2008. The PICsynth chip is programmed in assembler. It needs to be connected to a 20 Mhz ceramic resonator or crystal. It produces notes in range C6 (1046 Hz) - B6 (1975 Hz) by default. The actual chip supplied will be pic16f628a or pic16f627a but may vary. The chip is supplied with code protect on. PIN 1 is oscillator 2 output PIN 2-3 select tuning options. By default these should be pulled high for oscillator 1 at perfect pitch. Oscillator 2 pitch is fixed. PIN 4 is PIC reset and should be made high. PIN 5 is ground. PIN 6-9 are "octave sense" lines. Pin 6 is referred to as octave 1. Pin 9 is referred to as octave 4. PIN 10-13 is the "note" bus. Pin 10 is least significant bit. PIN 14 should be connected to regulated +5v PIN 15 and PIN 16 should be connected to the outer pins of a ceramic oscillator. The center pin of the ceramic oscillator is grounded. PIN 17 is oscillator 1 output. PIN 18 is trigger output. The PIC outputs continuous sqaure waves on both oscillator PINs. The PIC chip note bus cycles from 11 to 0 using postive logic. This corresponds to notes B through C. In my circuit this note bus is decoded by 74HC154 decoder to 1 of 16 lines (74HC154 has negative logic output ie lines go low). The PIC chip checks for Octave sense lines 1 thru 4 going low. The octave lines should be tied to +5V via a resistor by default. When a key is pressed and PIC is outputting that note on note bus the octave line that the key is connected to will go low. The PIC checks for a low on octave sense line after every change of note on note bus. When a low octave line is found the pitch will change to the correct note in the correct octave. The PIC chip then makes trigger line high for 12 ms. This trigger pulse normally triggers an envelope generator. The PIC chip then cycles back to the start and rescans from highest note again. Some things to note : If the key is held down then the PIC will continue to issue trigger pulses. If two keys are held down then the top key will be the note output. If you hold down a low key to make a low note then press a high key the higher key will take over - the pitch changes. If you hold down a high key and press a lower key then nothing will change ie the lower key wont be scanned until you release the higher key. In my circuit each oscillator output is connected to a 4520 divider and range is selected via a H/M/L switch. So If a key is pressed in octave 4... The divide by 2 output produces C5 (523 Hz) to B5 (987 Hz) - H position. The divide by 4 output produces C4 (261 Hz) to B4 (493 Hz) - M position. The divide by 8 output produces C3 (130 Hz) to B3 (246 Hz) - L position. If the key is pressed in octave 3 everything gets divided by 2 etc So with a 4 octave keyboard I get H = C2,C3,C4,C5 M = C1,C2,C3,C4 L = sub octave, C1,C2,C3 The reason PIC only produces C6-B6 in highest range is to do with speed of PIC chip. Higher notes are more difficult to at right pitch on PIC16F628A chips. Above discussion relates to perfect pitch ie PIN2,3 both high. When PIN2 is low this is detune 1 position. When PIN 3 is low this is detune 2 position. Detune 1 lowers the pitch of oscillator 1 a little. Detune 2 lowers the pitch of oscillator 1 a little more. When combined with fixed pitch oscillator 2 you get rich beating interactions.