On Sun, 9 Jun 2002, Olin Lathrop wrote: > > ----/\/\/\/\------|----- > > 3.3K | > > = .47uF > > | > > GND > > > > If I read the stuff I found on passive LPF design right, that should give > > me a 102Hz cutoff, correct? > > Yup, 102.6 Hz, +-20% for the component . Well, seems to work OK. Wow, crash course in audio LPF design. I could even do it with an op amp now (and still may). > > The PIC (I'm using a 12CE674 for development, but will switch to 12C671 > > for real) looks for a low pulse on its input, which *should* be the peak > > of the cycle of the string's fundamental frequency. We start Timer 0 > > running and wait for the next pulse, indicating the next cycle. If Timer > > 0 overflows, we increment a high-byte counter, ending up with a 16 bit > > counter for the cycle time. We accumulate 32 of these samples, then > > divide by 32 for an average (crude, yes, I know - I may work on that). > > I'm not sure I follow exactly what you are saying, but you can certainly use > timer 0 with pulse interrupts to measure the period. Using a CCP module in > capture mode will make your life a lot simpler and will improve accuracy > because you don't have to worry about being in a timer 0 overflow interrupt > when a pulse comes in. I've done a bunch of frequency/period measuring > projects, and CCP modules are real handy for that. Sorry, I did meander about the point a bit. I'm using Timer0 because I just want to use the 12C part, and it's a pretty simple task. I'm 99% sure it's all OK aside from the analog input stuff. By the way, I just tried the above circuit, fed by a 1uF cap and connected to the existing 330K/56K bias resistors. Almost there, the amplitude is a tad low but it looks a lot cleaner. The PIC did lock onto the E string a few times, and saw A and D a couple of times. At this point I'm thinking it might be a lot easier to connect to the amp output instead of the guitar input. Anyawy, looks like we're almost there. Now I just have to figure out how close to perfect pitch is close enough for a bass. Dale -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu