Questions on DA14531 application

I want to make a gadgets based on DA14531,intergrated with external flash , eInk display and some keys.

This is my first time to use these chips/peripheral, mybe missed some restriction,so,welcome any advices.

These are the basic ideas:

1) DA14531 as application MCU & wireless function provider;

2) eInk as displayer;

3) application code stored in external flash(maybe burn into OTP later, up to the FW size);

4) build keyBoard with ADC function;

    This is not confirmed till now.

   I hope I can use keyBoard controller ,GPIO interrupt and ADC together.

   There is a pivotal question: Is interrupt function available when the PIN set as analog input mode?

   I did not find clear info stating this in DA14531 datasheet.

   Extend I/O inputs is needed for the I/O is not so much for DA14531.

5) external flash & eInk share the SPI bus together with different CS pin;

6) RESET assigned with separate pin(defalut pin P0_0);

The SPI bus will be busy during app running,so we can't let RESET share same pin with SPI bus like USB dongle.scsch

7) app will support central and client at the same time;

4 gadgets cooperate together, anyone of them works in central mode,the remainning in client mode;

8) the design based on design of USB dongle,antenna will use design of Dialog;

9) eInk part copied from design of vendor. 

Why can't I upload .sch file? origal .sch file zipped with winrar:da14531.rar

