AnsweredAssumed Answered

GPIO problem

Question asked by petrd on Aug 30, 2010
Latest reply on Aug 31, 2010 by lowpowermcu
Hello! I have STM8S-Discovery, STVD+Cosmic_32K. I write:
 #include "stm8s.h"
main()
{
 GPIO_DeInit(GPIOD);
 GPIO_Init(GPIOD, GPIO_PIN_0, GPIO_MODE_OUT_PP_LOW_FAST);
 TIM3_DeInit();
 TIM3_TimeBaseInit(TIM3_PRESCALER_2, 999);
TIM3_Cmd(ENABLE);
for(;;)
 {
if (TIM3_GetCounter() < 500) {
GPIO_WriteLow(GPIOD, GPIO_PIN_0);
 }
else {
GPIO_WriteHigh(GPIOD, GPIO_PIN_0);
}
}
}
All is normal, the light-emitting diode is shone, since the period of repetition 1 кHz, but the problem what when I look an oscillograph on PD0 at that time when there should be a low level in its middle periodically appears a positive impulse??? Why?? Thanks! 

Outcomes