News:

SMF for DIYStompboxes.com!

Main Menu

Pics'n Lfo's

Started by Danich_ivanov, June 27, 2018, 11:19:06 AM

Previous topic - Next topic

Danich_ivanov

Going right into it: I want to make an lfo using pic, which has dual outputs, with one of this configurations:
1. One of the outputs having adjustable phase 0° - 180°, and the other one being fixed.
Or preferably, just to keep things consistent, and perhaps more interesting:
2. Both outputs having adjustable phase, which changes simultaneously with the range of 0° - +90° for one output, and 0° - -90° for the other one. To elaborate, for example when one output is at +45°, the other one is at -45°, or when one is at +60°, the other one is at -60°, and so on, all using a single potentiometer.

Question is: what pics should i look for to accomplish this, and is it possible using a single pic?

Thanks!

Edit: Forgot to mention that lfo will also have tap tempo.

ElectricDruid

Yes, it's definitely possible on a single chip. "How small/cheap a chip?" is the real question.

There's a 16F1778 that I've been using a lot recently because it has three 10-bit DACs on it - ideal for multi-output LFOs. In fact, I also did a drum machine voice experiment with it (on my website).

There are some other chips that have two DACs, including a very-promising-looking 16F1765, but unfortunately they utterly crippled that chip for our purposes by not allowing you to get at both DAC outputs at the same time - at least, I couldn't find a way.

DACs aren't the only possibility for the output either. You can do a PWM output using the PWM/CCP/ECCP modules on many chips, but it needs decent filtering. Or you can do a pulse-density-modulated output using the NCO module on some chips (like my StompLFO). But I don't know of any chip that has two NCOs. I'd love a nice 8-pin chip with two NCOs, or two of the 10-bit DACs. That'd be so useful.

In terms of the code, you'd set up single phase counter for the LFO - perhaps 24-bit. The frequency is set by the "frequency increment" that you add to this counter every sample. Then you use the top X-bits of the counter as a look-up into a waveform table. If you want two outputs with different phases, then you'd do two lookups, each with a different phase offset added to the top of your counter.

Sorry to go on so long. LFOs on a PIC has become a bit of a specialist area with me! ;)

HTH,
Tom

Danich_ivanov

Thanks druid! I was hoping to see you'r take on this, and you can go as long as you like. Now it's time to do some shopping!