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

homelist of postsdocs 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


Warning: require(comments.php): failed to open stream: No such file or directory in /home/transist/public_html/post/stdal/post36.htm on line 158

Fatal error: require(): Failed opening required 'comments.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/transist/public_html/post/stdal/post36.htm on line 158