sorry if i return on the same question, but after some time i can look where is the problem.
my system is composed as stm32f103re board 72Mhz, chibios 3.0.4, ugfx
I not understand where is my fault, i've done some test but the frequency i set, is never respected
Code: Select all
static GPTConfig gptcfg2 =
{
20000, // frequency
gptcallback2, // callback
0,
0
};
static void gptcallback2(GPTDriver *gptp)
{
(void) gptp;
palTogglePad(PORT_LED1, GPIOC_LED1);
}
void main()
{
halInit();
chSysInit();
gptStart(&GPTD8, &gptcfg2);
gptStartContinuous(&GPTD8, 0);
while (TRUE)
{
chThdSleepMilliseconds(200);
}
}
-----
mcuconf
#define STM32_NO_INIT FALSE
#define STM32_HSI_ENABLED TRUE
#define STM32_LSI_ENABLED FALSE
#define STM32_HSE_ENABLED TRUE
#define STM32_LSE_ENABLED FALSE
#define STM32_SW STM32_SW_PLL
#define STM32_PLLSRC STM32_PLLSRC_HSE
#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1
#define STM32_PLLMUL_VALUE 9
#define STM32_HPRE STM32_HPRE_DIV1
#define STM32_PPRE1 STM32_PPRE1_DIV2
#define STM32_PPRE2 STM32_PPRE2_DIV2
#define STM32_ADCPRE STM32_ADCPRE_DIV4
#define STM32_USB_CLOCK_REQUIRED TRUE
#define STM32_USBPRE STM32_USBPRE_DIV1P5
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
#define STM32_RTCSEL STM32_RTCSEL_HSEDIV
#define STM32_PVD_ENABLE FALSE
#define STM32_PLS STM32_PLS_LEV0
with this configuration the led toggle every 3/4 secs!
if i look documentation i see the frequency must be in Hz
what means 'not necessarily any frequency can be specified in that field.' ?