I2C to any Pin or Software I2C

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello,

I have designed PCB with a XMC4400 uC (XMC4400-F100x512) where i have to use P5.2 (#56) as SCL and P5.0 (#58) as SDA to a I2C Memory
However that two Pins cannot be assigned to an I2C app in DAVE.

On the PCB I habe a CAV24C08 and i want to use for memory access the byte-write and the selective read mode.

For example (which already worked with hardware I2C on XMC):
byte write
slave adress write: tx(0b10100000)
mem adress: tx(0x1)
data: tx(0x2)

selective read
slave adress read: tx(0b10100001)
mem adress: tx(0x1)
receive: rcv()


Is there a way to connect the two pins to the hardware I2C or "switch" the signals internally.
A software solution would be also possible, because i have only to store and load some bytes at startup.


Has already anybody used a Library for Software I2C?
I already tried something like: http://www.robot-electronics.co.uk/i2c-tutorial


Thanks 🙂
Gerald
0 Likes
1 Reply
chismo
Employee
Employee
First like received
Hello Gerald,

The I2C requires bidirectional pins which for the USIC module in XMC, means having DOUT0 and DX0 pin functions on the same pin used for SDA, and having SCLKOUT and SCLKIN pin functions on the same pin used for SCL.
P5.0 and P5.2 do not fit this criteria unfortunately.
In this case I am afraid a software solution is the best option here since I expect that changing the PCB is not desired.

Regards,
Min Wei
0 Likes