MCP3204 AVR Driver

Just a quick post today. Some nice software was written for the DIY game pad that didn't get produced. The MCP3204 driver is in particularly good shape to be distributed as a stand-alone item.

There is an example schematic using this chip on the Using Userial Tutorial.

So here it is. Current version is 0.1. It is released under the terms of the Apache License version 2.0.

Download MCP3204 AVR Driver, version 0.1.

Configure chip select and the actual SPI pins for your particular AVR model in MCP3204.h.

#include <MCP3204.h>
...
MCP3204_Init();
uint16_t ch0_val = MCP3204_Read(MCP3204_CH_0);

Note: it's very likely that this driver would also work for MCP3208, but I don't own one to test it. If any readers wish to supply a patch I would be open to adding it.

 
 
 

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options