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

PPI with I2C

Hello,

I use the interface I2C to communicate to the Light Sensor, and also use a timer to read the value back every 1 sec now.

I'm wondering that can I use the interface PPI to capture the data and put them in a buffer until other channel timeout, then trigger the event to print it out via the interface UART. What I prefer is not to involve CPU in the process, in order to save more power.


Timer1 --> PPI channel0 --> (trigger) get sensor data --> save data in a buffer

Timer2 --> PPI channel1 --> (trigger) stop Timer1 and trigger "PrintData_Function()"

(Main Function) PrintData_Function()


If it is possible to achieve this goal? Please kindly give me some advice, thanks.

Best regards

Parents
  • The nRF52 has TWI master (and slave) with Easy DMA, and should allow you to do what you have described without using the CPU (you would probably want to use RTC1 instead of timer 1 in order to save power).

    Unfortunately the nRF51 does not have DMA for TWI, so you will have to use the CPU. The TWI peripheral is single buffered so you will have to read every byte before a new byte can be received.

Reply
  • The nRF52 has TWI master (and slave) with Easy DMA, and should allow you to do what you have described without using the CPU (you would probably want to use RTC1 instead of timer 1 in order to save power).

    Unfortunately the nRF51 does not have DMA for TWI, so you will have to use the CPU. The TWI peripheral is single buffered so you will have to read every byte before a new byte can be received.

Children
Related