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

NRF51822 Audio Application & Compression

Hello,

I am working on an application that involves sampling audio data ~8KHz. I have a few questions

  1. The real time clock module has a maximum interrupt frequency of 32768/5 = 6554 Hz. Is there another mechanism to achieve a slightly greater interrupt frequency ~8KHz using the RTC? Or will I need to move to the Timer/Counter. Does nordic provide support for the Timer peripheral like it does for the RTC?

  2. Considering the BLE throughput limitation of the Iphone 5s = 4KB/s I will need to compress the audio data before transmission. Is nordic aware of any codec that works well on the Cortex M0 core of the NRF51822?

Lucas

Parents
  • Hi Lucas

    Is the RTC interrupt handler limited to 32768/5 Hz? I haven't heard of that before. The interrupt handler is executed perhaps 3-5 microseconds after the RTC event is triggered and will perhaps take a few microseconds to execute, given your code in the handler is relatively short, so there should be plenty of CPU time available for the RTC interrupt handler to execute with 8kHz frequency or even up to 32kHz frequency.

    Is perhaps something else in your code that is using CPU time, thereby limiting the CPU time left for the RTC interrupt handler. Is your code execution in the RTC interrupt handler perhaps taking a long time to execute, thereby limiting the sampling frequency. Also, if you have softdevice enabled it will limit your sampling rate since the CPU is blocked for 1ms-6ms during a BLE radio event.

  • There are two clock sources in the system, low frequency 32kHz clock and high frequency 16MHz clock. You can see in table 28 in the nRF51822 PS v2.0 what clock source each peripheral requires. For both high and low frequency clocks you can select either internal RC oscillator or external crystal. High frequency external crystal is mandatory for any radio communication, Low frequency external crystal is optional but is the best choise for low power application. You have to enable the low frequency clock explicitly and specify if you wish to use internal RC or external crystal as the low frequency clock source. If you do not explicitly enable a high frequency clock, the internal RC is automatically enabled when any peripherals require a 16MHz clock, and it is disabled again when no peripheral require it. You must however explicitly enable the 16MHz external crystal clock source

Reply
  • There are two clock sources in the system, low frequency 32kHz clock and high frequency 16MHz clock. You can see in table 28 in the nRF51822 PS v2.0 what clock source each peripheral requires. For both high and low frequency clocks you can select either internal RC oscillator or external crystal. High frequency external crystal is mandatory for any radio communication, Low frequency external crystal is optional but is the best choise for low power application. You have to enable the low frequency clock explicitly and specify if you wish to use internal RC or external crystal as the low frequency clock source. If you do not explicitly enable a high frequency clock, the internal RC is automatically enabled when any peripherals require a 16MHz clock, and it is disabled again when no peripheral require it. You must however explicitly enable the 16MHz external crystal clock source

Children
No Data
Related