cancel
Showing results for 
Search instead for 
Did you mean: 

spike on a GPIO pin on power ON

yafisdamda
Associate II
Posted on November 11, 2015 at 08:35

Hi STM32 forum.

I am working on a custom board with STM32F030 controller on it. In my setup the GPIOs are connected to triac ICs which drive the external load(bulbs). The GPIOs init is as given below:

GPIO_InitTypeDef GPIO_InitStructure;

 

 

 

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;

 

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;

 

GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

 

GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ;

 

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_Level_1;

 

GPIO_Init(GPIOB, &GPIO_InitStructure);

 

I am observing an initial spike(on scope) of about 1.5ms on power ON, on the GPIO pin that is connected to one of the triac due to which there is a flicker in the load(bulb). I am not sure what is creating the problem. Any help/suggestions will be very helpful.

Thanks..!!

#stm32-gpio
12 REPLIES 12
yafisdamda
Associate II
Posted on November 12, 2015 at 11:41

No, I tried writing the output data register it is still the same.

AvaTar
Lead
Posted on November 12, 2015 at 11:49

>Yes, the spikes appear between power On and GPIO_Init().

 

That suggests you can't do much with software, except initialising the GPIO pin quickly, to make the spike as short as possible. The most time before entering main() is usually spent in SystemInit(), especially while waiting for the clock/PLL to stabilize. This would shorten the spike to perhaps a few microseconds.

But ''bleeding off'' this capacitor charge by hardware would IMHO be the better solution.

yafisdamda
Associate II
Posted on November 12, 2015 at 12:02

Thank you so much for the suggestions.

I will definitely pass it on to my hardware engineer.