I2C using processor expert

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C using processor expert

Jump to solution
1,354 Views
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 Kudos
1 Solution
339 Views
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

View solution in original post

0 Kudos
3 Replies
339 Views
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 Kudos
340 Views
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

View solution in original post

0 Kudos
339 Views
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 Kudos