deveopment
Tentative Specifications REV.E1
Timer Z
Specifications in this manual are tentative and subject to change.
Mitsubishi microcomputers
M30100/M30102 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
86
(2) Programmable waveform generation mode
In this mode, the microcontroller, while counting the set values of Timer Z primary and Timer Z sec-
ondary alternately, outputs from the TZ
OUT
pin a waveform whose polarity is inverted each time Timer
Z primary or Timer Z secondary underflows. (See Table 1.14.11) A counting starts by counting the
value set in the Timer Z primary. Figure 1.14.26 shows Timer Y, Z mode register and Timer Y, Z
waveform output control register in this mode. The Timer Z operates in the same way as the Timer Y
in this mode. See Figure 1.14.19 shown the Timer Y operating example in programmable waveform
generation mode.
Item
Specification
Count source
Count operation
f
1
, f
8
, Timer Y underflow, f
C32
Down count
When the timer underflows, it reloads the contents of primary reload register and sec-
ondary reload register alternately before continuing counting.
When a counting stops, the timer reloads the content of the reload register before it stops.
fi/(n+1)/((m+1)+(l+1))
n : Set value of Prescaler Z, m: Set value of Timer Z primary, l: Set value of Timer Z secondary
Count start flag is set (=1)
Count start flag is reset (=0)
(Note 1)
Interrupt request generation timing
When Timer Z underflows during secondary period
TZ
OUT
pin function
Pulse output
(Note 2)
INT0 pin function
Programmable I/O port, or external interrupt input pin
Read from timer
Count value can be read out by reading Timer Z primary register.
Same applies to Prescaler Z register.
(Note 3)
Write to timer
When a value is written to Timer Z primary register, it is written to only reload register.
Same applies to Timer Z secondary register and Prescaler Z register.
(Note 4)
Select function
Output level latch select function
The output level of an waveform being counted during primary and secondary periods
is selectable.
Programmable waveform generation output switching function
Can select either programmable waveform or the value of Port P3
1
register for output.
(Note 5)
Waveform extend function
(Note 6)
The waveform output primary and secondary periods can each be extended 0.5 cycles
of the count source
Frequency when waveform extended: 2xfi/((2x(m+1))+(2x(l+1))+TZPUM0+TZPUM1)
Duty: (2x(m+1)+TZPUM0)/((2x(m+1)+TZPUM0)+(2x(l+1)+TZPUM1))
m: set value of Timer Z primary, l: set value of Timer Z secondary
TZPUM0: Timer Z primary waveform extension control bit
TZPUM1: Timer Z secondary waveform extension control bit
Note 1: When the count is stopped, the Timer Z interrupt request flag becomes "1" and an interrupt may occur. Thus,
interrupts must be disabled before the count is stopped. Furthermore, set the Timer Z interrupt request bit to "0"
before starting counting again.
Note 2: When the counting stopped, the pin is the secondary period output level.
Note 3: Even when counting the secondary period, read out the Timer Z primary register.
Note 4: The set value of Timer Z secondary register and waveform extension control bits as well as Timer Z primary
register are made effective by writing a value to the Timer Z primary register. The written values are reflected to
the waveform output from the next primary period after writing to the Timer Z primary register.
Note 5: The switching of output is synchronized with a timer Z secondary underflow.
Note 6: When using the waveform extend function, the Prescaler Z register must be set to "00
16
".
When selecting Timer Y underflow and f
1
for the count source, the waveform extend function cannot be used.
Divide ratio
Count start condition
Count stop condition
Table 1.14.11. Specifications of programmable waveform generating mode