Using P0.07 as GPIO, not TRACECLK (nRF52840-QFAA-F-7)

Hi,

I am trying to use P0.07 as GPIO (output), for driving a LED. However I cannot see the LED driven. I suspect that this pin is used as TRACECLK. How to be sure (how to configure) this pin to be GPIO for sure?

Parents
  • You can check it with debug or in the code; default value is 0 which is io pin:

        // TRACE pins can be used as GPIOs or Trace, special case - Debug Exception and Monitor Control Register
        if ( (CoreDebug->DEMCR & CoreDebug_DEMCR_TRCENA_Msk) == CoreDebug_DEMCR_TRCENA_Msk )
        {
            // Debug pin, not io pin
        }

    APP-07.pdf

  • Thanks,

    Using above if, it was seen that the pin P0.07 is not in debug mode. Some else is the problem. The LED is connected to VDD_nRF and P0.07 and when set P0.07 to 0 LED should light, but it does not light. Instead a voltage about 2.2V is seen at P0.07.

    However I found another register, TRACECONFIG which have TRACEMUX field. After reset it is 0, which means GPIO, and no trace signals are routed. I searched how to access TRACECONFIG register, but did not found it defined. How to access it to see what is its value?

Reply
  • Thanks,

    Using above if, it was seen that the pin P0.07 is not in debug mode. Some else is the problem. The LED is connected to VDD_nRF and P0.07 and when set P0.07 to 0 LED should light, but it does not light. Instead a voltage about 2.2V is seen at P0.07.

    However I found another register, TRACECONFIG which have TRACEMUX field. After reset it is 0, which means GPIO, and no trace signals are routed. I searched how to access TRACECONFIG register, but did not found it defined. How to access it to see what is its value?

Children
Related