11.07.2015 Views

uPD789074 Subseries 8-Bit Single-Chip Microcontrollers UD - Home

uPD789074 Subseries 8-Bit Single-Chip Microcontrollers UD - Home

uPD789074 Subseries 8-Bit Single-Chip Microcontrollers UD - Home

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 7 8-BIT TIMER/EVENT COUNTER 807.4.4 Operation as PWM outputPWM output enables an interrupt to be generated repeatedly at an interval specified by the count value preset in8-bit compare register 80 (CR80).To use 8-bit timer/event counter 80 for PWM output, the following settings are required. Set P27 to output mode (PM27 = 0). Set the output latch of P27 to 0. Disable the operation of 8-bit timer counter 80 (TM80) (TCE80 = 0). Set a count clock for 8-bit timer/event counter (see Table 7-4), and enable output of TO80 (TOE80 = 1) andPWM output (PWME80 = 1). Set a count value in CR80. Enable the operation of TM80 (TCE80 = 1).When the count value of 8-bit timer counter 80 (TM80) matches the value set in CR80, TM80 continues counting,and an interrupt request signal (INTTM80) is generated.Cautions 1. If CR80 is rewritten during timer operation, a high level may be output during the next cycle(see 7.5 (2) Setting of 8-bit compare register 80).2. If setting the count clock to TMC80 and enabling the operation of TM80 are performed at thesame time with an 8-bit memory manipulation instruction, the error one cycle after the timerhas been started may exceed one clock. To use 8-bit timer/event counter 80 as a PWMoutput, therefore, make the settings in the above sequence.Figure 7-7. PWM Output TimingCount clockTM8000H 01H ••• M ••• FFH 00H 01H 02H ••• M M + 1 M + 2 ••• FFH 00H 01H ••• M ••• •••CR80MTCE80OVFINTTM80TO80 NoteM = 01H to FFHNote The initial value of TO80 is low when output is enabled (TOE80 = 1).Caution Do not set CR80 to 00H in PWM output mode; otherwise, PWM may not be output normally.106User’s Manual U14801EJ3V1<strong>UD</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!