定时器的Prescaler 与 Period的理解

STM8的内部时钟为16M,假如128分频(Prescaler)时钟给Timer,那么Timer的时钟为16M / 128 = 0.152M

1 / 0.125M = 8us 计一次数8us

Period设置为12500,那么12500 * 8us = 100ms

所以定时器会在100ms后产生中断

posted @ 2020-03-31 16:05  lin辰  阅读(5791)  评论(0编辑  收藏  举报