kranenborg
Senior Member
The Picaxe and the Raspberry Pi are two quite different beasts but they appear to team up rather well. In particular the straightforward implementation of the I2C protocol by the Picaxe X2 variants (using the scratchpad RAM) makes the X2 chip a very useful companion as an I2C slave to the RasPi (which lacks basic ADC functionality as well as real-time operation) for extending the RPi's outer hardware layer towards a "truly embedded" computer system.
I came across Rahul Kar's website as a very clear, simple and inspiring example:
http://www.rpiblog.com/2012/11/interfacing-adc-with-raspberry-pi.html
His hardware setup is based on the older 28X1
There is one caveat though: it may not work with an X2 (as I tested with an 28X2), the Picaxe speed needs to be increased to 16Mhz to make his example work!
I have attached my working 28X2 program (with some comments and few code extensions), Rahul's RasPi python code can be used directly.
/Jurjen
http://www.kranenborg.org/electronics
View attachment 28X2_SlaveToRPi.bas
I came across Rahul Kar's website as a very clear, simple and inspiring example:
http://www.rpiblog.com/2012/11/interfacing-adc-with-raspberry-pi.html
His hardware setup is based on the older 28X1
There is one caveat though: it may not work with an X2 (as I tested with an 28X2), the Picaxe speed needs to be increased to 16Mhz to make his example work!
I have attached my working 28X2 program (with some comments and few code extensions), Rahul's RasPi python code can be used directly.
/Jurjen
http://www.kranenborg.org/electronics
View attachment 28X2_SlaveToRPi.bas
Last edited: