Square-Wave Output Operation (8-Bit Resolution) - NEC V850ES/SA2 UPD703201 Manual

32-bit single-chip microcontrollers
Table of Contents

Advertisement

7.3.3

Square-wave output operation (8-bit resolution)

A square wave with any frequency can be output at an interval specified by the value preset in 8-bit timer compare
register n (CRn).
By setting the TOEn bit of 8-bit timer mode control register n (TMCn) to 1, the output status of the TOn pin is
inverted at an interval specified by the count value preset in the CRn register. In this way, a square wave of any
frequency can be output (duty = 50%) (n = 2 to 5).
Setting method
<1> Set each register.
• TCLn register: Selects the count clock (t).
• CRn register:
• TMCn register: Stops count operation, selects the mode in which clear & start occurs on a match
<2> When the TCEn bit of the TMCn register is set to 1, counting starts.
<3> When the values of the TMn register and CRn register match, the timer output F/F is inverted.
Moreover, INTTMn is generated and the TMn register is cleared to 00H.
<4> Then, the timer F/F is inverted during the same interval and a square wave is output from the TOn pin.
Caution Do not rewrite the value of the CRn register during square-wave output.
CHAPTER 7 TIMER/COUNTER FUNCTION
Compare value (N)
between the TMn register and CRn register.
LVSn
LVRn
Timer Output F/F Status Setting
1
0
High-level output
0
1
Low-level output
Enables timer output F/F inversion operation, and enables timer output.
(TMCn register = 00001011B or 00000111B)
Frequency = t/2 (N + 1): N = 00H to FFH
Preliminary User's Manual U15905EJ1V0UD
253

Advertisement

Table of Contents
loading

Table of Contents