The TransistoriZed logo should be here! But... curses! Your browser does not support SVG!

homelist of postsdocsγ ~> e-about & FAQ


Bit-Banged SPI for the MCP3008 ADC chip

I wanted to interface Microchip's 12-bit ADC chip (MCP3008) to the Olinuxino MICRO board, which uses the Allwinner A20 processor. Unfortunately, no kernel module supporting full-duplex SPI mode exists yet, or at least I was not able to find a working one. If we can not write and read at the same time we are limited to reading only 8bits from the ADC, which is otherwise a 12-bit SAR converter.

Here's some code implementing a bit-banged SPI specifically tailored to read out the MCP3008. It is written in python and uses the pyA20 GPI/O library by Olimex.

Date:Sun Jul 25 22:27:15 CET 2015

Comments

No comments yet
*Name:
Email:
Notify me about new comments on this page
Hide my email
*Text: