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

Programming external nrf51 module using nrf51 DK and mBed (if possible)

Hello all, I already did some research finding similar questions and answers in this board, unfortunately I still do not have answer, maybe some can can help pls?

I have nrf51 DK and using various examples etc, I made small and relatively simple program that takes data by I2C from a device, then using Ble Uart sends data to smartphone that has virtual UART app. I used mBed because it was simple and effective in my case, just write a code and download hex then copy it to board by simple dragging and dropping a file. 

Everything works fine and I like it, now I want to scale everything down to small module and install it into the handheld device. Can you please take a look at questions below:

1. I have this: module EYSGJNZWY by Tao Yuden and based on description it uses nrf51822 and should be possible to program with nrf51 DK, is that correct?

2. It says in the datasheet that it does not have 32Khz external crystal but I am not even sure if it is necessary in my case, I simply poll I2C bus for data and send it out via BLE, do I need to install external 32k crystal or can just enable internal RC for that and if yes, then how do I do that in mBed?

3. Datasheet says that this module has 32Mhz built in crystal, however nrf51 DK uses 16MHz vrystal so all examples are tailored for 16MHz clock speed. There is a sample code in datasheet and mentioning that if you using soft device it will override that. As far as I understand everything you program with mBed is compiled as soft device so I need to find a way around that clock speed difference, how do I do that?

4. how do I upload code to the external module? Accordign to my research SWD is simply 4 pin interface, Vdd, Gnd, and SWDio and SWDclk, is programming it as simple as connecting those 4 pins between nrf51 DK and external module? And then how do I upload the code? with nrf51 DK you simply drag and drop HEX file, but how do I do it with SWD?

5. And lastly, I will be powering external module with clean 3.3V supply so I do not really need to use its built in LDO, as far as I understand that feature is not enabled by default so I do not need to do anything to disable it, etc..?

Any help is welcome, thank you in advance.

Parents
  • Hi,

    1. Yes, the nrF51 DK has a debug out port that can be used to program the nRF51 on the module

    2. The 32 kHz crystal is optional (never required). However you need to make sure that your applications is configured to use the 32 kHz RC oscillator instead. The SDK examples assume that a 32 kHz crystal is present, and will attempt to start it when initializing the SoftDevice, causing the initialization to hang while waiting for the oscillator to start (which it never does).

    3. If a 32 MHz crystal is used, then the clock is simply divided by two. The CPU clock of the nRF51 is always 16 MHz.

    4. Yes, that is correct. You use the Debug out port (either in the far left corner, or the same pins in the row to the right of the current measurement port on the DK. Note that you must ground the GND Detect pin to tell the debugger to use the debug out port instead of programming the local nRF51 chip.

    5. The LDO is used by default. You can enable the optional DC/DC, which can is beneficial when powering with such a high voltage in order to avoid waisting power with the LDO. If the module don't have the optional DC/DC components or you don't care about current consumption, you can leave it as is, using the LDO. The default firmware uses LDO instead of DC/DC.

Reply
  • Hi,

    1. Yes, the nrF51 DK has a debug out port that can be used to program the nRF51 on the module

    2. The 32 kHz crystal is optional (never required). However you need to make sure that your applications is configured to use the 32 kHz RC oscillator instead. The SDK examples assume that a 32 kHz crystal is present, and will attempt to start it when initializing the SoftDevice, causing the initialization to hang while waiting for the oscillator to start (which it never does).

    3. If a 32 MHz crystal is used, then the clock is simply divided by two. The CPU clock of the nRF51 is always 16 MHz.

    4. Yes, that is correct. You use the Debug out port (either in the far left corner, or the same pins in the row to the right of the current measurement port on the DK. Note that you must ground the GND Detect pin to tell the debugger to use the debug out port instead of programming the local nRF51 chip.

    5. The LDO is used by default. You can enable the optional DC/DC, which can is beneficial when powering with such a high voltage in order to avoid waisting power with the LDO. If the module don't have the optional DC/DC components or you don't care about current consumption, you can leave it as is, using the LDO. The default firmware uses LDO instead of DC/DC.

Children
No Data
Related