
EM6517
FOR ENGINEERING ONLY
EM Microelectronic-Marin SA, 09/99, Rev. A/277
12
6
6.1 Oscillator
A built-in crystal oscillator generates the system-operating clock for the CPU and peripheral blocks, from an
externally connected crystal (typically 32.768kHz). The regulated voltage, Vreg, supplies the oscillator circuit. In
sleep mode the oscillator is stopped.
EM’s special design techniques guarantee the low current consumption of this oscillator. The external
impedance between the oscillator pads must be greater than 10MOhm. EM Microelectronic-Marin SA must
confirm connection of any other components to the two oscillator pads.
Oscillator and Prescaler
6.2 Prescaler
The prescaler consists of fifteen elements divider chain which delivers clock signals for the peripheral circuits
such as timer/counter, buzzer, LCD voltage multiplier, debouncer and edge detectors, as well as generating
prescaler interrupts. The input to the prescaler is the system clock signal. Power on initializes to Hex (0001).
Table 6.2.1 Prescaler Clock Name Definition
Function
System clock
System clock / 2
System clock / 4
System clock / 8
System clock/ 16
System clock / 32
System clock / 64
System clock / 128
Name
Ck[16]
Ck[15]
Ck[14]
Ck[13]
Ck[12]
Ck[11]
Ck[10]
ck [9]
32 KHz Xtal
32768 Hz
16384 Hz
8192 Hz
4096 Hz
2048 Hz
1024 Hz
512 Hz
256 Hz
Function
Name
Ck[8]
Ck[7]
Ck[6]
Ck[5]
Ck[4]
Ck[3]
Ck[2]
Ck[1]
32 KHz Xtal
128 Hz
64 Hz
32 Hz
16 Hz
8 Hz
4 Hz
2 Hz
1 Hz
System clock / 256
System clock / 512
System clock / 1024
System clock / 2048
System clock / 4096
System clock / 8192
System clock / 16384
System clock / 32768
Table 6.2.2 Control of Prescaler Register RegPresc
Bit
Name
Reset
R/W
3
PWMOn
0
R/W
2
ResPresc
0
R/W
Description
see 10 bit counter
Write Reset prescaler
1 -> Resets the divider chain
from Ck[14] down to
Ck[2], sets Ck[1].
0 -> No action.
The Read value is always ’0’
Interrupt select.
0 -> Interrupt from Ck[4]
1 -> Interrupt from Ck[6]
Debouncer clock select.
0 -> Debouncer with Ck[8]
1 -> Debouncer with Ck[11]
or Ck[14]
1
PrIntSel
0
R/W
0
DebSel
0
R/W
With DebSel = 1 one may choose either the Ck[11] or Ck[14] debouncer frequency by selecting the
corresponding metal mask option (
ROM Version only
). Relative to 32kHz the corresponding max. debouncer
times are then 2 ms or 0.25 ms. For the metal mask selection refer to chapter 19.1.4.
Switching the
PrIntSel
may generate an interrupt request. Avoid it with
MaskIRQ32/8
= 0 selection during the
switching operation.
The prescaler contains 2 interrupt sources:
- IRQ32/8 ; this is Ck[6] 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 1 sec (32kHz) after reset.
Figure 11. Prescaler Frequency Timing
System Clock
Ck[16]
Ck[15]
Ck[14]
Horizontal Scale Change
Ck[2]
Ck[1]
First positive edge of 1 Hz clock is 1s after
the falling reset edge
Prescaler Reset