5 years, 6 months ago.

Does Mbed OS 5 I2C Slave API works on nRF52-DK board

I need someone to tell me whether Mbed OS 5 I2C Slave API works on nRF52-DK board. I tried the I2C slave APIs example on the nRF52-DK board, From the Saleae protocol analyzer tool, I see the SDA &SCL waveform from the I2C master (OV580 sensor FW) is correct. But the I2C slave of the nNRF52832 never output the ACK, Both the master and slave are using the 0x20 addrress, and 400000 frequency.

I also have 2 questions:

Before I use the example, Do I need to configure the driver such as: (I assume this configuration to the driver should be done by the OS, is this correct ?) NRF_TWIS0->ADDRESS[0] = 0x20; NRF_TWIS0->ADDRESS[1] = 0x20; NRF_TWIS1->ADDRESS[0] = 0x20; NRF_TWIS1->ADDRESS[1] = 0x20; NRF_TWIS0->CONFIG = 0; NRF_TWIS1->CONFIG = 0; NRF_TWIS0->RXD.MAXCNT = 3; OV580 I2C 2 address bytes, 1 data byte NRF_TWIS1->RXD.MAXCNT = 3; NRF_TWIS0->RXD.PTR = 0x20000000; NRF_TWIS1->RXD.PTR = 0x20000000; NRF_TWIS0->TASKS_PREPARERX = 1; NRF_TWIS1->TASKS_PREPARERX = 1; NRF_TWIS0->ENABLE = 1; NRF_TWIS1->ENABLE = 1;

I also notice the NRF_TWIS0->TASKS_PREPARERX or NRF_TWIS1->TASKS_PREPARERX always retrun 0, Which means I2CSlave module is not ready to receive command from master. Why ? how to make these flag to be 1 ?

Can someone help me.

Best regards

Jason Chang

Be the first to answer this question.

Assigned to Jason Chang 5 years, 6 months ago.

This means that the question has been accepted and is being worked on.