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)
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
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.
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?
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.