MCP4802 – 8bit dac

Farnell being as quick as the death, I’ve received my microchip dac and create a library to use that serie of DAC. Really handy chip by the way, Two dacs in a small DIP8 package.

The code is rather simple, it uses the built-in SPI interface to send data (instead of bitbang). The tricky part was the SS pin but once you read the datasheet (again…) that’s alright.

There’s curently only the 8bit version done although the 12bit version is the same with a minor difference, you use the total length of the second byte to send the data (cf. datasheet).

A nice little thing to mention the LOAD_DAC pin which updates both dac at the same time.

Anyway, nice piece of kit with lot of features (x1 or x2 gain, internal vref, shuntdown mode ect…).

the library : https://github.com/ThebigDickhead/AVR_PROG/blob/master/MCP4802_DAC/MCP4802_DAC.h (note that the current version takes care of the gain setting and shuntdown mode, well, because I don’t want to change it and there’re set natively.)

I’ll add the 12bits version later on when the time comes for it !

I add that I’m quite happy with Farnell service ! less than two days from the north UK warehouse !

Advertisements

Leave a comment

Filed under Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s