Parents
  • Hi Xiao,

    Thank you for posting your question online and for your interest in our Wireless Solutions.

    1) DA14531 as application MCU & wireless function provider;

    2) eInk as displayer;

    We do not provide any examples or demo with an eInk as a displayer for the DA14531. 
    Please keep in mind that the total FW size should be less 48kB since DA14531 has 48kB of RAM.
    From that, 8KB are reserved for the BLE stack so you are left with close to 40KB for application code and data. From these 40KB not all can be user code, as a part is taken by the SDK, how large this part is depending on what functionalities you choose to include from the SDK. All things considered the space available for SDK + user code is approximately 40KB.
    I am not sure if this eInk module requires any libraries to run on the DA14531 side, but you should check the firmware size. 
    If the firmware size ends up being an issue, you can refer on our: DA14585 - SmartBondTm Bluetooth 5.0 SoC with Audio Interface | Renesas which is supported by the same SDK and double the RAM (96kB) of DA14531.
    You can also refer on our DA14695 - Multi-Core Bluetooth® 5.2 SoC with System Power Management Unit | Renesas which is way more powerful and we provide examples for LCD modules.


    4) build keyBoard with ADC function;

        This is not confirmed till now.

       I hope I can use keyBoard controller ,GPIO interrupt and ADC together.

       There is a pivotal question: Is interrupt function available when the PIN set as analog input mode?

    It depends on what kind of interrupt functionality you are interested in.
    By default, the ADC driver provides the option for ADC interrupt based on the GPIO you have selected for the GPADC:

    /**
     ****************************************************************************************
     * @brief Registers a callback function to be called within ADC_Handler.
     * @note Enables the ADC_IRQn interrupt.
     * @param[in] callback The callback function.
     ****************************************************************************************
     */
    void adc_register_interrupt(adc_interrupt_cb_t callback);
    
    /**
     ****************************************************************************************
     * @brief Unregisters the callback function that was previously registered.
     * @note Disables the ADC_IRQn interrupt.
     ****************************************************************************************
     */
    void adc_unregister_interrupt(void);
    

    However, if you are referring on a scenario where this interrupt will wake-up the system from sleep, that would not be possible.
    All the peripherals are OFF during any sleep mode. So the GPADC should be shut down during sleep. You can explicitly configure the analog GPIO you want on the wake-up controller to wake-up the device from sleep and then re-configure it as a GPADC GPIO.


    7) app will support central and client at the same time;

    4 gadgets cooperate together, anyone of them works in central mode,the remainning in client mode;

    Please refer on our Multirole example: BLE_SDK6_examples/connectivity/multirole at main · dialog-semiconductor/BLE_SDK6_examples (github.com)

    8) the design based on design of USB dongle,antenna will use design of Dialog;

    9) eInk part copied from design of vendor. 

    Regarding the Schematic you shared:
    Please refer on the AN-B-088: DA145xx Flash Selector Guide (renesas.com)

    On your design you have the G25D40ETIG, but on the List of Supported 3rd Part Flash devices is the G25WD40CTIG. Please make sure that the SPI Flash you have selected is the supported one.

    On the P1 (programming) header you should also expose P0_3 or P0_5 for the 1-wire UART programming option.
    In case your device hangs up during Sleep or if you have remapped the SWD GPIOs then you will not be able to access the SPI Flash via SWD interface.
    The P0_3 or P0_5 can be used in the DA14531 SoC (with the P0_0 HW Reset GPIO) for 1-Wire UART Programming.

    Please also refer on the following:
    AN-B-075: DA14530/531 Hardware Guidelines (renesas.com)
    DA14531 Hardware Design Examples — DA14531 Hardware Design Examples (renesas.com)

    You have selected the Buck mode power configuration:

    You do not have the same values for C1 and C2 on your design.

    Please also check on AN-B-075, section 3.2.2 XTAL, 32MHz, page: 21


    By selecting one of the already tested crystals you can accelerate the time of the design.

    P0_1, P0_6 and P0_7 can be used as GPADC GPIOs, so there is no issue.

    Best Regards,
    OV_Renesas

  • Thank you very much 

    All things considered the space available for SDK + user code is approximately 40KB.

    The problem of displayer is their font library,the code size is not big.I think the RAM size limitation is a challenge,I am worried about it from the begining.According to your explaination, the bootROM will load the whole FW from OTP/external Flash once time, not load dynamically(load what needed)?If so, I need to think about how to go around.

    For the cost,I'd rather sacrifice performance for bigger storage space.That is why I chose GD25D40E(512K byte).I thought I can access external flash while app running, the font library and other contents like icons will reside in external flash.

    Actually the communication speed supported by GD25D40 is very fast(80M at least), can we configure the DA14531 running from external flash directly?

    By the way, I need to create second ram alogrithm to burn FW to external flash, maybe there is sample code?(I remeber I have seen some information on this, but can not find them now )

    It depends on what kind of interrupt functionality you are interested in.

    I have to set P0_1 as KeyBoardADC input instead of P0_6 for hibernation mode limits.

    What I hope:

    1) set P0_1 to analog input mode;

    2) enable GPIO interrupt: GPIOx_IRQn(do not know it clearly);

    3) enable ADC function on P0_1;

    4) enable keyboard controller;

    end user press key -> P0_1 level down -> GPIOx_IRQn triggered  -> start ADC -> ADC end -> ADC_IRQn triggered -> get the volatge on P0_1 and execute following process.

    system idle -> enter deep sleep/hibernation -> end user press key -> wakeup from P0_1 interrupt.

    Maybe it is rare to combine AI & GPIO interrupt, I have to poll ADC value periodly if combination is not supported.

    For wakeup, I can do like your said if what I thought is not right.

    Please make sure that the SPI Flash you have selected is the supported one.

    As I mentioned before, I have to create the second ram alogrithm, so that does not matter.(I will develop with external debugger)

    On the P1 (programming) header you should also expose P0_3 or P0_5 for the 1-wire UART programming option.

    I will use only default SWD configure to programme DA14531.

    Keep P0_0 as reset only.

    You do not have the same values for C1 and C2 on your design.

    I copied from USB dongle design, C1 & C2 is not same indeed, if it is better to set them same, I will change it.

    By selecting one of the already tested crystals you can accelerate the time of the design.

    Yes, I will try to find a verified brand.

    Additional question:

    I will use 3.7v lithium battery, it will up to 4.2V at the most, can I connect it to V_HIGH directly? The upper is 3.6V according to datasheet, but I don't believe that Slight smile

    Thanks for help.

  • Hi Xiao,

    Thank you for the reply.

    Xiao said:

    The problem of displayer is their font library,the code size is not big.I think the RAM size limitation is a challenge,I am worried about it from the begining.According to your explaination, the bootROM will load the whole FW from OTP/external Flash once time, not load dynamically(load what needed)?If so, I need to think about how to go around.

    Xiao said:

    Actually the communication speed supported by GD25D40 is very fast(80M at least), can we configure the DA14531 running from external flash directly?

    Regarding the SPI clock speed:
    Please refer on the DA14531 Datasheet, on section 16. SPI Interface:



    Even if the GD25D40 can support up to 80MHz clock speed, the DA14531 will not be possible to support that.

    The DA14531 cannot be configured to run the firmware directly from the external flash.
    Please refer on the DA14531 Datasheet, on section 5.5 BootROM Sequence, page: 67



    As you can see, if you use the OTP or an external flash/eeprom the code will be downloaded into the SRAM.

    Xiao said:

    By the way, I need to create second ram alogrithm to burn FW to external flash, maybe there is sample code?(I remeber I have seen some information on this, but can not find them now )

    Could you please clarify what exactly you are trying to do? Are you referring on the production stage how you could program multiple devices? 
    I do not understand the following statement: "I need to create second ram algorithm to burn FW to external flash". Please provide more information.


    Xiao said:

    What I hope:

    1) set P0_1 to analog input mode;

    2) enable GPIO interrupt: GPIOx_IRQn(do not know it clearly);

    3) enable ADC function on P0_1;

    4) enable keyboard controller;

    end user press key -> P0_1 level down -> GPIOx_IRQn triggered  -> start ADC -> ADC end -> ADC_IRQn triggered -> get the volatge on P0_1 and execute following process.

    system idle -> enter deep sleep/hibernation -> end user press key -> wakeup from P0_1 interrupt.

    1) Set P0_1 as analog input (on user_periph_setup.h/c files)
    2) Use Wake-Up Controller for the GPIO interrupt (P0_1) or generic GPIO Interrupt.
    Note: If you use Extended Sleep mode work with Wake-Up controller, else you can use the GPIO interrupts API
    3) On the Wake-Up controller callback or the GPIO interrupt callback Initialize and Start ADC.
    4) Make sure that Wake-Up controller is set in order to wake-up from Deep or Hibernation sleep mode. 
    Note: Please refer on the prox_reporter example

    This logic can be implemented and it will work as expected.

    Xiao said:

    I will use only default SWD configure to programme DA14531.

    Since you are interested in Deep Sleep and Hibernation sleep modes, you should expose P0_5 or P0_3 as well. If your code crashes inside Deep Sleep or Hibernation, the SWD interface will be disabled. You will not have any other way to retrieve the DA14531 from this state other than UART programming.

    Xiao said:

    I will use 3.7v lithium battery, it will up to 4.2V at the most, can I connect it to V_HIGH directly? The upper is 3.6V according to datasheet, but I don't believe that 

    Unfortunately, you will have to believe that.
    The DA14531 would not be able to handle 4.2V on power supply. The DA14531 was designed to work ideally with coin cells. 
    Since you want to use a lithium battery, you will need to find a voltage regulator for the VBAT.

    Best Regards,
    OV_Renesas

