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.
Solved! Go to Solution.
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
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
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
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!