Hello,
We are trying to set up communication between nrf52840 and Arduino UNO over I2C.
The challenge is we don't know the slave address of the Arduino.
Anyone else has worked on this before please guide.
Thanks
Hello,
We are trying to set up communication between nrf52840 and Arduino UNO over I2C.
The challenge is we don't know the slave address of the Arduino.
Anyone else has worked on this before please guide.
Thanks
As described in the example documentation, the nRF will output the results of the TWI bus scan to the terminal, where your Arduino device then should show up - if it is connected correctly and configured as a TWI slave.
This is working. We are able to get the Slave address via the TWI scan example.
One more question though: What should be passed in the first argument of nrf_drv_twi_tx? The argument requires: nrf_drv_twi_t const * p_instance?
Hello,
Neel said:This is working. We are able to get the Slave address via the TWI scan example.
Great, I am happy to hear that you are able to find the slave address of your connected device.
This means that the connection is correct, and the configuration of the connected device as a slave device is correct.
Neel said:One more question though: What should be passed in the first argument of nrf_drv_twi_tx? The argument requires: nrf_drv_twi_t const * p_instance?
For the first argument of the function, you should pass your twi instance. You can see this being created at the very start of the example, in the line:
static const nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID);
Hello,
Neel said:This is working. We are able to get the Slave address via the TWI scan example.
Great, I am happy to hear that you are able to find the slave address of your connected device.
This means that the connection is correct, and the configuration of the connected device as a slave device is correct.
Neel said:One more question though: What should be passed in the first argument of nrf_drv_twi_tx? The argument requires: nrf_drv_twi_t const * p_instance?
For the first argument of the function, you should pass your twi instance. You can see this being created at the very start of the example, in the line:
static const nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID);