[Patch] i2c-algo-8240.c: no ack in m8240_readbytes()

xiaogeng_jin at agilent.com xiaogeng_jin at agilent.com
Wed Apr 21 07:30:15 EST 2004


Wolfgang,

I had the following problem when using i2c-algo-8240 module on MPC8245 and fixed it by the attached patch. The problem is that no ACK is generated after each byte is received by the master (the i2c interface of MPC8245). And the solution is to clear TXAK after each m8240_iic_read() in m8240_readbytes(). Also during initialization TXAK is cleared.

BTW, I'm not sure if the problem exists in MPC8240. I don't have 8240 to test.

> However I have some problem using this module on my custom 
> MPC8245 board. There is no problem for write. Data seems to 
> be written into SEEPROM. The following message is captured by 
> the i2c monitor.
> Msg     3 [Start]#A0[W][A]00[A]00[A]01[A]02[A]03[A]04[A][Stop]
> 
> But for read, only the first byte is returned when I try to 
> read multiple bytes. The following messages show that I try 
> to read 4 bytes at the beginning of SEEPROM.
> Msg    14 [Start]#A0[W][A]00[A]00[A][Stop]
> Msg    15 [Start]#A0[R][A]01[N]FF[N]FF[N]FF[N]FF[N][Stop]
> 
> I suspect that the i2c controller doesn't generate the ack 
> bit, which is supposed to do so. Why does the controller 
> generate ACK automatically for write operations but not for 
> read operations?
> 

Regards,
-Shawn.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i2c-algo-8240.patch
Type: application/octet-stream
Size: 1363 bytes
Desc: i2c-algo-8240.patch
Url : http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20040420/ed73e11a/attachment.obj 


More information about the Linuxppc-embedded mailing list