mega - 12 bit outputs ?

can anything be done to convert the outputs on a mega to 12bit ?

i know the due does 12bit outputs but it only has 3.3v logic and i use 5v

any suggestions ?

is there a shield ?

A lot more detail is required here. The number of bits is nothing to do with the volts.

can anything be done to convert the outputs on a mega ...

What outputs, exactly?

the pwm / analogue outputs have a resolution of 8 bits - 5v/ 255 = 0.019 v

i wanted a min resolution of 0.004 v

is there a way to modify the board / or use a shield ?

Gadget999: the pwm / analogue outputs have a resolution of 8 bits - 5v/ 255 = 0.019 v

The "analogWrite()" function has a resolution of 8 bits but most Atmel chips have at least two PWM outputs with a 16 bit resolution.

If by "mega" you mean "Arduino Mega 2560" then you have 8 PWM pins with 16-bit resolution.

eg. Do "analogWrite(11,0)" (once!) to set up the PWM output on pin 11 then do "TCCR1A = val;" when you want to change the PWM value for that pin (16 bit).

Figuring out all the pin mappings is left as an exercise for the reader. Start here and refer to the 16-bit timers in the datasheet.

You can get 12-bit PWM i2c devices. For example from adafruit: http://www.adafruit.com/products/815. You can also get it in a shield form: http://www.adafruit.com/products/1411.

If you are driving LEDs and not servos, adafruit also has a SPI varient: http://www.adafruit.com/products/1429.

If you are only using the Arduino to drive the PWM, Pololu has the Maestro that can be driven from USB or via 5v serial line: http://www.pololu.com/catalog/category/102

thanks for the links guys

i didnt realise you could set up the mega 2560 to run 16bit :)

the servo shield is pretty cool - i can see lots of uses for that !

Gadget999: i know the due does 12bit outputs but it only has 3.3v logic and i use 5v

The Due has a digital to analog converter, which outputs an analog waveform with a resolution of 12-bits.

The Mega does not have a DAC and the "resolution" is of the digital pulse-width-modulated waveform.

These are completely different types of signals. In other words, the Mega's "analog resolution" would be 1-bit: on or off.

[quote author=James C4S link=topic=192186.msg1422317#msg1422317 date=1381335776] These are completely different types of signals. In other words, the Mega's "analog resolution" would be 1-bit: on or off. [/quote]

You can filter it...

(ie. put a capacitor between the pin and GND)

fungus: You can filter it...

(ie. put a capacitor between the pin and GND)

With a resistor between the pin and the capacitor.