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
  • Hi,

    2: the source code is from sample code: blinky_led

    I am unable to find this sample. Can you specify which SDK version you are using and the path to the sample?

    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.

    If the pin is configured as an output and the output register indicate it is high, that should be reflected on the pin. How are you measuring it? Could there be an issue on the HW? Can you share details on your HW and how you measure?

Reply
  • Hi,

    2: the source code is from sample code: blinky_led

    I am unable to find this sample. Can you specify which SDK version you are using and the path to the sample?

    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.

    If the pin is configured as an output and the output register indicate it is high, that should be reflected on the pin. How are you measuring it? Could there be an issue on the HW? Can you share details on your HW and how you measure?

Children
No Data
Related