Tag Archives: MCP3021

OctoPROBER ADC working!

20140208_062003

Finished programming the ADC which is a MCP3021. It is a 10bit i2c compatible ADC with one channel. A limited ADC but perfect for measuring battery voltages.

Operation is very simple. Just request a word from the device using 10011011 as the device ID and it will spit out the analog value. I had some issues with the i2c driver I used though.

The ADC is supposed to return the 10bit value like so 0000XXXXXXXXXX00. I was receiving XXXXXX000000XXXX. The upper and lower bytes where transposed. Fixed by swapping them around.