Hi everyone,
I am new to programming on such an embedded device(NRF52840DK). I met a problem recently of how to set up the PIN on the board to connect with the LPS22HB sensor.
Basically, I am sure that only 3.3V, GND, SDA, SCL on the sensor is required to be connected(I2C communication). And I am using Zephyr as the underlying RTOS. Here are my questions:
1. Currently, I don't have a breadboard so I am wondering if I could use some pins like P1.07 and P1.06 as the 3.3v and GND respectively.
2. I found out that NRF52840DK only have a 5v pin, then how can I set up a 3.3v pin
3. To use SDA and SCL, I need to create an overlay file. I followed some examples and create a simple file like this and I have some problems:
&i2c0 { status = "okay"; //Here I am confused about how to distinguish between P1 and P0 sda-pin = <4>; //Refer to P1.04 or P0.04 on board? scl-pin = <5>; //Refer to P1.05 or P0.05 on board? lps22hb@76 { //I don't know how to select the compatible name compatible = "nordic,lps22hb"; //This address is from the sensor or the board? reg = <0x76>; label = "LPS22HB"; }; };
1. How to distinguish between P1 and P0 in the overlay file
2. Do we need to follow some standards to specify the compatible field?
3. How to get the address in the reg field
Again, there might be lots of stupid questions here but I honestly can't find a sufficient guide for beginners.
I appreciate it if someone can answer these questions. Thanks in advance.