In fact before your post, I did the modification to allow clock stretching in your driver.
Now, it works very well to write to an atmega32 :-) (I am using your driver in the phrozen distro, without the dynamic dev allocation, for simplicity). I have still an issue : your driver reports an error while generating the stop bit. I checked the code, and found the test which produces this error, but I do not understand how the test can generate such an error. Also, I still have problems to get reliable reads from the atmega, but I think that the end is not that far. I will post my (small) modifications when it will work. Thanks for your work ! Frederic. Geert Vancompernolle a écrit : > > --- In [EMAIL PROTECTED] s.com <mailto:foxboard%40yahoogroups.com>, > Frédéric Feyel <[EMAIL PROTECTED] .> wrote: > > > > (Note that the norm explicitely states that there is *no* timeout with > > clock stretching : a slave can stretch the clock for seconds > > if it wants/needs to do so) > > Yes, even for hours if needed... That's the power of the I2C > protocol. Fast devices can work with slower devices... > > > timing comments, so I do not want to perturb your nice > > work. How can I add this check in your code ? > > Well, if you look closely to my changes, you will see that I've added > a function macro to check if the SCL is high, next to the check for > the SDA line which was already there. Search for "i2c_scl_is_ high". > > You can add this line wherever you want into your driver version to > check for the state of the SCL line. This way, you can observe if > someone is holding the SCL line high or low. > > I'm using this check to see if the I2C bus is free, prior to > generating a start condition. > > HTH, > > Best rgds, > > --Geert > >
