Sometimes you are not sure if you connected an I2C sensor to your Azure Sphere Starter Kit correctly. Or maybe you changed some address jumpers on the sensor and you need just some quick check of the current device I2C address.
This is where I2C scanner comes to help. You just simply load this application into the Azure Sphere kit and it will scan the whole I2C address range using all available I2C bus speeds and display addresses of connected devices.
UsageClone included project repository into a local directory. Open I2C Scanner Solution file i2c_scanner.sln in Visual Studio. Run the application on the Starter Kit by clicking Remote GDB Debugger button.
Note: for best results power-cycle Starter Kit before uploading and running I2C scan. This way all I2C devices will be reset and in defined state.
Scan ResultsCheck the Output tab of Visual Studio for I2C scan results. This is an example of application output:
---- I2C Scan at 1 MHz
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
0x00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0x10 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0x20 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0x30 .. .. .. .. .. .. .. .. .. .. .. .. [] .. .. ..
0x40 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0x50 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0x60 .. .. .. .. .. .. .. .. .. .. [] .. .. .. .. ..
0x70 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
*** I2C devices detected at: 0x3C 0x6A
---- I2C Scan at 400 kHz
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
0x00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0x10 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0x20 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0x30 .. .. .. .. .. .. .. .. .. .. .. .. [] .. .. ..
0x40 [] .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0x50 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0x60 .. .. .. .. .. .. .. .. .. .. [] .. .. .. .. ..
0x70 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
*** I2C devices detected at: 0x3C 0x40 0x6A
---- I2C Scan at 100 kHz
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
0x00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0x10 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0x20 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0x30 .. .. .. .. .. .. .. .. .. .. .. .. [] .. .. ..
0x40 [] .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0x50 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0x60 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
0x70 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
*** I2C devices detected at: 0x3C 0x40
Note: Scanning process may not be 100% accurate as some devices will not respond to a simple read.
Comments
Please log in or sign up to comment.