True 16-bit PWM

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Consul

Well-known member
Joined
Jun 3, 2004
Messages
1,653
Location
Port Huron, Michigan, USA
I've been searching around for ages, and I'm tearing my hair out.

I'm trying to implement a MIDI-to-CV converter. The idea is to use the low-voltage PWM output of a chip to drive the gate of a MOSFET which will be controlling a larger, regulated voltage that will then be filtered to DC to create a control voltage.

I know 16-bit PWM must exist somewhere, but figuring this out is driving me nuts. For CV, I don't need that high of a frequency, but I do need as good of resolution as I can manage. So I thought I'd ask here: are there any microcontrollers on the market with a true 16-bit output compare for PWM? Every data sheet I've pored over so far has left me scratching my head.

If I have to, I suppose I could implement the whole thing on one of my FPGA boards, but that seems like overkill...
 
There should be plenty of cheap micros with 16 bit PWM outputs. Pretty straightforward but you may have to look at update speed and output filtering concerns.

For a 16b wide PWN the update frequency of the PWM will be the processor clock divided by 65,000. So at 50% of full scale with say a 6.5 MHz processor clock your PWN will be making a 100Hz square wave give or take. So figure a bunch of LPF to smooth that out.

I would be tempted to suggest running the PWM at the processor voltage then just scale that DC voltage with an opamp (like the LPF filter opamp)  to whatever voltage  range you need. Running the PWM from higher voltage sounds like too much work.  8)

Do you really need 16B resolution... ? If you can live with a shorter lower resolution PWM you will get a faster update, making filtering easy.  I've seen cheap 16b micros that can run up to 20 MHZ clock so that would helps in that direction.

JR
 
@JohnRoberts: I have some pretty big filtering caps on hand, but I see your point.

I was looking at some of the 80MHz PIC processors. At 80MHz, it looks like I could run a 16-bit PWM at about 1 kHz, which would be good enough for this application, I think. I've been wanting an excuse to get into PICs, too, but at the same time, I'm already drowning in microcontroller platforms.

@Rochey: There's no way I could handle anything in a VSSOP package, but otherwise that part looks pretty good.

I have a Tiva, and I would like to try using that, but setting up CCS has been a major headache (licensing issues) and pretty much killed my enthusiasm for the platform.
 
dmlandrum said:
I was looking at some of the 80MHz PIC processors. At 80MHz, it looks like I could run a 16-bit PWM at about 1 kHz, which would be good enough for this application, I think. I've been wanting an excuse to get into PICs, too, but at the same time, I'm already drowning in microcontroller platforms.

Pretty much any microcontroller you can buy these days has at least one DAC.

-a
 
Andy Peters said:
dmlandrum said:
I was looking at some of the 80MHz PIC processors. At 80MHz, it looks like I could run a 16-bit PWM at about 1 kHz, which would be good enough for this application, I think. I've been wanting an excuse to get into PICs, too, but at the same time, I'm already drowning in microcontroller platforms.

Pretty much any microcontroller you can buy these days has at least one DAC.

-a

16 Bit? 

The current DSP I'm using has a stereo 16bit DAC inside but it seems optimized for making audio (oversampled yadda yadda) and I don't think it's intended for DC precision applications.

I have seen some 8 bit DACs inside cheap processors, while PWM outputs are like belly buttons (they all have them). I guess you could roll your own DIY DAC with a home brew r-2r ladder and 16 pins but I wouldn't make any assurances about being monotonic.

JR
 
VSSOP is not an excuse, it's 15 minutes with eagle (using the TI supplied library) making a 0.1" breakout board, then fabbing it with oshpark for $5 (because even at 0.1" spacing,it'll be 0.5"x 0.5").

bucket of flux and a soldering iron, you'll be fine.
 
@rochey: Or I could just pick one up from here: https://www.sparkfun.com/products/494 :) Looks like the right footprint.

The nice thing about the 8552 is it has two channels, and is a pretty good price. Two of those would make the converter I have in mind. Then I'd just need some careful voltage gain to get the CV range I want.
 
