Improved DAC driven 3x -10 to 10V CV Generator

Howdy--this post is part III of the posts here and here

From last time--I created a simple control voltage generator, sourcing about 30mA with 3 independent pots, each output is -10 to +10V DC controlled by a dedicated pot.

For revision 3 I added a MCP4728 DAC and tweaked the 16-bit ADC reads, using 3 of the 4728's 4 channels, to make the CV generator's output better match the values shown in the OLED.



This simple revision had a big problem....unlike REV 1 and 2 I couldn't get the I2C bus to work--no I2C signal, anywhere.  

I figured it was a hardware issue and spent a lot of time troubleshooting based on that assumption--nope.

Then I had to move my shop--pack up every tool, every part, every file drawer, move it across town, then set it all back up again--a ton of work.

Once unpacked I took this back up in my new workshop, and Claude.ai caught the problem; the sketch used the "SSD1306AsciiWire.h" library to drive the OLED; my code was written like this:

  Wire.begin(); //set I2C 

  oled.begin(&Adafruit128x64, I2C_ADDRESS); 

  Wire.setClock(400000L);  //set I2C speed. 


meaning the I2C speed was set after constructing the oled object.

The bot told me I had to add the Wire.setClock statement before calling oled.begin. I knew that?

So--should be this.

   Wire.begin(); //set I2C 

  Wire.setClock(400000L);  //set I2C speed. 

  oled.begin(&Adafruit128x64, I2C_ADDRESS); 


(The code worked in revision 1 and 2 but not this one, making this hard to track down....)

Otherwise a simple build.








The OLED needed a standoff and I was surprised I couldn't find anything close to what I needed on the Internet so I designed and 3D printed one myself:


That sat between the front panel/Oled and the PCB:

 
Easy....

I will package all of this up (gerber, Kicad files, STL file for the standoff, Arduino code, and all the rest)--and put it on PCBWAY's community site once I am less slammed by my day job--please stay tuned--in the meantime here's the shameless plug for my sponsor.


      

 For all your prototype and production needs, PCBWAY is the place to go.

they can fabricate PCBs using full color! Details here

In addition to top shelf PCB fabrication they also do fantastic work with assembly3D printinginjection molding, and much more. 

Their staff is extremely helpful and PCBWAY always turns work around quickly. 

As always--you can help this blog by checking out the PCBWAY site. Thanks.




Boring AI background.

Is that it?  Yep that's it for now. 

See ya next time.

No comments:

Post a Comment