This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

TWI with S110 softdevice Enabled

Hello Everyone

I want to implement TWI interface in my project.Presently I am using Keil UV5 IDE, PCA10028 Development board and s110 7.1.0 softdevice, along with that PWM , UART and ADC peripherals are being used. I search for some of the question related to TWI in this forum and i have got confused.

  1. Can i use twi with softdevice S110 enabled without any problem?

2 .Is there any example code for TWI with softdevice enabled? i have found three driver files on three different links twi_hw_master.c in Nordic Examples On some post it was sd_twi_hw_master.c and one hal_twi.c devzone.nordicsemi.com/.../ on this link

so which one should i use.

Thanks & Regards Asma

Parents
  • Hi

    The sd_twi_hw_master.c and hal_twi.c should both work with the SoftDevice.

    To elaborate a bit:

    In the early revisions of the nRF51822 the TWI circuitry didn't function properly and a software workaround was made called twi_sw_master.c. In the later revisions the hardware TWI works as intended, but if you are using a softdevice and the twi_hw_master.c the SD and TWI will get assigned the same PPI channel and the TWI will fail. Therefore you will have to use the sd_twi_hw_master.c to get the TWI working properly with the SD. Finally, the hal_twi.c was originally written to be used with the nRFready Smart Remote 2 and is not tested with anything else than the smart remote.

    Martin

Reply
  • Hi

    The sd_twi_hw_master.c and hal_twi.c should both work with the SoftDevice.

    To elaborate a bit:

    In the early revisions of the nRF51822 the TWI circuitry didn't function properly and a software workaround was made called twi_sw_master.c. In the later revisions the hardware TWI works as intended, but if you are using a softdevice and the twi_hw_master.c the SD and TWI will get assigned the same PPI channel and the TWI will fail. Therefore you will have to use the sd_twi_hw_master.c to get the TWI working properly with the SD. Finally, the hal_twi.c was originally written to be used with the nRFready Smart Remote 2 and is not tested with anything else than the smart remote.

    Martin

Children
No Data
Related