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

interrupt based i2c with softdevice

Hello,

I am using SDK 9.0 and softdevice 8.0 and testing on Evaluation board. I referred the i2c example driver suggested by Torbjorn in this link

I wrote a simple driver for eeprom and succeeded without the softdevice. But when I integrate with the softdevice, data is neither writing nor reading from eeprom. I am not getting i2c interrupts.

Can anyone help me procedure for i2c driver with softdevice?

Update: It is working when I commented the sd_nvic_SetPriority(SPI0_TWI0_IRQn, 1); and enabled using NVIC. I am using template application workspace and integrated i2c driver. But now BT is not advertising. The voltage on the board is 3.3V. Can anyone help me regarding drivers with BT stack?

Regards, Sowmya

Parents
  • Hi. Sorry for the late response. Torbjørn's example is based on an old TWI driver. The use of PPI channels is a legacy from revision 2 of the nRF51 which had a product anomaly causing the TWI to malfunction (the anomaly is documented in PAN V2.3). The workaround was to use PPI channels. To make it even more complicated the TWI and softdevice would sometimes fight over the same PPI channels, and that is why you see specialized softdevice calls in Torbjørn's TWI driver to handle proper delegation of PPI channels.

    Nowadays, however, if you use the latest 3rd revision nRF51, the PAN is fixed and you don't need to use the PPI channels at all. I realize it might be a little late to say now, but in SDK 9 there is a brand new TWI driver and I would highly recommend that you use this driver instead of the old one found in your example.

Reply
  • Hi. Sorry for the late response. Torbjørn's example is based on an old TWI driver. The use of PPI channels is a legacy from revision 2 of the nRF51 which had a product anomaly causing the TWI to malfunction (the anomaly is documented in PAN V2.3). The workaround was to use PPI channels. To make it even more complicated the TWI and softdevice would sometimes fight over the same PPI channels, and that is why you see specialized softdevice calls in Torbjørn's TWI driver to handle proper delegation of PPI channels.

    Nowadays, however, if you use the latest 3rd revision nRF51, the PAN is fixed and you don't need to use the PPI channels at all. I realize it might be a little late to say now, but in SDK 9 there is a brand new TWI driver and I would highly recommend that you use this driver instead of the old one found in your example.

Children
No Data
Related