Wednesday, May 02, 2007

Squares, saws and sines

I have had a headache today. To distract myself, I sorted through some stuff and found a bunch of 100 Ω, .25W, 5% resistors. So i decided to see if an R2R network would work using resistors of such poor quality (I have read somewhere that an accuracy of at least 1% at least is needed).

Hooray! It works... sort of at least. Made a sawtooth, triangle at 5 bits and a sine at 4 bits. Actually, the sinewave lookup table (hey, then this is waveform synthesis, eh!) that i used is based upon the waveform on the little sound dj homepage... scroll down on the page... ;-)

I just took some paracetamol. Should be feeling better soon, hopefully.

In the pictures below you can really see the individual voltage values as they refer to the bit depth, especially in the sinewave one. The low bit depths are really a matter of effort... i (think i) have enough resistors to use all eight outputs on the picaxe, but i just wanted see if the whole thing would work.


Roger Williams said...

Hey Sebastian,

Awesome work with the Picaxe! I am really impressed.
I don't suppose you could post your code for this somewhere?

I don't understand how you mapped a byte value to a pin as a bit, and then clocking it all.