On 26/05/2011 13:46, V G wrote: > Hey all, after seeing this (http://das-labor.org/wiki/Stimmmopped/en), I > wanted to make my own very simple guitar tuner. > > My schematic: http://postimage.org/image/32mp0tnpg/ > > - The chip in the middle is a PIC16F886, surface mount. > - The six LEDs on the left indicate which string is selected (E, A, D, G,= B, > e). Small, surface mount, low power. > - The four LEDs on the right are used to shine light at various pulse > frequencies on the strings. High brightness, through hole. > - The push button switch selects the string. > - The toggle switch turns the power on and off. > - An ICSP header is placed somewhere on the board. > > - The circuit is intended to be powered off of a few parallel 3V coin cel= ls. > > > > 1. If the circuit is designed to run at 3V, how will programming be done = by > the PICKIT2? The PICKIT2 runs on 5V as far as I remember, but I think it > should have an option to program at 3V, but I don't remember, been a whil= e > since I used it. > > 2. The PIC16F886 datasheet says that the PIC can be run at 20MHz. Since I= 'm > tuning strings which I don't think divide nicely to those frequencies, I > want to run the PIC as fast as possible to minimize the error. Therefore, > I'm going to be using a 20MHz crystal. The datasheet schematic shows the > crystal with capacitors. What should the values of these capacitors be? > > 3. I didn't look much into it, but I use the 16F886 as a "jellybean" part= .. > It's cheap, available, small, and loads of features. I think the timers o= n > there should be adequate for the oscillation of the pins. How would you g= uys > recommend generating the right frequences for the LEDs? Timers? Interesting you should bring this up again. I just finished making a=20 little kit (16F690) which I intend to shove on our new website at some=20 point in the near future. The prototype works pretty nicely. All pretty simple really, the trickiest part was working out all the=20 tuning frequencies, choosing which temperament and stuff. I borrowed=20 quite a bit from the Stimoppped source, although I've done a few things=20 differently. I chose high brightness red LEDs (not white as the forward=20 voltage is too much for a coin cell which I decided on to power it) as=20 they work better than standard ones for this purpose. A largish=20 capacitor and small series decoupling resistor helps to lower the surges=20 on the battery. Don't worry too much about the error - I'm using an 8Mhz as running the=20 16F690 at 20MHz requires higher than 3V. The error you can achieve at=20 this clock rate is way past anything that will be audible if you do the=20 calculations - Wiki has a lot of good info on tunings - check out=20 Scientific Pitch Notation, Cent, Equal Temperament pages. Caps on the crystal should be around 10-20pF, the datasheet will have=20 recommendations. I use 15pF on an 8MHz. I generate the pulses using the 16-bit timer 1 interrupt set for 1/10=20 the note period. That way you keep the uC free to do other stuff like=20 check buttons and display notes. If you need any more help with any of it let me know. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .