Well, I couldn't leave it alone...

The Arduino code now allows triangle waves, up to 1.0MHz (same as square waves), and sine waves up to 12.5MHz.

Also managed to push my Owon VDS1022i to its limits... the sine wave started to look a bit ropey after 5.0MHz, but not bad until then.

The design, updated code and even more pictures are all shared on GitHub too:

https://github.com/ilneill/DFG-ArdAD9833

#FrequencyGenerator
#Arduino
#ArduinoUno
#ArduinoNano
#AD9833
#MCP41010
#RotaryEncoder
#KY040
#HD44780lcd

GitHub - ilneill/DFG-ArdAD9833: A Digital Frequency Generator using an Arduino Nano and an AD9833 module.

A Digital Frequency Generator using an Arduino Nano and an AD9833 module. - ilneill/DFG-ArdAD9833

GitHub

Hurrah! My latest project, an Arduino/AD9833 based digital frequency generator, is complete... And it works too ๐ŸŽ‰

Impressed with rotary encoders and the AD9833 module. Very pleased with my Owon VDS1022i USB oscilloscope performance!

Design drawn, built. Done โœ…
Code written, tested. Done โœ…

The design, code and more pictures are all shared on GitHub too:

https://github.com/ilneill/DFG-ArdAD9833

#FrequencyGenerator
#Arduino
#ArduinoUno
#ArduinoNano
#AD9833
#MCP41010
#RotaryEncoder
#KY-040
#HD44780lcd

GitHub - ilneill/DFG-ArdAD9833: A Digital Frequency Generator using an Arduino Nano and an AD9833 module.

A Digital Frequency Generator using an Arduino Nano and an AD9833 module. - ilneill/DFG-ArdAD9833

GitHub

Following my previous project... A rather disappointing analogue waveform generator, may I introduce you to my latest project - a digital waveform generator.

Working on the overall design, some Arduino code and a Fritzing drawing to accompany it.

This 3.3v/5v module has an AD9833 frequency generator, an MCP41010 digital potentiometer and an AD8051 opamp.

I really enjoy joining hardware and software to make a system.

#FrequencyGenerator
#Arduino
#ArduinoUno
#ArduinoNano
#AD9833
#MCP41010

Was laying out the #kicad #schematic for #muvco and it started to seem too pedestrian.

Went back and realized I had been using the #pcm5102 wrong and it does indeed do exactly what I originally wanted.

Now making a waveform generator instead of using the dds #ad9833. Much more flexible in shape and can be semi-polysynth ("chordal #synth"?) #synthdiy

Can now generate a perfect 5th in 260us! In mostly-unoptimized #micropython! Just dyads still--need to generalize to larger chords + diff shapes.

@cedargrove Just glancing over how you organized this I finally understand why I've had problems with the #ad9833. I've been thinking of the process as "I give a command and you obey" while it is actually "I put you in a state and you react".

That said, I'm still not sure I can do audio rate FM synthesis unless I came up with a completely different concept for input.

Oh. Among other problems, I just realized this will never work in the setup I have now.

I'm reading the FM input via #micropython. That inner loop is reading at no more than few hundred Hz, so I can't modulate with more than a couple hundred Hz. Just proved this by turning the modulation freq until I heard it aliasing. 350Hz

I'm controlling the #ad9833 via #spi, so there's no good #analog way to do the FM.

I already have the jack and knob wired in, tho. What else can I use it for?

#synthdiy

Aha, no, I see. You can't just add 180 anything in a sinusoid and end up at the same amplitude. Just think of the two peaks as a simple example.

A click-less through-zero would need to start counting the phase accumulator backwards. Which the #ad9833 doesn't do.

I think this needs a low-pass filter with a very, very high cutoff frequency.

#electronics #synthdiy

Ugh, there's a problem with the through-zero linear fm "just flip the phase 180" idea for #muvco.

#AD9833 works with a phase accumulator. Meaning it just counts up in a ramp at a rate given by the freq. Then it adds the phase register.

When I flip to the other phase register, it's a discontinuous jump = an audio pop.

Can't count backwards. Don't know where I am in the phase (I think) so I can't just add 180 to that (the #math way)

Maybe just a low-pass #filter to drop the pop?

#synthdiy

Got the code to control the #ad9833 phase registers written in about 15 minutes.

That was 3 hours ago.

I can flip registers back and forth. But I can't seem to set the value. Or it has no effect. I *always* get a phase shift of ~pi/2 instead of pi, no matter what values I put into the phase registers.

grrrrrr

I threw an FM knob on the #muvco just b/c I thought I oughtta. Getting to that part now, it looks like I'd prefer linear FM with "through-zero"

Conceptually, that's really simple to add purely in software with the #esp32 + #ad9833 b/c it has two phase registers. Init them to 0 and 180 and flip when the frequency sign toggles.

Hopefully takes just an hour or two today. Then I could hook the VCO into existing VCF/VCA #eurorack modules and retry Bach a little more musically.