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

nRF52840 custom hardware Reset using External switch

Hi All,

I have designed one device using nRF52840 MCU and software SDK nRF5_SDK_for_Thread_and_Zigbee_v3.0.0_d310e71.

From Software end all features are implement and are working as expected.

In our custom device we have included RESET feature using External Switch means, whenever the switch is pressed device must reset it like when we press if BOOT/Reset button on Dev-kit.

For this features, we have connected External Switch to P0.25 with pull-up register and connected to RESET circuit in path of P0.18 pin. I am attaching schematic file for reference.

Also, I have checked software in system_nRF52840.c and in Pre-processor definition regarding MACRO "CONFIG_GPIO_AS_PINRESET", attached are screen shot of the same.

I tried to add the MACRO again in preprocessor but still the result same. I am not able to RESET my device using external switch.

1. Screen shots,

2. Schematic file

0160.UP_DI_ZB 755-00-CIR.pdf

Let me if I am doing some thing regarding RESET feature or Is there anything to be added in software or any file to be changed so that I can RESET custom hardware using external switch.

Thanks in advance

Rohit R

Parents
  • Hi Rohit,

    This looks OK from a HW perspective. Pushing S6 will pull P0.18/RESET down to GND, asserting it. And it also looks correct from a SW perspective, with CONFIG_GPIO_AS_PINRESET defined. I think we need to double check a bit.

    For HW, can you check that P0.18 actually becomes 0 V when pressing S6?

    For SW, you can start by checking that the UICR register is actually correctly configured by reading it out with a debugger? You should read out the value of the PSELRESET registers and see that both are 0x00000012 as shown here:

    C:\Users\eith>nrfjprog.exe --memrd 0x10001200
    0x10001200: 00000012                              |....|
    
    C:\Users\eith>nrfjprog.exe --memrd 0x10001204
    0x10001204: 00000012                              |....|

    Is that the case?

    Einar

  • Hi Einar,

    Thank you for the response,

    Okay, I will re-check this.

    For HW, can you check that P0.18 actually becomes 0 V when pressing S6?

    - As shown in the schematic, P0.18, P0.19, P0.21, P0.23, P0.25 are shorted. And there is no way that we can check specifically on P0.18 as IC is soldered. but we have a RST Testpoint in custom board and it goes to low when switch S6 is pressed.

    For SW, you can start by checking that the UICR register is actually correctly configured by reading it out with a debugger?

    - Can you please give me steps on how to check this? Sorry, but the point is not clear on debugger how to check.

    Where I can find this address?

    - And per schematic can I short P0.18 and P0.25 pins and make connection on Dev-kit. Or will it cause any damage to Dev-kit because I have single Dev-kit so.

    - Also, If I just use If BOOT/RESET button from Dev-kit then Dev-kit gets reset properly without any issue.

    But unable to execute same on custom hardware.

    Thanks and Regards

    Rohit R

  • Hi Rohit,

    Rohit Rajapure said:
    - Can you please give me steps on how to check this? Sorry, but the point is not clear on debugger how to check.

    Yes, you can refer to the snippet from my previous post.

    You need to check two registers, PSELRESET[0] which is address 0x10001200 and PSELRESET[0] which is address 0x10001204. That is done using nrfjprog as demonstrated in my initial reply. If both registers are 00000012 (hex) as you see in my example, then the device is correctly configured for pin reset.

    There is one more detail I forgot to mention. After programming and thereby writing to the PSELRESET registers the device needs to be reset once (by power-cycle or debug reset) in order to enable pin reset, as the PSELRESET registers are only read during startup.

    Einar

  • Hi Einar,

    I had gone to this file path,

    C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin

    Unable to open this, If I click on this it disappears fast.

    Not understanding exact procedure.

    There is one more detail I forgot to mention. After programming and thereby writing to the PSELRESET registers the device needs to be reset once (by power-cycle or debug reset) in order to enable pin reset,

    - We tried this but did not work. But we will try this again, program the hardware first power cycle it again and check.

    Thanks and Regards

    Rohit R

Reply
  • Hi Einar,

    I had gone to this file path,

    C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin

    Unable to open this, If I click on this it disappears fast.

    Not understanding exact procedure.

    There is one more detail I forgot to mention. After programming and thereby writing to the PSELRESET registers the device needs to be reset once (by power-cycle or debug reset) in order to enable pin reset,

    - We tried this but did not work. But we will try this again, program the hardware first power cycle it again and check.

    Thanks and Regards

    Rohit R

Children
Related