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.
Comments
No comments yet





