This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I2C/TWI slave with nRF51822

Hi

I need to implement I2C slave side (up to 100kBit/s) on a nRF51822 chip. As far as i see the inegrated TWI peripherial only supportes the master side. Any ideas how to do it? The following ways came to my mind, but all seam not the way to go.

Software I2C There are some code segments around to implement a software I2C solution by bitbanging. These solutions often are unstable and probably not fast enough to reach 100kBit/s. Additionally it may be a problem to run it beside the active S110 softdevice, because the softdevice may block the CPU in low stack for multiple milliseconds.

External Peripherial Another possible way is to use an external chip to do the I2C, but to be honest i didn't find a simple solution there. The only way to do it this way is the connect a PIC or something similar to the Nordic and implement the I2C on the PIC. The Nordic could communicate with the PIC over UART or SPI. Are the fix programmed chips that can be used as external peripherial?

Any other thought about this?

Regards Adrian

Parents
  • Yesterday I set up nRF51822 Evaluation Board to become I2C-master and to connect to some I2C-devices, and it seems to work. I just needed four wires from the board's pins to connect to I2C devices (GND, Vcc, SCL and SDA). The code I used was from Nordic's example, twi_hw_master.c or something like that.

    However, we would also need to have I2C-slave there because the system connects to another system as a slave while being master for the another part. I am thinking if SPI-slave could somehow be tricked to become I2C-slave, or would there be any efficient way to do it in software (interrupts?).

    The bridge chip I mentioned is one possible solution, but not an optimal one.

Reply
  • Yesterday I set up nRF51822 Evaluation Board to become I2C-master and to connect to some I2C-devices, and it seems to work. I just needed four wires from the board's pins to connect to I2C devices (GND, Vcc, SCL and SDA). The code I used was from Nordic's example, twi_hw_master.c or something like that.

    However, we would also need to have I2C-slave there because the system connects to another system as a slave while being master for the another part. I am thinking if SPI-slave could somehow be tricked to become I2C-slave, or would there be any efficient way to do it in software (interrupts?).

    The bridge chip I mentioned is one possible solution, but not an optimal one.

Children
No Data
Related