How to control the GPIO P0.18 to output High and low with nrf52832?

background:

1: my board  is the same with the nRF52832-CIAA Reference Layout 1_0 from nordic docs.

2: the source code is from sample code: blinky_led

3: only change the led0 to led1

#define LED0_NODE DT_ALIAS(led0)
to
#define LED0_NODE DT_ALIAS(led1)

My question is that:

1: seems that the output reg is right (at least the reg value can be change with my control), but  the measured voltage is always 3.3V with multimeter.

2: whether below reg value can show all info about gpio P0.18 ?

the reg value is below when control high.

CNF[18] = 0X00000003

OUT = 0X00040060  // Here changed, bit 18 to 1

IN = 0X002001C0

DIR = 0X00040060

LATVCH = 0X0

DETECTMODE = 0X0

the reg value is below when control LOW.

CNF[18] = 0X00000003

OUT = 0X00000060   // Here changed,bit 18 to 0

IN = 0X002001C0

DIR = 0X00040060

LATVCH = 0X0

DETECTMODE = 0X0

Parents
  • Thanks for your reply.

    1:Sorry, the sample code name should be blinky,the path is ..\ncs\v2.7.0\zephyr\samples\basic\blinky

    2: The HW board is just from nRF52832-CIAA Reference Layout 1_0 from nordic docs. 

    3:  I just simple measure with VICTOR VC890D to mesure the voltage between P0.18 and GND.

    I dont know how to attach files here.

    So you mean all reg(CNF, OUT, IN, DIR, LATCH, DETECTMODE) related are list here. and no error obviously?

  • Hi,

    I see. Using the blinky sample, just changing from #define LED0_NODE DT_ALIAS(led0) to #define LED0_NODE DT_ALIAS(led1) is enough to ue P0.18 instead if you are building for the nRF52 DK as target board.

    Can you show how you build, sot hat I see which board you build for and verifyt hat you have nod modified the board fiels or added an overlay file (so that we know that led1 actually poitns to P0.18)? If that is OK, the next is to look at your hardware. Is there an issu ethere so that the poitn you are measuring on is not actually connected to P0.18?

  • 1: Could you tell me whether can attach files directly here?

    2: I upload some files in my qq zone, could you access these? 

    URL: https://user.qzone.qq.com/403417724/infocenter

    PCB is my self-define board( Just from the official  pcb file of chip package for Altium Designer tool) not  official nRF52 DK board.

    -> sch: my sch picutre

    -> pcb: my board pcb layout picture

    -> reg_P0.18_high is the debug screen-shot when set P0.18 to high in vscode

    -> reg_P0.18_low is the debug screen-shot when set P0.18 to low in vscode

    3: all GPIO are floatting

    4: no overlay files.

    5: prj.conf are below:

    CONFIG_GPIO=y
    CONFIG_SERIAL=y
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    CONFIG_PRINTK=y
Reply
  • 1: Could you tell me whether can attach files directly here?

    2: I upload some files in my qq zone, could you access these? 

    URL: https://user.qzone.qq.com/403417724/infocenter

    PCB is my self-define board( Just from the official  pcb file of chip package for Altium Designer tool) not  official nRF52 DK board.

    -> sch: my sch picutre

    -> pcb: my board pcb layout picture

    -> reg_P0.18_high is the debug screen-shot when set P0.18 to high in vscode

    -> reg_P0.18_low is the debug screen-shot when set P0.18 to low in vscode

    3: all GPIO are floatting

    4: no overlay files.

    5: prj.conf are below:

    CONFIG_GPIO=y
    CONFIG_SERIAL=y
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    CONFIG_PRINTK=y
Children
Related