beautypg.com

2 – clock selection, 3 – timer clock prescaler, Clock selection – Maxim Integrated DS4830 Optical Microcontroller User Manual

Page 136: Timer clock prescaler

background image

DS4830 User’s Guide

136

In compare mode, the timer module begins counting from 0x0000 and when the value in the GTV register matches the
value in the General Timer Compare Register (GTC), the GTIF interrupt flag

is set to ‘1 ‘ which generates an interrupt if

enabled. When the match occurs, the timer reloads the GTV register with 0x0000 at the next timer clock.

16.1.2

– Clock Selection

There are three timer clock sources available in each timer module, core clock, peripheral clock and external clock. The
peripheral clock is twice the core clock. The external clock can be between 20MHz to 133MHz. The timer clock source
can be selected using CLK_SEL [1:0] bits in the GTCN register.

16.1.3

– Timer Clock Prescaler

Each timer has 6 different prescalers. The prescaler is selected by appropriately setting the GTPS [2:0] bits in the GTCN
register. The prescaler divides the selected input clock by a value from 1 to 1024.