Questions and discussions about the software that runs on the TD RF module itself.
mbolivar0
 
Posts: 18
Joined: Tue Oct 20, 2015 11:58 pm

DB2 and DB3 as GPIOs

by mbolivar0 Thu Dec 03, 2015 1:12 pm

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
User avatar
lcheminade
 
Posts: 146
Joined: Mon May 11, 2015 7:47 am

Re: DB2 and DB3 as GPIOs

by lcheminade Thu Dec 03, 2015 1:14 pm

Hi,

You need to disable the debug functionnality first:

GPIO_DbgSWDIOEnable(false);
GPIO_DbgSWDClkEnable(false);

Regards.
mbolivar0
 
Posts: 18
Joined: Tue Oct 20, 2015 11:58 pm

Re: DB2 and DB3 as GPIOs

by mbolivar0 Thu Dec 03, 2015 1:46 pm

Thanks for the quick reply Icheminade. I will try it and post if I find any problem.

Miguel
Return to Firmware

Who is online

Users browsing this forum: No registered users and 29 guests