The making of a classic - this blog follows my progress as I construct and build a TR-909 drum machine clone from scratch.
Sunday, 27 February 2011
Automatic tuning - initial trials
The last few days I've tried to come up with a way to measure a frequency using a microcontroller. One of the challenges has been to convert the +/-15v audio signal into a 5v/TTL-compatible one. I have tried several ideas, but after a bit of research, and a little breadboarding, I have a solution that works. Basically, I'm using an LM311 comparator, connecting the negative input (Vref) to ground. This means that every time the input signal on the positive input terminal goes above 0V, the output transistor switches off. Then, by adding a pull-up resistor to the transistor's collector, and connecting it to 5v, the output will go "high" everytime the input voltage is positive, thus converting an arbitrary input signal into a square wave pulse train, ready for the microcontroller's capture module.