[En-Nut-Discussion] TwMasterTransact is blocked

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Tue Sep 11 10:58:53 CEST 2012

>>>>> "CAMBON," == CAMBON, Olivier <Olivier.CAMBON at astrium.eads.net> writes:

    CAMBON,> Dear all, I am a new user of the board Ethernut 2.1 ver C with
    CAMBON,> Nut/OS 4.10.1.  In my system, the ethernut board drives some
    CAMBON,> slave electronic using TWI / I2C bus.

    CAMBON,> I found in the documentation the API TwMasterRegRead and
    CAMBON,> TwMasterRegWrite but it seems that they are not implemented for
    CAMBON,> AVR.  So, a wrote my own "i2c_get" and "i2c_set" API.

    CAMBON,> The problem is that sometimes, in the function "i2c_set", the
    CAMBON,> call to "TwMasterTransact" is blocked.  I tried with or without
    CAMBON,> timeout. The result is the same. The TwMasterTransact does NOT
    CAMBON,> return.

What do you mean with blocked? Does it mean the call to TwMasterTransact
never returns even when given a timeout? That should never happen. Are you
sure your hardware works flawless?  Maybe your transaction on the I2C bus
has some unexpected side effect, disturbing the CPU. Did you check with a
scope/logoc analyzer that your transaction does take place and is terminated

Much to check ...

Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

More information about the En-Nut-Discussion mailing list