Are there any I2C examples for the nRF51822? If not, can anyone suggest a good starting point for I2C? I am using Keil uVision 4 for development.
Are there any I2C examples for the nRF51822? If not, can anyone suggest a good starting point for I2C? I am using Keil uVision 4 for development.
nRF51822 I2C example is twi_sw_master_example. I2C also know as two wire interface(TWI). You can check nRF51 SDK documentation for nRF51822 TWI limitation like it only able to use in Master mode.
In addition to the twi_sw_master_example there is also a twi_hw_master_example, that uses the hardware TWI module instead of a bit-banged implementation.
Sam is however correct that the nRF51822 can only be an TWI master, not slave.
What would be instances where the software implementation is preferable, Ole? Would it generally be when you wanted to deal with slight variances in the protocol?
-m
It was originally written for a very early chip revision in which the hardware was buggy, but now there isn't really any reason to use it anymore. It's still included mostly since it has been written anyway.
To clean things up, I'd be happy if you could evaluate the answer you have received and accept it if you feel it's sufficient. If not, it might be useful to expand your question a little and provide further information.