Operation As Carrier Generator - NEC mPD780344 Series User Manual

8-bit single-chip microcontrollers
Table of Contents

Advertisement

7.4.3 Operation as carrier generator

An arbitrary carrier clock generated by TMB0 can be output in the cycle set in TMA0.
To operate timer A0 and timer B0 as carrier generators, settings must be made in the following sequence.
<1> Disable operation of 8-bit timer counter A0 (TMA0) and 8-bit timer counter B0 (TMB0) (TCEA0 = 0,
TCEB0 = 0).
<2> Disable timer output of TOA0 and TOB0 (TOEA0 = 0, TOEB0 = 0).
<3> Set the count clock for timer A0 and timer B0.
<4> Set the operation mode of timer A0 and timer B0 to carrier generator mode (see Figures 7-4 and 7-5).
<5> Set count values in CRA0, CRB0, and CRHB0.
<6> Set remote control output to carrier clock (RMCB0 (bit 2 of carrier generator output control register B0
(TCAB0)) = 0).
Input the required value to NRZBB0 (bit 1 of TCAB0) by program.
Input a value to NRZB0 (bit 0 of TCAB0) before it is reloaded from NRZBB0.
<7> Set P06 to output mode (PM06 = 0) and the P06 output latch to 0 and enable TOB0 output by setting TOEB0
to 1.
<8> Enable the operation of TMA0 and TMB0 (TCEA0 = 1, TCEB0 = 1).
The operation of the carrier generator is as follows.
<1> When the count value of TMB0 matches the value set in CRB0, an interrupt request signal (INTTMB0) is
generated and output status of timer B0 is inverted, which makes the compare register switch from CRB0
to CRHB0.
<2> After that, when the count value of TMB0 matches the value set in CRHB0, an interrupt request signal
(INTTMB0) is generated and output status of timer B0 is inverted again, which makes the compare register
switch from CRHB0 to CRB0.
<3> The carrier clock is generated by repeating <1> and <2> above.
<4> When the count value of TMA0 matches the value set in CRA0, an interrupt request signal (INTTMA0) is
generated. The rising edge of INTTMA0 is the data reload signal of NRZBB0 and is transferred to NRZB0.
<5> When NRZB0 is 1, a carrier clock is output from TOB0 pin.
Cautions 1. TCAB0 cannot be set by a 1-bit memory manipulation instruction. Be sure to use an 8-bit
memory manipulation instruction.
2. When setting the carrier generator operation again after stopping it once, reset NRZBB0
because the previous data is not retained. In this case also a 1-bit memory manipulation
instruction cannot be used. Be sure to use an 8-bit memory manipulation instruction.
Figures 7-19 to 7-21 show the operation timing of the carrier generator.
CHAPTER 7 8-BIT TIMERS A0, B0
User's Manual U15798EJ2V0UD
181

Advertisement

Table of Contents
loading

Table of Contents