View previous topic :: View next topic |
Author |
Message |
Jerry I
Joined: 14 Sep 2003 Posts: 96 Location: Toronto, Ontario, Canada
|
i2c bus scanner program [Solved] |
Posted: Tue Oct 27, 2015 6:59 pm |
|
|
Using PCWH 5.051
PIC18F97J60
Hi
I am trying the PCM Programmers I2C Scanner code and find that it works fine.
My question is if I unplug my I2C device from the board, the code hangs at the first address to test for.
Is this normal??
The way code is written it appears that it should not hang.
Thanks for any help
Jerry
Found The problem.
My I2C device is on a plug in module, when I remove the module the code would hang.
The reason it would hang, I had the 4.7K pullups resistors on the 12c signals on the plug in module.
When I unpluged the module, no pullups in the i2c signals.
Thanks again! |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19545
|
|
Posted: Wed Oct 28, 2015 2:03 am |
|
|
and (of course) if you wanted to test for this in code, then read the input_state of both the I2C pins. If either is low, then print an error message that the I2C pins are not pulled high, before starting the scan. |
|
|
|