Hi,
I did never get the i2c_slave function in the i2c_lib 3.1.1 to work so I rewrote it.
My version does not handle repeated starts and has only been tested on real HW (with a reaspberry PI as master) for reading/writing one byte.
I did a lot of debugging and testing using the simulator and a plugin I wrote to act as master.
Since I am convinced (95 % at least) that the current i2c_slave is buggy I hope that you will fix it in coming releases and I am attaching my version if that would help.
This version contains a minor artefact on the SDA when doing the ack for correct address in that it takes almost 1 us before the SDA is pulled low which means that the SDA pin is high for almost 1 us before being pulled down by slave before bit 9. No problem for normal 100 kKz clock but will be tight for a 400 kHz clock.
/Igor
Rewritten i2c_slave
-
- Member++
- Posts: 25
- Joined: Tue Mar 11, 2014 8:16 pm
Rewritten i2c_slave
You do not have the required permissions to view the files attached to this post.
-
- Experienced Member
- Posts: 66
- Joined: Fri Feb 05, 2010 12:34 pm
The lib_i2c was updated to version 3.1.4 in the meantime.
You can try that version to see if it fixes the problem.
You can try that version to see if it fixes the problem.