Trouble Configuring I2C BUS

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Trouble Configuring I2C BUS

ソリューションへジャンプ
1,685件の閲覧回数
anvaya
Contributor II

Hello everybody,

    I found something very strange in my board.I used a mcf52259 as the cpu and configued it as an i2c master,when power on, ,the SCL and SDA line were all 1 level. But after the I2C enable code excuted,the SCL and SDA line were all turned to 0. When I tried to send some data out,the the scope could catch the data and clk so I know the MCU is still running.But why the two line are low  level in the idle time?

    I have checked hardware design,there is no different with the other i2c design at all !

    Any one had met the same problem?

 

     John Hu.

ラベル(1)
タグ(3)
1 解決策
1,421件の閲覧回数
anvaya
Contributor II

Thanks Tom.

Finally I found the reason.I didn't initial the i2c bus.Now it works well.

John Hu.

元の投稿で解決策を見る

3 返答(返信)
1,421件の閲覧回数
TomE
Specialist II

Do you have pullup resistors on the bus?

Refer to the first paragraph at:

http://en.wikipedia.org/wiki/I2c#Design

Are you using I2C0 or I2C1? Which pins are you using the I2C controller on (I2C or QSPI for I2C), QSPI, UART1, UART2 or FlexBus for I2C1)?

Are you reprogramming the Port Pin Assignment Registers to a different function after a transfer, and if you're programming them back to an I/O port (fix it so you don't, or) how have you got the I/O port programmed (input/output-0/output-1)?

Have you searched this forum to see if anybody else has had a similar problem?

On the subject of the proper values for the external pullup resistors, it should take less than 5 minutes to work out a provable engineering solution, but sometimes it can take a WEEK:

https://community.freescale.com/message/328502#328502

Tom

1,422件の閲覧回数
anvaya
Contributor II

Thanks Tom.

Finally I found the reason.I didn't initial the i2c bus.Now it works well.

John Hu.

1,421件の閲覧回数
Monica
Senior Contributor III

Hu,

it's great you found the root problem and you were able to fix it, thanks for sharing!

Keep up with the great job.

Best,

Monica.

0 件の賞賛
返信