Reply
  • Hi Xiao,

    Thank you for the reply.

    Xiao said:

    The problem of displayer is their font library,the code size is not big.I think the RAM size limitation is a challenge,I am worried about it from the begining.According to your explaination, the bootROM will load the whole FW from OTP/external Flash once time, not load dynamically(load what needed)?If so, I need to think about how to go around.

    Xiao said:

    Actually the communication speed supported by GD25D40 is very fast(80M at least), can we configure the DA14531 running from external flash directly?

    Regarding the SPI clock speed:
    Please refer on the DA14531 Datasheet, on section 16. SPI Interface:



    Even if the GD25D40 can support up to 80MHz clock speed, the DA14531 will not be possible to support that.

    The DA14531 cannot be configured to run the firmware directly from the external flash.
    Please refer on the DA14531 Datasheet, on section 5.5 BootROM Sequence, page: 67



    As you can see, if you use the OTP or an external flash/eeprom the code will be downloaded into the SRAM.

    Xiao said:

    By the way, I need to create second ram alogrithm to burn FW to external flash, maybe there is sample code?(I remeber I have seen some information on this, but can not find them now )

    Could you please clarify what exactly you are trying to do? Are you referring on the production stage how you could program multiple devices? 
    I do not understand the following statement: "I need to create second ram algorithm to burn FW to external flash". Please provide more information.


    Xiao said:

    What I hope:

    1) set P0_1 to analog input mode;

    2) enable GPIO interrupt: GPIOx_IRQn(do not know it clearly);

    3) enable ADC function on P0_1;

    4) enable keyboard controller;

    end user press key -> P0_1 level down -> GPIOx_IRQn triggered  -> start ADC -> ADC end -> ADC_IRQn triggered -> get the volatge on P0_1 and execute following process.

    system idle -> enter deep sleep/hibernation -> end user press key -> wakeup from P0_1 interrupt.

    1) Set P0_1 as analog input (on user_periph_setup.h/c files)
    2) Use Wake-Up Controller for the GPIO interrupt (P0_1) or generic GPIO Interrupt.
    Note: If you use Extended Sleep mode work with Wake-Up controller, else you can use the GPIO interrupts API
    3) On the Wake-Up controller callback or the GPIO interrupt callback Initialize and Start ADC.
    4) Make sure that Wake-Up controller is set in order to wake-up from Deep or Hibernation sleep mode. 
    Note: Please refer on the prox_reporter example

    This logic can be implemented and it will work as expected.

    Xiao said:

    I will use only default SWD configure to programme DA14531.

    Since you are interested in Deep Sleep and Hibernation sleep modes, you should expose P0_5 or P0_3 as well. If your code crashes inside Deep Sleep or Hibernation, the SWD interface will be disabled. You will not have any other way to retrieve the DA14531 from this state other than UART programming.

    Xiao said:

    I will use 3.7v lithium battery, it will up to 4.2V at the most, can I connect it to V_HIGH directly? The upper is 3.6V according to datasheet, but I don't believe that 

    Unfortunately, you will have to believe that.
    The DA14531 would not be able to handle 4.2V on power supply. The DA14531 was designed to work ideally with coin cells. 
    Since you want to use a lithium battery, you will need to find a voltage regulator for the VBAT.

    Best Regards,
    OV_Renesas

Children
  • Thank you for your reply.

    I do not understand the following statement: "I need to create second ram algorithm to burn FW to external flash". Please provide more information.

    Maybe I can't use offical tools since I use custom hardware(but I can use tools related to USART,I think )

    Have found the content: \DA145xx_SDK\6.0.16.1144\utilities\secondary_bootloader.

    I think I have to create a secondary alogrithm to burn FW to external flash for the flash chip changed.

    If your code crashes inside Deep Sleep or Hibernation, the SWD interface will be disabled.

    OK, I will expose it too,that can be used to output debug info anyway.

    But I do not get the reason. The PINs are default,SWD should work if cold start / hardware reset triggered.

    Since you want to use a lithium battery, you will need to find a voltage regulator for the VBAT

    OK, but I am sure DA14531 will work fine without regulator.

    The inductor value placed between VBAT_LOW and LX should be exactly 2.2uH or any bigger one is fine?I'm nervous with inductor, they leave me at a loss in other power source PCB.

    Thanks.