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

Why pin logic on NRF52-DK is interchanged?

Hi, I develop application on MBED platform with NRF52-DK. I figure out that pin "logic" on this board is interchanged. For example. I have LED connected to some pin. When I set this pin high (set 1) then LED light off and setting this pin low (zero) switch on the LED. Why? How to change such strange situation? Is it bug or standard (intentional) design for this MCU?

Parents
  • Of course it's not a bug, nor does it have anything to do with the MCU nor the GPIO nor is it strange in any way at all nor is the logic on the pin 'interchanged'. Just look at the circuit diagram, the LEDs are connected to VDD via a resistor so pulling the GPIO low lights them. If you read the manual for the DK, which is only a few pages long it states

    The LEDs are active low, meaning that writing a logical zero ('0') to the output pin will illuminate the LED.
    

    Nothing to be 'solved' here.

  • With active low LEDs you are sinking the current, this is generally more recommended than sourcing the current because of more ground pads than vdd pads. Regarding Duty cycle and PWM, you can switch the logic so that with 0 duty cycle the LED will turn off, e.g with the pwm library:

    pwm1_cfg.pin_polarity[1] = APP_PWM_POLARITY_ACTIVE_HIGH;
    
Reply Children
No Data
Related