I2C not working?

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

I2C not working?

1,485件の閲覧回数
gary-h
Contributor II

The board is an LPC55S69-EVK.

I'm trying to re-create lpcxpresso55s69_i2s_dma_transfer as a ThreadX task.  (ThreadX is a requirement for this project.)

I am currently stuck on the I2C initialization of the codec.  The code looks the same, and it (usually) claims that the codec was initialized properly.  Two things make me think that the I2C is not working properly:

1) Frequently the code will fire a fail assertion for the first SMB transfer.

2) The configuration commands are very different between the example and my code.  The trace for the example has several thousand transactions, while my version has only 200 or so.

The example does not include a .mex file, so I can't copy the I2C/Flexcomm4 configuration from it

Any pointers on where to look?  Other tests I can run?

Gary.

0 件の賞賛
返信
9 返答(返信)

969件の閲覧回数
gary-h
Contributor II

It seems that the problem is trying to use FLEXCOM4 for I2C.  If I don't make that mistake things seem to work.

0 件の賞賛
返信

1,257件の閲覧回数
gary-h
Contributor II
Update: The same issue exists with the provided example "lpcxpresso55s69_i2s_dma_transfer". Probe MCLK and I2C stops working.
0 件の賞賛
返信

1,261件の閲覧回数
gary-h
Contributor II

This is what I have learned so far:

A little background:  The software is driving the WM8904 on the LPC55S69-EVK.  FLEXCOMs 6 & 7 are used for the I2S, FLEXCOM4 is used for the I2C.  In addition, MCLOCK is sourcing 24.576 MHz to the WM8904.

If I connect a scope probe - Genuine Tektronix 10 Megohm, 13 pF - to the MCLOCK pin, FLEXCOM4 stops working.

I don't have to do anything else.  Just probe the pin, and I2C stops working. 

The clock looks OK on the scope but all I2C transactions to the WM8904 fail.

0 件の賞賛
返信

1,437件の閲覧回数
gary-h
Contributor II

Reproducing the error is simple - just run the program.  Detecting the error is a little harder: I have a monitor that captures the I2C transactions, and there are many missing, and most have transfer errors.

Bottom line is that after calling Codec_Init, the codec is not initialized.

0 件の賞賛
返信

1,393件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @gary-h 

Recommend you using logic analysis the I2C signal.

 

"Bottom line is that after calling Codec_Init, the codec is not initialized."

->> Debug step by step check the issue. and fist can try to use i2s demo, confirm it works well, then add ThreadX .

 

BR

Alice

0 件の賞賛
返信

1,355件の閲覧回数
gary-h
Contributor II
I have confirmed that the I2S demo does not work when ThreadX is added. Any advice in that area would be appreciated.
0 件の賞賛
返信

1,286件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @gary-h 

Please take a picture about hardware connection and show the errors you said:

" I have a monitor that captures the I2C transactions, and there are many missing, and most have transfer errors."

thanks.

 

 

BR

Alice

0 件の賞賛
返信

1,259件の閲覧回数
gary-h
Contributor II
There's not much to see on the trace. The first part of a register read - where you send the Device ID and the Register Number - gets NAK'd. All transactions fail.
0 件の賞賛
返信

1,451件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @gary-h 

How about share the project and detail steps to reproduce your issue? 

 

BR

Alice

0 件の賞賛
返信