EasyManua.ls Logo

STMicroelectronics STM8 - Page 33

STMicroelectronics STM8
126 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
CLK_CCOConfig(CLK_OUTPUT_CPU);
CLK_CCOCmd(ENABLE);
while(CLK_GetFlagStatus(CLK_FLAG_CCORDY) == FALSE);
}
void GPIO_setup(void)
{
GPIO_DeInit(LED_port);
GPIO_Init(LED_port, LED_pin, GPIO_MODE_OUT_OD_HIZ_FAST);
}
Explanation
The full explanation of this code is given in the last segment of this article. The only thing I’ll describe
here is this part:
CLK_CCOConfig(CLK_OUTPUT_CPU);
CLK_CCOCmd(ENABLE);
while(CLK_GetFlagStatus(CLK_FLAG_CCORDY) == FALSE);
These lines select the clock source that the CCO pin will output, enable the CCO module and wait for
it to stabilize. Here I selected the CCO to output CPU clock.
Demo
Video link: https://www.youtube.com/watch?v=IeLUc_s3jBE

Related product manuals