Operation As Carrier Generator - NEC PD789488 User Manual

Pd789489 subseries 8-bit single-chip microcontrollers
Table of Contents

Advertisement

7.4.3 Operation as carrier generator

An arbitrary carrier clock generated by TM60 can be output in the cycle set in TM50.
To operate timer 50 and timer 60 as carrier generators, settings must be made in the following sequence.
<1> Disable operation of TM50 and TM60 (TCE50 = 0, TCE60 = 0).
<2> Disable timer output of TO50 and TO60 (TOE50 = 0, TOE600 = 0).
<3> Set count values in CR50, CR60, and CRH60.
<4> Set the operation mode of timer 50 and timer 60 to carrier generator mode (see Figures 7-6 and 7-7).
<5> Set the count clock for timer 50 and timer 60.
<6> Set remote control output to carrier pulse (RMC60 (bit 2 of carrier generator output control register 60
(TCA60)) = 0).
Input the required value to NRZB60 (bit 1 of TCA60) by program.
Input a value to NRZ60 (bit 0 of TCA60) before it is reloaded from NRZB60.
<7> Set P31 to the output mode (PM31 = 0), set the P31 output latch to 0, and set TO60 to output enable
(TOE600 = 1).
<8> Enable the operation of TM50 and TM60 (TCE50 = 1, TCE60 = 1).
<9> When the value of NRZB60 is transferred to NRZ60, input the value to be transferred to NRZ60 next time to
NRZB60 after INTTM50 falling.
<10> Generate the desired carrier signal by repeating <9>.
The operation of the carrier generator is as follows.
<1> When the count value of TM60 matches the value set in CR60, an interrupt request signal (INTTM60) is
generated and output of timer 60 is inverted, which makes the compare register switch from CR60 to CRH60.
<2> After that, when the count value of TM60 matches the value set in CRH60, an interrupt request signal
(INTTM60) is generated and output of timer 60 is inverted again, which makes the compare register switch
from CRH60 to CR60.
<3> The carrier clock is generated by repeating <1> and <2> above.
<4> When the count value of TM50 matches the value set in CR50, an interrupt request signal (INTTM50) is
generated. The rising edge of INTTM50 is the data reload signal of NRZB60 and is transferred to NRZ60.
<5> When NRZ60 is 1, a carrier clock is output from the TO60 pin.
Cautions
1. While timer 60 output is disabled (TOE600 = 0), TCA60 cannot be set with 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 NRZB60
because the previous value is not retained. In this case also a 1-bit memory manipulation
instruction cannot be used while timer 60 output is disabled (TOE600 = 0). Be sure to use
an 8-bit memory manipulation instruction.
3. When timer 60 output is enabled (TOE600 = 1), a write operation to NRZ60 is invalid.
However, while the timer 50 interrupt signal (INTTM50) is high level, the NRZB60 value is
immediately transferred to NRZ60 if TCA60 is rewritten. Rewrite TCA60 after waiting for
half a clock of the TM50 count clock during INTTM50 interrupt servicing.
Figures 7-22 to 7-24 show the operation timing of the carrier generator.
150
CHAPTER 7 8-BIT TIMERS 50, 60, AND 61
User's Manual U15331EJ4V1UD

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pd78f9488Pd78f9489Pd789489

Table of Contents