41 lines
1.0 KiB
Markdown
41 lines
1.0 KiB
Markdown
# nRF52840 DK I<sup>2</sup>C Scanner
|
|
|
|
Quick and simple program to scan for used I<sup>2</sup>C addresses on an
|
|
[nRF52840 DK](https://www.nordicsemi.com/Products/Development-hardware/nRF52840-DK).
|
|
|
|
# Setup
|
|
|
|
Connect I<sup>2</sup>C as follows:
|
|
|
|
```
|
|
GND -> GND
|
|
VCC -> VDD
|
|
SDA -> P0.03
|
|
SCL -> P0.04
|
|
```
|
|
|
|
## Software
|
|
|
|
Either use [nix](https://nixos.org/download/) and enter the dev shell with
|
|
`nix develop` or ensure that at least the following is installed:
|
|
|
|
- [rust](https://www.rust-lang.org/learn/get-started)
|
|
- [probe-rs](https://probe.rs/)
|
|
|
|
Attach the dev-kit with USB, turn it on and run `probe-rs list` to verify the
|
|
connection. It should show something akin to the following:
|
|
|
|
```
|
|
The following debug probes were found:
|
|
[0]: J-Link (J-Link) (VID: 1366, PID: 1051, Serial: 001050288663, JLink)
|
|
```
|
|
|
|
Run `cargo run` to compile the software and flash it. The resulting output will
|
|
tell you at which addresses I<sup>2</sup>C devices were found.
|
|
|
|
_Example output with a device at 0x27_
|
|
|
|
```
|
|
0.014221 INFO i2c device at 0x27
|
|
```
|