AnsweredAssumed Answered

Using COSMIC C - trying to understand Clock setting

Question asked by MHz on Aug 29, 2014
Hello there, I am playing with my STM8s Discovery board but unable to set the clock properly. Can someone please put some light on what I am doing wrong. My code is as follows:

#include "stm8s.h"
u16 c=9000;

               void CLK_Deinit();
               void CLK_HSICmd(ENABLE);
               void CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV8);
               void CLK_SYSCLKConfig(CLK_PRESCALER_CPUDIV128);
               GPIO_DeInit (GPIOD);
//               TIM2_DeInit();
//               TIM2_TimeBaseInit(TIM2_PRESCALER_2048, 300);
//               TIM2_Cmd(ENABLE);
               while (1){
/*                         if (TIM2_GetCounter()>150){
                         else {
                    while (c>1){

My LED blinks at the same rate even when I change the HSI prescaler and/or sys clock config. Thanks