Page 1 of 1

DB2 and DB3 as GPIOs

Posted: Thu Dec 03, 2015 1:12 pm
by mbolivar0
Hello,

I have tried to configure DB2 and DB3 as GPIOs without success. The test program I made is the following:
Code: Select all
static void TogglePort(uint32_t arg, uint8_t repetition)
{
   GPIO_PinOutToggle(TIM2_PORT, TIM2_BIT);
   GPIO_PinOutToggle(DB2_PORT, DB2_BIT);
   GPIO_PinOutToggle(DB3_PORT, DB3_BIT);
}

void TD_USER_Setup(void)
{
   // Initialize DB2 and TIM2 as outputs
   GPIO_PinModeSet(TIM2_PORT, TIM2_BIT, gpioModePushPull, 0);
   GPIO_PinModeSet(DB2_PORT, DB2_BIT, gpioModePushPull, 0);
   GPIO_PinModeSet(DB3_PORT, DB3_BIT, gpioModePushPull, 0);

   // Initialize timer with 500ms interval and infinite repetitions, callback TogglePort, Arg 0
   TD_SCHEDULER_Append(0, 16384, 0, TD_SCHEDULER_INFINITE, TogglePort, 0);
}

When running this program, I can see with the oscilloscope the pulses generated in the TIM2 port but I don't see anything in the DB2 and DB3 port. I tried to run the program with the EFM32 Jlink debugger connected as well as with the debugger disconnected, and the result was the same.

So... Does anyone know what is happening and why this isn't working?

Thanks,

Miguel

Re: DB2 and DB3 as GPIOs

Posted: Thu Dec 03, 2015 1:14 pm
by lcheminade
Hi,

You need to disable the debug functionnality first:

GPIO_DbgSWDIOEnable(false);
GPIO_DbgSWDClkEnable(false);

Regards.

Re: DB2 and DB3 as GPIOs

Posted: Thu Dec 03, 2015 1:46 pm
by mbolivar0
Thanks for the quick reply Icheminade. I will try it and post if I find any problem.

Miguel