The VSSOP footprint is a good bit smaller than the SOIC. Also if you layout the board yourself anyway, what advantage do you expect from using an additional adapter pcb?
 
Well, my plan was to build this point-to-point and not ever lay out a board, not in CAD, anyway. Maybe I'm just growing resentful of the fact that so much DIY has to take place inside a computer and get sent away for fabrication now, but I'm actively trying to avoid that.

If that breakout board won't work, then it appears nobody offers one for VSSOP that I could find. EDIT: Oh, wait! Here's one: http://www.karlssonrobotics.com/cart/VSSOP-8-to-DIP-8-SMT-Adapter-0.5-mm-pitch/
 
dmlandrum said:
Maybe I'm just growing resentful of the fact that so much DIY has to take place inside a computer and get sent away for fabrication now, but I'm actively trying to avoid that.

I love the fact that I can DIY one off things that are just as good as what the big boys use and make.

Heck, the whole maker revolution has done wonders for our corner of audio electronics.

I would never have dreamt that I'd have the capability to manufacture thousands of PCB assemblies a year, in my garage!
I'm still working on having the actually customer demand!

 
Eh, this thread has now become too self-reflective. I'm going to see if I can mod this VCO on my breadboard to output sawtooth waves.

Maybe I'll just make a small keyboard with a switch and tuning pot on each key and call it good.
 
dmlandrum said:
Eh, this thread has now become too self-reflective. I'm going to see if I can mod this VCO on my breadboard to output sawtooth waves.

Maybe I'll just make a small keyboard with a switch and tuning pot on each key and call it good.

sorry dude.
 
Sorry, I'm not trying to be difficult. Maybe I need to explain my real motivations.

My goal is to make a modular synthesizer as cheap and easy as possible while still being somehow usable. It'll probably not sound like most other modulars, and that's the point. Really, I actually want it to sound something like an sound effects box from a 1950s sci-fi soundtrack. :)

Like the old Paia 2720, but I have the benefit of some newer chips here and there.

The entire point is to avoid third party fabrication and use easy-to-get parts that many people already have on hand. The exception to this is, as you might have guessed, a MIDI-to-CV converter, but again, since I'm after something unusual that'll make me think about sound in different ways, I might go another route.
 
You may not need 16 bit resolution for CV.

The old synths were notorious for poor stability, it might be interesting to use modern technology to deliver the sound flavor of the old stuff, without the annoyances.

JR
 
JohnRoberts said:
Andy Peters said:
dmlandrum said:
I was looking at some of the 80MHz PIC processors. At 80MHz, it looks like I could run a 16-bit PWM at about 1 kHz, which would be good enough for this application, I think. I've been wanting an excuse to get into PICs, too, but at the same time, I'm already drowning in microcontroller platforms.

Pretty much any microcontroller you can buy these days has at least one DAC.

-a

16 Bit? 

You asked the question below -- does he need 16 bits for a CV applications?

-a
 
JohnRoberts said:
You may not need 16 bit resolution for CV.

The old synths were notorious for poor stability, it might be interesting to use modern technology to deliver the sound flavor of the old stuff, without the annoyances.

JR

I've been working on exactly this recently. I'm looking at building a fully-analog synth with extremely comprehensive digital control from 16bit controllers with very very stable control via VST over MIDI or OSC.
I have a long way left to go, but it's the type of product I think people would really appreciate.
 
The moment I saw "16 Bit PWM," I immediately thought of this-

http://www.ti.com/lit/an/snva605/snva605.pdf

The whole brochure is concerned with better LED dimming, but hey, it's all just electrons in a circle right?
 
Infineon XMC4100 comes with high resolution PWM with 17 bits accuracy at 50 kHz (and guess a little bit better better at lower rate).

http://www.infineon.com/cms/en/product/microcontroller/32-bit-industrial-microcontroller-based-on-arm-registered-cortex-tm-m/32-bit-xmc4000-industrial-microcontroller-arm-registered-cortex-tm-m4/XMC4100-Q48K128+AB/productType.html?productType=db3a304443c4bf510143d4d7aeaf1422

 
Back
Top