English
Language : 

EM6682 Datasheet, PDF (13/61 Pages) EM Microelectronic - MARIN SA – Ultra Low Power 8-pin Microcontroller
R
EM6682
5.3 Prescaler
The prescaler consists of a fifteen elements divider chain which delivers clock signals for the peripheral circuits such as
timer/counter, debouncer and edge detectors, as well as generating prescaler interrupts. The input to the prescaler is the
system clock signal closest to 32 kHz or 50 kHz which comes from the RC oscillator or external clock as divided by the
preceding divider. Power on initializes the prescaler to Hex(0001).
Table 5.3.1 Prescaler Clock Name Definition
Function
Name
32 KHz
SysClk
System clock
Ck[16] 32768 Hz
System clock / 2
Ck[15] 16384 Hz
System clock / 4
Ck[14] 8192 Hz
System clock / 8
Ck[13] 4096 Hz
System clock/ 16 Ck[12] 2048 Hz
System clock / 32 Ck[11] 1024 Hz
System clock / 64 Ck[10] 512 Hz
System clock / 128 ck [9]
256 Hz
50 KHz
SysClk
50000 Hz
25000 Hz
12500 Hz
6250 Hz
3125 Hz
1562 Hz
781 Hz
390 Hz
Function
System clock / 256
System clock / 512
System clock / 1024
System clock / 2048
System clock / 4096
System clock / 8192
System clock / 16384
System clock / 32768
Name
Ck[8]
Ck[7]
Ck[6]
Ck[5]
Ck[4]
Ck[3]
Ck[2]
Ck[1]
32 KHz
SysClk
128 Hz
64 Hz
32 Hz
16 Hz
8 Hz
4 Hz
2 Hz
1 Hz
50 KHz
SysClk
195 Hz
97 Hz
49 Hz
24 Hz
12 Hz
6 Hz
3 Hz
1.5 Hz
Figure 9. Prescaler Frequency Timing
Prescaler Reset
SysClk = System clock Ck[16]
Ck[15]
Ck[14]
Ck[13]
Ck[2]
Ck[1]
Horizontal Scale change
First positive edge of 1 Hz clock Ck[1] is 1 sec after the falling reset edge
Table 5.3.2 Control of Prescaler Register RegPresc
Bit
Name
3 ExtCPUclkON
2 ResPresc
1 PrIntSel
0 DebSel
Reset R/W
p
R/W
0
R/W
0
R/W
0
R/W
Description
Ext. Clock selection instead of RCosc.
Write Reset prescaler
1 Æ Reset the divider chain from Ck[14] to Ck[2], sets Ck[1]. 0 Æ
No action. The Read value is always '0'
Interrupt select. 0 Æ Interrupt from Ck[4] (typ. 8/12 Hz)
1 Æ Interrupt from Ck[7] (typ. 64/97 Hz)
Debounce clock select. 0 Æ Debouncer with Ck[8]
1 Æ Debouncer with Ck[11] or Ck[14]
With DebSel = 1 one may choose either the Ck[11] or Ck[14] debouncer frequency by selecting the corresponding metal mask
option or by register RegMFP0 Opt[3] when this register is at ‘1’, the debouncer use Ck[14]. Relative to 32kHz the
corresponding max. debouncer times are then 2 ms or 0.25 ms. For the metal mask selection refer to chapter 14.1.3
98H
Switching the PrIntSel may generate an interrupt request. Avoid it with MaskIRQ64/8 = 0 selection during the switching
operation.
The prescaler contains 2 interrupt sources:
- IRQ64/8 ; this is Ck[7] or Ck[4] positive edge interrupt, the selection is depending on bit PrIntSel.
- IRQHz1 ; this is Ck[1] positive edge interrupt
There is no interrupt generation on reset.
The first IRQHz1 Interrupt occurs typ. 1 sec (if SysClk = 32kHz) after reset. (0.65 sec if SysClk is 50kHz).
NOTE: If not written explicitly all timing in peripherals is calculated for 32 kHz System Clock !
Copyright © 2005, EM Microelectronic-Marin SA
13
www.emmicroelectronic.com