I2C using processor expert

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

I2C using processor expert

跳至解决方案
2,902 次查看
dporada
Contributor III

I'm trying to use I2C routines created by processor expert.  I am trying to read temperature from an I2C device and when using code similar to the examples and I see the following problem on a scope.

When I transmit the address that I need to read and the program waits for the OnTransmitData interrupt to set a flag.  The program sees the OnTransmitData interrupt flag before the Close.  The program then continues to try to receive data  and I get a "Bus not available" error.

Do I need to insert a delay?  None are shown in the sample code.

Thanks for your help.

0 项奖励
回复
1 解答
1,887 次查看
dporada
Contributor III

Alice,

The chip I was talking to was an MCP9804.  The example I used was the "Typical Usage" when you select "Help on Component" for the I2C component.  I used the receiving data in master mode.

I was able to fix the problem using the CheckBus( ) before using the RecvBlock.

Thanks anyway,

Don

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,887 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Donald,

You use which chip , i thin it should have related flag to show the situation of receive and bus .

And  which example do you refer to , i will check it on my side .

Hope it helps

Alice

0 项奖励
回复
1,888 次查看
dporada
Contributor III

Alice,

The chip I was talking to was an MCP9804.  The example I used was the "Typical Usage" when you select "Help on Component" for the I2C component.  I used the receiving data in master mode.

I was able to fix the problem using the CheckBus( ) before using the RecvBlock.

Thanks anyway,

Don

0 项奖励
回复
1,887 次查看
oleglavrukhin
Contributor IV

Hi, Donald!

1) search "I2C" in MCU on Eclipse | Everything on Eclipse, Microcontrollers and Software . It is a better site for Freescale processor expert.

2) or You can try to use this I2c driver, I use it in my KDS (without Kinetis SDK) projects for FRDM-K64F board.

3) and check a pull-up resistors in I2C bus.

Good luck!

0 项奖励
回复