Operation - NEC V850ES/KE1+ User Manual

32-bit single-chip microcontrollers
Table of Contents

Advertisement

10.1.4 Operation

(1) Operation of interval timer BRG
Set the count clock by using the PRSM.BGCS1 and PRSM.BGCS0 bits and the 8-bit compare value by using
the PRSCM register.
When the PRSM.BGCE bit is set (1), interval timer BRG starts operating.
Each time the count value of the 8-bit counter and the set value in the PRSCM register match, an interrupt
request signal (INTBRG) is generated. At the same time, the 8-bit counter is cleared to 01H and counting is
<R>
continued.
The interval time can be obtained from the following equation.
Interval time = 2
Remark m: Divided value (set value in the BGCS1 and BGCS0 bits) = 0 to 3
N: Set value in PRSCM register
f
Note The INTBRG interrupt is generated only once when the set value in the PRSCM register = 01H.
<R>
(2) Count clock supply for watch timer
Set the count clock by using the PRSM.BGCS1 and PRSM.BGCS0 bits and the 8-bit compare value by using
the PRSCM register, so that the count clock frequency (f
PRSM.TODIS bit at the same time.
When the PRSM.BGCE bit is set (1), f
f
is obtained from the following equation.
BRG
m+ 1
f
= f
/(2
BRG
X
To set f
to 32.768 kHz, perform the following calculation to set the BGCS1 and BGCS0 bits and the
BRG
PRSCM register.
<1> Set N = f
<2> If N is even, N = N/2 and m = m + 1
<3> Repeat step <2> until N is odd or m = 3
<4> Set N to the PRSCM register and m to the BGCS1 and BGCS0 bits.
Example:
340
CHAPTER 10 INTERVAL TIMER, WATCH TIMER
× N/f
m
X
N = 256)
: Main clock oscillation frequency
X
BRG
× N)
/65,536 (round off the decimal) to set m = 0.
X
When f
= 4.00 MHz
X
<1> N = 4,000,000/65,536 = 61 (round off the decimal), m = 0
<2>, <3> Since N is odd, the values remain as N = 61, m = 0
<4> The set value in the PRSCM register: 3DH (61), the set values in the BGCS1 and BGCS0
bits: 00
Remark m: Divided value (set value in the BGCS1 and BGCS0 bits) = 0 to 3
N: Set value in PRSCM register = 1 to 256 (when the set value in the PRSCM
register is 00H, N = 256)
f
: Main clock oscillation frequency
X
User's Manual U16896EJ2V0UD
Note
= 1 to 256 (when the set value in the PRSCM register is 00H,
) of the watch timer is 32.768 kHz. Clear (0) the
BRG
is supplied to the watch timer.

Advertisement

Table of Contents
loading

This manual is also suitable for:

?pd70f3302?pd703302?pd70f3302y?pd703302y

Table of Contents