Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

nRF52820 Memory -> Capabilities, Chances?

Hello all,

would somebody please help to understand how much memory may be needed to use:

- BLE with mesh

- TWI to read the value from the sensor

- one PWM output on two GPIOs

- one timer

As far as I understand is that on board  (peripherals) PWM and TIMER (max timer count needed is 2 seconds) which nRF52820 has, there should not be much memory needed, while the BLE with mesh needs around 17KB the full stack, but not really sure how much memory does the TWI need to read from one sensor via the pooling.

I guess all the onboard peripherals do not require much of ram. For example, nRF52820 has 32KB ram and 256KB of flash, that should be enough to build a simple mesh to connect among several devices (12), while the app to turn on and dim the LED on two GPIOs while reading the sensor should as well be enough, right? For example, I remember doing similar the app, but without a BLE on at tiny with 4KB, so, wondering why would that may be a problem on nRF52820? 

Best.  

Parents
  • Hello AHaug and thank you for your reply, it helps!

    Sorry, but I have not been clear enough, I am working on a PAN1781, which is based on nRF52820, however, it is given the pan manuals of the module that there is a PWM peripheral (https://mediap.industry.panasonic.eu/assets/custom-upload/Devices/Wireless%20Connectivity/Bluetooth%20Low%20Energy%20Modules/PAN1781/WM%20PAN1781%20Product%20Specification.pdf) , for example, see p. 12, a bit confusing, probably we are talking about different nRF?

    Would you please be so kind and comment, if the Timer and PWM are available as peripherals on this module as it is stated :) and if it may be possible to use the above mentioned software within the allotted memory, namely ram and flash of PAN1781?

    Best.

  • Hi,

    Glad to hear that we're on the right path to answering your question! 


    Thank you for adding this information! Based on reading the supplied link I see that they mention that there is 4x PWM timers, but the block diagram on page 9 illustrates 0xPWM peripherals as according to our documentation on the nRF52820 SoC. This leads me to believe that the PAN1781 datasheet either contains an error with regards to stating that the module has PWM or that the Panasonic module has an additional external module that has PWM peripherals (which I can't find any evidence of in the datasheet). Unfortunately you will have to verify if this is the case or not with Panasonic. Errors such as these are not uncommon in datasheets as a lot of modules/devices shares some of the documentation base with each other and copy/paste errors does happen sometimes... 

    As for if this module has enough RAM and flash, the same sentiment mentioned for the nRF52820 SoC  in my previous reply also holds for the PAN1781 as they both have the same memory specs.

    I will also mention that a colleague of mine said that it is possible to create your own software based PWM in nRF5 with the PWM library, RTC and PPI. There are however some drawbacks such as the speed of the peripheral if implemented in this fashion. How to do this will have to be asked in a separate ticket as this is a new topic not quite related to the topic in this ticket. Please not that this will add additional load on the restricted memory capabilities of the device as you will have to include more software in your application to make this work. I can't say how much it will add without seeing the finished code.

    Let me know if you are able to confirm/deny if there is an error in the documentation with producer of the module before we move on! :) 

    Kind regards,
    Andreas

Reply
  • Hi,

    Glad to hear that we're on the right path to answering your question! 


    Thank you for adding this information! Based on reading the supplied link I see that they mention that there is 4x PWM timers, but the block diagram on page 9 illustrates 0xPWM peripherals as according to our documentation on the nRF52820 SoC. This leads me to believe that the PAN1781 datasheet either contains an error with regards to stating that the module has PWM or that the Panasonic module has an additional external module that has PWM peripherals (which I can't find any evidence of in the datasheet). Unfortunately you will have to verify if this is the case or not with Panasonic. Errors such as these are not uncommon in datasheets as a lot of modules/devices shares some of the documentation base with each other and copy/paste errors does happen sometimes... 

    As for if this module has enough RAM and flash, the same sentiment mentioned for the nRF52820 SoC  in my previous reply also holds for the PAN1781 as they both have the same memory specs.

    I will also mention that a colleague of mine said that it is possible to create your own software based PWM in nRF5 with the PWM library, RTC and PPI. There are however some drawbacks such as the speed of the peripheral if implemented in this fashion. How to do this will have to be asked in a separate ticket as this is a new topic not quite related to the topic in this ticket. Please not that this will add additional load on the restricted memory capabilities of the device as you will have to include more software in your application to make this work. I can't say how much it will add without seeing the finished code.

    Let me know if you are able to confirm/deny if there is an error in the documentation with producer of the module before we move on! :) 

    Kind regards,
    Andreas

Children
  • Hello AHaug

    Till we get a newer version, which will be build on the nRF52833, I guess we should be safe in terms of memory to implement the BLE Mesh and toggling a GPIO on the nRF52820? 

    Please tell me we are safe with this, till the new version arrives Slight smile

    Thank you and all the best.

  • Hi,

    You will be fine to start implementing BLE Mesh and the GPIO features on the nRF52820 but due to the flash and RAM limitations on the device it is not recommended to use the 52820 as a Mesh device for development/production. Also note that the 52820 has "limited compatibility and support for Mesh" under "compatibility" for nRF5 SDK for Mesh on our documentation pages.

    The 52833 that you mention will on the other hand be a great device that has full Mesh support in nRF5 SDK for Mesh and which will have the peripherals you mentioned as well as having sufficiently large enough flash and RAM.

    To summarize the issues of the requirements of the project you're working on with the nRF52820:

    • The nRF52820 does not have a native PWM peripheral that you have required
    • The Mesh stack will consume 17KB of RAM + the BLE stack will use around 4KB more leaving you with ~11KB of RAM for the rest of the application out of the 32KB in total
    • Depending on the size of your total application in flash size you might not have sufficient space for your application. A typical Mesh sample we have in the SDK uses up to over half of the available flash on a nRF52820.
    • Depending on the size of your total application in flash size, that you might have insufficient space for implementing DFU without using external flash in case you would want to add DFU support for your application.

    I hope this information helps with answering your question, and please feel free to ask additional questions related to this topic if if you have any!

    Kind regards,
    Andreas

Related