DIYstompboxes.com

DIY Stompboxes => Building your own stompbox => Topic started by: swinginguitar on June 06, 2011, 05:50:49 PM

Title: TAPLFO2 Transistor
Post by: swinginguitar on June 06, 2011, 05:50:49 PM
In the suggested schematic for tap tremolo from Electric Druid, there is a 2n3904 between the LFO output and the LED/Vactrol.

Why?

(http://www.electricdruid.net/images/lfo/TapTremolo.gif)
Title: Re: TAPLFO2 Transistor
Post by: .Mike on June 06, 2011, 05:57:47 PM
That schematic is an evolution of work I did with the VCLFO. I was working on mashing up the VCLFO and the Tremulus Lune.

I didn't know how much current would be needed for the vactrol and the indicator led combined. The PIC is limited to 20mA output.

That transistor is a result of a discussion I had with an EE friend of mine. I didn't want to run the risk of blowing the PICs, so my friend drew up a simple better-safe-than-sorry current buffer for the LEDs in order to protect the PIC in the event the LEDs pulled more than 20mA of current.

:)

Mike
Title: Re: TAPLFO2 Transistor
Post by: boogietone on June 06, 2011, 06:05:01 PM
The transistor is needed to provide the current necessary to power the LEDs. They (LEDs) typically need on the order of 10-20mA to light up. The PIC provides a control signal that follows the waveform, tempo, depth, etc. out of pin 5 that the transistor uses to drive the LEDs and thus the actual signal processing. Think of the transistor as a buffer for the control signal.
Title: Re: TAPLFO2 Transistor
Post by: swinginguitar on June 07, 2011, 09:27:09 AM
Got it!

I've got  pretty good grasp on the code for that LFO, with the exception of the waveform generator/PWM piece. Is there a resource out there for a good explanation of phase accumulators, sine lookup tables, etc in this context?

I'm new to ASM so I think it would  be helpful if I could find an implementation in C/C++ to look at.

EDIT: add to that the frequency lookup -> how are those values calculated?
Title: Re: TAPLFO2 Transistor
Post by: Hides-His-Eyes on June 07, 2011, 10:28:28 AM
I find it totally unreadable in ASM too. I can't find anybody using lookup tables in C; I think you'd have to construct an array in C and then rely on your compiler to make a lookup table for you. Risky.

PWM is totally compiler dependent when working in C; some compilers have predefined variables for it and others expect you to just set the registers like you would in ASM.