I2C using processor expert

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2C using processor expert

Jump to solution
2,029 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
1,014 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
1,014 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
1,015 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

0 Kudos
1,014 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