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

nRF51822 controller connection through UART/SWD.

I need to program the nrf51 controller directly from PC. How to connect nRF51822 controller from PC through UART/SWD pins to program.

  • My DK has both VDD and VTG pins. Which is the correct one to use?

  • Hi,

     

    VTG is the input of the debugger, that is to be connected to VDD on the debug target. If the target is supplied and powered by its own supply/battery/etc. then this will work, if not then you can connect VDD (on the DK) to VTG (and by extension VDD on the target) to power the target. See as an example the wiring in this case.

    Note that you might want to cut SB9 to not power the nRF51 on the DK itself. This can be reverted by shorting SB9, or plugging a jumper across P22:

    Best regards,
    Andreas

  • Thanks for that information. I do not know if the target is self powered when trying to flash new code. I am asking the company, but I do not believe it is. Pressing the power button triggers all kinds of sensor activity that I have no control over and has nothing to do with the BT module. So I am pretty sure I have to power the target from the DK. I assumed that I would have to wire the VDD of the DK to VDD of the target to do that. If self powered, I would use VTG of the DK to VDD of the target. But I guess it is slightly more complicated than that.

  • Hi,

     

    OK, sounds like it should be fine. If the target is powered it should be fine to power it using the DK, if 1.8V it will be out of range for the debugger on the DK anyway.

     

    Best regards,
    Andreas

  • It turns out I can get power from the batteries on the production device. So I have used the VTG pin on P20 to connect to the VDD 'pin' on the production device. The DK user's guide mentions that P20 is for 'shield targets' but I am not sure what that means.  

    I also have limited equipment and tools to make the solder connections on the target board. They look okay but its hard to tell.

    So now I run the Kiel IDE with the project and plug the USB cable into the DK. Yellow led comes on. I start the Start/Stop debug session on the Keil IDE and get the error 'no Cortex-M device found ...'. Now this project was provided by the developer of the production device so I figure I am using the DK wrong or have not done a solid job of soldering.

Related