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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 7 8-BIT TIMER/EVENT COUNTER 807.4.3 Operation as square-wave output8-bit timer/event counter 80 can generate square-wave output of an arbitrary frequency at an interval specified bythe count value preset in 8-bit compare register 80 (CR80).To use 8-bit timer/event counter 80 for square-wave output, settings must be made in the following sequence. Set P27 to output mode (PM27 = 0). Set the output latch of P27 to 0. Disable operation of 8-bit timer counter 80 (TM80) (TCE80 = 0). Set a count clock for 8-bit timer/event counter 80 (see Table 7-5), enable output of TO80 (TOE80 = 1), anddisable PWM output (PWME80 = 0). 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, the TO80 pin output will beinverted. Through application of this mechanism, square waves of any frequency can be output. As soon as a matchoccurs, TM80 is cleared to 0 and continues counting, generating an interrupt request signal (INTTM80).Setting bit 7 (TCE80) of TMC80 to 0 clears the square-wave output to 0.Table 7-5 shows the square-wave output range, and Figure 7-6 shows the timing of square-wave output.Cautions 1. Stop the timer operation before rewriting CR80. If CR80 is rewritten while the timeroperation is enabled, a match interrupt request signal may be generated immediately at thepoint of rewrite.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 squarewaveoutput, therefore, make the settings in the above sequence.Table 7-5. Square-Wave Output Range of 8-<strong>Bit</strong> Timer/Event CounterTCL801 TCL800 Minimum Pulse Width Maximum Pulse Width ResolutionAt fX = 10.0 MHzOperation NoteAt fX = 5.0 MHzOperationAt fX = 10.0 MHzOperation NoteAt fX = 5.0 MHzOperationAt fX = 10.0 MHzOperation NoteAt fX = 5.0 MHzOperation0 0 1/fX 100 ns 200 ns 2 8 /fX 25.6 µs 51.2 µs 1/fX 100 ns 200 ns0 1 2 8 /fX 25.6 µs 51.2 µs 2 16 /fX 6.55 ms 13.1 ms 2 8 /fX 25.6 µs 51.2 µsNote Expanded-specification products only.RemarkfX: System clock oscillation frequency104User’s Manual U14801EJ3V1<strong>UD</strong>

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

Saved successfully!

Ooh no, something went wrong!