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

Storing/Sending Array with nRF51/52

Hi,

Please correct me if I'm wrong.

Consider an application that will read 6 bytes of data from I2C at 200Hz (each 5mSec) and will stop after 2000 reads. This will be ~12 KBytes of data.

Option 1: Store all the 12KB data in RAM and after 2000 reads start transmitting. Considering the nrf51 has 32KB version and nrf52 is coming with 64KB, with ~2KB for softdevice and all other program related stuff mentioned in devzone.nordicsemi.com/.../ still 12KB shouldn't cause any problem and should fit. For storing this array of data I just need to define an array and write to it, correct?

Option 2: Store data but at the same time transmit some too (no need to be real time) Assume that I'll just advertise the data, the soft device and the I2C (TWI) interface can work simultaneously without any problem? or they can not operate together?

Any other options?

Thanks!

  • Collecting all data first, then transmitting them, is the simplest option. This should be possible using both nRF51 and nRF52. Note that if you are in a BLE connection you may not be able to get exactly 5 ms between each read, as the SoftDevice will sometimes require the CPU for short periods of time.

    If you must sample data precisely every 5 ms you probably need DMA so that you can do this even if the SoftDevice is using the CPU (typically for some BLE activity). TWI with DMA is not available on the nRF51, but the TWIM peripheral in the nRF52 has EasyDMA. If the timing when reading the from I2C is not critical, then you should be able to do this on the nRF51 as well.

Related