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

Need guidance on code modifiaction based on SDK

My customer is modifying the code based on the example provided in the SDK 15.0.0 to suit their project: 

Project file from the SDK under \nRF5_SDK_15.0.0_a53641a\examples\ble_peripheral\ble_app_uart\pca10040\s132\ses

The questions are:

1. how to change pin assignment, for example TX, RX from 6 & 8 to 21 & 22

2. Reduce current consumption from the sample software, original 2.5mA down to 100uA

  2.1 at the same time when receive duty cycle of the receiver reduced, how to change the sending pattern of transmiter

3. how to run 2 profile concurrently, example: combine UART and proximity software together.

Thanks!

Parents
  • Hi,

    1. By default the UART TX and RX pins are defined in the file called sdk_config.h.

    2. The UART can be used in legacy mode or in EasyDMA mode. In legacy mode the UART will have an internal 6 byte FIFO, which need to be off-loaded by an interrupt and the UART will require a HF clock while waiting for data in RX mode. The current consumption depends on supply voltage and if you have enabled DCDC, but typically less than 1mA. In EasyDMA mode the UART will require a direct access to the RAM and the current consumption will typically be about 2mA, because more digital domains in the chip needs to be powered. There is no real time requirements to off-load data by an interrupt, since data is written to RAM directly.

      By default the ble_app_uart example uses EasyDMA and that is why they are measuring ~2.5 mA. You can turn off EasyDMA in the file called sdk_config.h, but the example is still leaving the HF clock running and this draws ~470 uA. The clock is necessary to receive data. To turn it off you need to disable the UART.

      To change advertising intervals you can modify APP_ADV_INTERVAL in main.c. To change the connection intervals you can modify MIN_CONN_INTERVAL and MAX_CONN_INTERVAL in main.c.

    3. Then I would start with the proximity example and import the files ble_nus.c and ble_nus.h. Then look at the ble_app_uart example to see how to implement it it in your code.

     

Reply
  • Hi,

    1. By default the UART TX and RX pins are defined in the file called sdk_config.h.

    2. The UART can be used in legacy mode or in EasyDMA mode. In legacy mode the UART will have an internal 6 byte FIFO, which need to be off-loaded by an interrupt and the UART will require a HF clock while waiting for data in RX mode. The current consumption depends on supply voltage and if you have enabled DCDC, but typically less than 1mA. In EasyDMA mode the UART will require a direct access to the RAM and the current consumption will typically be about 2mA, because more digital domains in the chip needs to be powered. There is no real time requirements to off-load data by an interrupt, since data is written to RAM directly.

      By default the ble_app_uart example uses EasyDMA and that is why they are measuring ~2.5 mA. You can turn off EasyDMA in the file called sdk_config.h, but the example is still leaving the HF clock running and this draws ~470 uA. The clock is necessary to receive data. To turn it off you need to disable the UART.

      To change advertising intervals you can modify APP_ADV_INTERVAL in main.c. To change the connection intervals you can modify MIN_CONN_INTERVAL and MAX_CONN_INTERVAL in main.c.

    3. Then I would start with the proximity example and import the files ble_nus.c and ble_nus.h. Then look at the ble_app_uart example to see how to implement it it in your code.

     

Children
No Data
Related