[En-Nut-Discussion] TWI aka I2C, not getting an ACK back? - SOLVED

Douglas Pearless Douglas.Pearless at pearless.co.nz
Thu Mar 17 10:16:41 CET 2005


Hi Harald,

Thanks for the assistance.

It turned out that the TwMasterTransact routine, when you pass the 
address of an array for the transmit buffer, it starts the 'read' from 
the data[1] not data[0], so it was skipping the register address of the 
DS1337 which was in the zeroth position (data[0])

When I figured that out, and corected my code, it then worked perfectly!

Rather bizzare, but then I am no C expert!

Cheers DOuglas

Douglas Pearless wrote:

> There are only two 2k2 pull ups on SDA and SCK to +5v and the DS1337.  
> There are no other wires or connections!
>
> Cheers Douglas
>
> Harald Kipp wrote:
>
>> Hi Douglas,
>>
>> At 16:30 16.03.2005 +1300, you wrote:
>>
>>>    rc = writeRTC(sla,0x0E,dataRTC,2); //on the i2c bus I get 
>>> "<start> 110100000 <SDA goes high>  000000000  000000000 
>>> 000000000<stop>
>>> //where did the 0x0E go which should have been immediately after 
>>> <SDA goes high>
>>> //I checked the wrteRTC routine and it does pass 0x0E 0x00 0x00 in 
>>> the 'data field to TwMasterTransact
>>
>>
>>
>> What about hardware? You are aware, that I2C is open
>> drain? Did you add pull-ups? Anything else connected,
>> which may drive the bus low?
>>
>> Harald
>>
>> _______________________________________________
>> En-Nut-Discussion mailing list
>> En-Nut-Discussion at egnite.de
>> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>



More information about the En-Nut-Discussion mailing list