Tuesday, December 27, 2022

2023 Goals...

Reaching the end of the year quickly. My psychiatrist girlfriend and I are going on a much needed vacation. We will sit in the sun and ponder life's true meaning of course, but I  will be thinking about what she calls "my geeking". 

That's what I cover in this blog--my trail of breadcrumbs, as I try to teach myself CS and EE. 

Let's get a head start, what next for 2023?

DSP

....Yes it could happen. A friend from my synth audio group is a DSP professional and has offered to walk me through the basics. He already loaned me "A Digital Signal Processing Primer" by Ken Steiglitz but the math was way above my head--like trying to sight read a Chopin Etude. The sad thing: I was really good at math when I was about 20. Can you (re-) teach an old dog etc.?  




RP2040 Mach II

The RP2040/Pico dev board is a $4USD gift that keeps giving. There are aspects of this useful, fun, and superbly documented MCU/dev board that I haven't touched yet--DMA , its PIO feature set, and the 2040's timers.  I have ideas for projects that will use these components, looking forward to working more with this MCU.


FPGA

There's great FPGA technology coming out of the non-DiWHY (se habla "commercial") sector--UDO Super6 VCO's for instance. The FPGA train is leaving, I want to hop on. 

There are open source tool chains for some FPGAs (APIO)--installing a new tool chain is always fun.

Shawn Hymel, who along with Ben Eater has become a bit of a DIwhy hero to me, has an FPGA video tutorial (here). I will probably start there.




Stomp boxes?

I used to build them but they were never realiable enough to use at a gig. So I gave up on 'em. But they are fun....but I don't gig a lot any longer....but you can put dumb stickers on them. Whatever. Maybe now that I have gotten better at single board fab (skiff type designs in synthesizer modules--apply it to a stomp box--why not?

C to C++

For embedded systems I code almost exclusively in C. C gets the job done, but I find a lot of code online I want to use that's written in C++.  And I have learned from trial and error: if you can't read and understand code you are going to depend on, don't use it. I have dabbled with C++ and don't like it; its poor readability (to me anyway) drives me nuts. But in 2023 I figure it's time to hold my nose and get on with it.

RISC-V

I started learning RISC-V assembly language during Covid-19 house arrest. Really fun (the code, not the disease)--I only got as far as using a simulator. To motorize this pursuit, I picked up a few "Mango MQ-R" dev boards from AliExpress.  Maybe I can do a simple assembly language project with one of them.

Not this one! Just noticed when writing this post, I thought I bought the F113 version (RISC-V) but AliExpress sent me T113 (Arm A7).  Or maybe MangoPi soldered on the wrong processor? We'll know when we smoke the damn thing. Never again right? I always say that, then I buy more unreturnable crap.



???

So much more of course--I want to Euro-rack some of my previous Frac builds (it's time) but that's mostly manual labor.  There are a few projects I started in '21 or '22 that I put aside, I should get back into them.  

Also, I've had ideas for some analog projects, building a string machine, seeing if I can come up with a high fidelity preamp, who knows what else.
 

(??) 



The main thing, I think, is I want to leave myself open to finding rabbit holes and jumping in them. That is what makes this whole thing engaging. 

Happy New Year, fumers!


Saturday, December 17, 2022

RP2040-AD9833 VCO--Triangle to Ramp Waveform Conversion

Hello again! This time I continue design and fabrication of a Eurorack audio VCO based on an RP2040 dev board and AD9833 function generator

the bench battle begins.....

I discussed the volt per octave ADC and MCU in the previous post here.  The V/octave PCB worked on the bench, but the AD9833's output leaves a bit to be desired for DIYaudio:

  • Its output is 0V to 600mV--we need more bipolar beef!
  • It can output triangle, sine, and square, but only one waveform at a time.

How can we turn this puny triangle signal into the bipolar 10V peak to peak triangle/ramp/pulse found in a traditional analog VCO?  

A common way achieve triangle to ramp conversion is to invert the "downward slope" of the triangle.  The inversion means instead of the waveform going up and down it only goes up.  

Easy right?

You can use an op amp to invert things:



...but as per my lab notes you have to turn on and off the switch at exactly (and I mean, exactly) the right time!


How can we create this critical switching signal?  

That's the tricky part! I had some (complicated) ideas using comparators to trap the top and bottom of the triangle, or maybe an ADC and MCU, but my notions seemed overly complex. 

There must be a simple way to do this, but how?  

At the advice of a friend I turned MODWIGGLER DIY FORUM for help.

MW is an amazing resource!  

After posting my problem some really talented techs jumped in with suggestions; the thread on MW is here

Guest from OpenMusicLabs conjured up a simple Falstad Simulation--fantastic!

Guest's from OpenMusicLab's design--you can see the sim he created here.


I drew up a schematic based on his idea--my schemo also provides for a pulse width modulated square wave, which I fully stole from the DIY legend Thomas Henry, as well as a buffered triangle output:

Values changed for the bench prototype (so far): C3 and C6 are are .0022uF; zener is 5V; R18 is 50K.

I turned that into a PCB to try out on the bench.....

Then I sent the gerber to this blog's patient and always helpful sponsor, PCBWAY, who quickly got it back to me:

My usual shout out to the folks at PCBWAY, please help out this geekly blog and give them a look for your next round of fab....

Cool! 

Did the PCB work right away?  

Nope.  

It wasn't a mistake in the design, nor in the converter circuit's basic concept, rather, I suck at breadboarding and was sloppy with soldering....I don't know exactly what it was, but all the wires and parts and alligator clips and things all my bench over drove me nuts.  

After blowing up a SEEED RP2040 **and** a 9833 breakout board, cleaning up bad solder joints, trying out some different cap values, and wasting a lot of time due to stupid breadboarding mistakes, yes, I got it to work.

The horror....

The horror....

The ramp wave created wasn't perfect but it was pretty close; it sounded a bit gritty, which was A-OK by me.  The distortion at zero crossing was less evident at lower frequencies where it counts most.  


Distortion at 4k; it diminished at lower frequencies


There was further discussion on ModWiggler about how to clean up this distortion. For instance, don't use a 2N7000 MOSFET for the switch, use a comparator. Update 2-27-23--putting a .01uF cap between pin 1 of the 2N7000 and ground improved this switching distortion somewhat. I will include this mod in a future "improving the tri to ramp converter" post.

The conversion conversation continues....this is an extremely helpful and enthusiastic community, and I am grateful for all the techs who helped with this design to date. 

OK I will put the AD9833/RP2040 and this waveform conversion board into a single package to make a Euro module VCO prototype in the next post. I will also make it easy to swap in different waveform conversion boards so the design can be further refined by making the VCO truly modular, from a design and layout perspective.

If I have time? Really folks, it's time to keep moving forward. Please stay tuned.

JTAG to SWD Converter

Readers: If you'd like to build the project featured in today's post, please go to PCBWAY's Community pages--gerber file, KiCAD ...