PDA

View Full Version : I2C Bit-Banged Routines


gtsanford
09-12-2009, 10:46 AM
This script (ReadSMB.py) was developed to read the registers of a battery using the System Management Bus to access its parameters. It is bit-banged, therefore it is somewhat slower than the built-in I2C routines, but it is fully cutomizable to suit your needs, and is portable to other systems by changing the pin assignments. Hopefully the comments in the script will make its use apparent.

angrykid
01-04-2012, 09:28 AM
Thanks a lot, I was wondering is it possible to program i2c repeated start condition, and seems like SNAPpy doesn't have such function. So I think I will need to bitbang. Thank you for posting this

angrykid
01-09-2012, 08:31 AM
Hey guys. Bit-banged version was really slow, and using poke() and peek() functions I was able to reach internal I2C controller (my processor is ARM7, MC13224V transceiver module). So there is my script with I2C routines (they are including REPEATED START condition). They are written to communicate with Freescale sensors (MAG3110, MMA8541Q), but it can be easily modified for any other devices. Good luck.

Jheath
01-09-2012, 08:33 AM
Thanks for posting. This should come in handy for folks!

(It seems like every I2C "standard" device works a little differently)