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?
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?
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
}
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?
Do you have the UARTE0 instance enabled in your project? I'm asking because this pin is assigned to the CTS handshake signal by default (Virtual COM port).
This was the problem. I moved the signal to another pin.
Thanks
This was the problem. I moved the signal to another pin.
Thanks