Hello,
I would like to use P0.0 and P0.1 as General GPIO for I2C in nRF52840.
I have run the twi_sensor example in SDK 17, it works well with ARDUINO_SCL_PIN and ARDUINO_SDA_PIN, but when I set
Hello,
I would like to use P0.0 and P0.1 as General GPIO for I2C in nRF52840.
I have run the twi_sensor example in SDK 17, it works well with ARDUINO_SCL_PIN and ARDUINO_SDA_PIN, but when I set
Bad idea, that is where the 32.768kHz crystal is connected to. Pretty sure that this component is populated on the DK.
Most examples enable this crystal and you cannot use pins with more than 1 peripherial at a time.
Cause I have a custom board and it doesn't not use the 32.768kHz crystal.
Do you think I can use those pins on my board for TWI?
Hi,
The P0.00/P0.01 pins are by default connected to the 32.768 kHz crystal on the nRF52840 DK, and disconnected from the pin headers. If you want to use the pins as GPIOs, you can disconnect the crystal as described in the documentation: 32.768 kHz crystal.
Also make sure that you change the LFCLK source from XTAL to RC if you use the LFCLK in your application (always used by SoftDevice if this is enabled for BLE).
Best regards,
Jørgen
Could I utilize P0.00/P0.01 pins for TWI without any modifications if my custom board doesn't use the 32.768 kHz crystal?
And do I still need to take this as my application does not yet utilize BLE?
"Also make sure that you change the LFCLK source from XTAL to RC if you use the LFCLK in your application (always used by SoftDevice if this is enabled for BLE)."
As long as you do not start the LFCLK, you can use the pins as GPIOs. If you start the LFCLK, you need to set the LFSRC to RC.
On a custom board where you do not have the 32.768 kHz crystal mounted, you can use the pins for TWI without modifications to the board. The modification is required on the DK, since we have included an option to disconnect the crystal if it is not required. This makes the DK flexible for multiple configurations.