PIC Tone generator project 01/06/2000 Chuck Olson, WB9KZY Jackson Harbor Press http://jacksonharbor.home.att.net jacksonharbor@att.net Here is a little supplemental information on the tonef84 project. Please email with your comments, questions, suggestions to the address above. Files included in this ZIP: TONEF84.GIF Project Schematic using an R-2R DAC TONEF84A.GIF Alternate Schematic using a 6 bit binary DAC SINE9.BAS Qbasic program to generate a 256 step sine table SINE10.BAS Qbasic program to generate a 128 step sine table SINE11.BAS Qbasic program to generate a 64 step sine table CONVDDS.ASM First trial program using a conventional DDS algorithm STEPDDS.ASM Second trial program using a step DDS algorithm TONEF84.ASM Final program using step DDS and a ramp up/down of the tone TRIANG64.ASM A triangle waveform table - insert in place of the sine table SAWTOO64.ASM A sawtooth waveform table - insert in place of the sine table README.TXT This file Random thoughts: This project, like many microcontroller based projects, is a software approach to solving a problem which has already been solved in the past with hardware. In this case, there are many ways to design a code practice oscillator or sidetone generator with a 555 or a simple transistor twin-T oscillator which will sound as good or better than this project while being simpler and cheaper. No defense is made for the software approach other than it is fun and also easy to change. As is often said, when the only tool you have is a hammer, everything looks like a nail. This tone generation technique is potentially useful for many Ham radio applications. One idea I'm working on is to generate PSK31 without using a computer. Some folks will complain about a true sine wave CPO or sidetone. They'll say it's too piercing or that it's boring. I don't totally understand these complaints since a ham rig with good filtering will convert good quality CW into a sine wave - perhaps a little noise or fading should be put into the program? ;) One interesting experiment is to connect a piezo speaker to the output of the DAC - you will hear only a very low volume tone. If you connect the piezo to PIC pin 13 (the most significant bit or msb) to the DAC, the tone will be strong and raucous signature of a square wave. The piezo speakers are inherently high frequency audio devices and thus respond much better to the harmonic rich square wave than to the sine wave at the DAC output. You can also try some of the other PIC pins and see which is the loudest. I generally start the hardware of most PIC projects using a solderless breadboard. Then after the project is working I'll build a prototype on a piece of perf board or even use Manhattan style contruction. One potential problem with solderless breadboards are the stray capacitances involved - usually these aren't a problem but in this case of a PIC with an RC oscillator, they can be considerable - if you use a solderless breadboard, try removing C2, the 22 pf timing cap to see what happens. It's amazing how well the PIC works with all of the stray cap even at speeds of 10 MHz. I hope this project will be fun and interesting for all Ham PICers. Best Regards, Chuck, WB9KZY