2009-03-26 17:49:31     i2c blackfin twi

Document created by Aaronwu Employee on Aug 14, 2013
Version 1Show Document
  • View in full screen mode

2009-03-26 17:49:31     i2c blackfin twi

Silver Pine (UNITED STATES)

Message: 71638   

 

Hi,

 

The TWI interface on the BF536 is only transmitting the first three or four bits of the I2C address, as observed on a scope.  No other follow-on bits or bytes are observed.  The code uses the i2c-bfin-twi, i2c-dev, and i2c-core drivers.  Could the CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ not be configured correctly?

 

silverpine

 

lpl_i2c_talk.c

QuoteReplyEditDelete

 

 

2009-03-26 20:20:54     Re: i2c blackfin twi

Robin Getz (UNITED STATES)

Message: 71641   

 

Silverpine:

 

What version of software are you using?

 

 

QuoteReplyEditDelete

 

 

2009-03-26 20:25:38     Re: i2c blackfin twi

Silver Pine (UNITED STATES)

Message: 71644   

 

Linux release 2.6.19.3-ADI-2007R1-svn84

QuoteReplyEditDelete

 

 

2009-03-26 20:53:57     Re: i2c blackfin twi

Robin Getz (UNITED STATES)

Message: 71645   

 

Silverpine:

 

We tested that out on a 537-stamp, and it seemed to work.

 

Can you replicate things there - or does it just fail on your hardware?

 

-Robin

QuoteReplyEditDelete

 

 

2009-03-26 23:47:57     Re: i2c blackfin twi

Silver Pine (UNITED STATES)

Message: 71650   

 

I dont' have a 537-stamp.  I did increase the clock frequency from 50 kHz to 400 kHz in the i2c-bfin-twi.c file, and now there is 9 to 10 bits that appear on the scope rather than 3 or 4 bits.  I use the I2C address 0x48, and this appears in the first seven bits.  If I do a write, the eighth bit is cleared, and if I do a read the eighth bit is set.  So there is some attempt to setup the address and read/write bit.  I think the increase in the clock frequency helped push more bits out the TWI device.  There is something that causes the sending of the bits to immediately quit.

 

silverpine

QuoteReplyEditDelete

 

 

2009-03-27 00:22:51     Re: i2c blackfin twi

Sonic Zhang (CHINA)

Message: 71652   

 

Could you try again on 2008R1.5-RC3 release on your custom board?

 

 

QuoteReplyEditDelete

 

 

2009-03-27 05:34:56     Re: i2c blackfin twi

Michael Hennerich (GERMANY)

Message: 71682    Do you have PULL-UP resistors on SDA and SCL?

 

-Michael

 

 

 

QuoteReplyEditDelete

 

 

2009-03-30 17:24:05     Re: i2c blackfin twi

Silver Pine (UNITED STATES)

Message: 71798   

 

Yes, there are pull-up resistors on SDA and SCL.

 

In tracing through the bfin_twi_handle_interrupt in the i2c-bfin-twi.c file, the MERR is always high.  The mast_stat reports a LOSTARB, and the iface->result gets set to 0.  The transfer is aborted due to a lost arbitration.

 

silverpine

QuoteReplyEditDelete

 

 

2009-04-09 19:16:34     Re: i2c blackfin twi

Silver Pine (UNITED STATES)

Message: 72483   

 

It works now.  There was a hardware issue.   Thanks for your help.

 

silverpine

Attachments

Outcomes