Electronic – Bit Banging a PICAXE 08M2 as an I2C Slave

i2cpicaxe

Only the X2 parts of the PICAXE family support I2C slave compatibility, but I need to have an 08M2 to act as an I2C slave on a board that I have. Unfortunately I don't have the option of changing micro-controller or making a new board.

I've been reading up on how the I2C protocol works and have found some code which may help, but haven't got any further. Has anyone done a similar thing before? If anyone has some example code which works which I can go from it would be fantastic.

Best Answer

With one master node and multiple PICAXE-08M2 I2C slaves, "diode-mixing" approach may be the easiest/cheapest solution or substitute an X1 chip.

  • single pull-up resistor for the comm. line Ea
  • each slave connects data via anode of Schottky diode & cathode to PICaxe
  • PICaxe input is connected to the comm line via a 10K resistor
  • Use simple SEROUT and SERIN operation with qualifiers to address each node
  • many others have implemented such a Serial protocol, so don't reinvent the wheel.

Grounding, shielding, impedance control and low capacitance wiring is essential. eg 7pF/ft

can you say let's have a party line? Consult with those who have done it, after you try it. enter image description here