21.07.2015 Views

M16C User Manual.pdf

M16C User Manual.pdf

M16C User Manual.pdf

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.

Timer A ApplicationsMitsubishi microcomputers<strong>M16C</strong> / 62 GroupSINGLE-CHIP 16-BIT CMOS MICROCOMPUTER3.4 Buzzer OutputOverviewThe timer mode is used to make the buzzer ring. Figure 3.4.1 shows the operation timing, andFigure 3.4.2 shows the set-up procedure.Use the following peripheral function:• The pulse-outputting function in timer mode of timer A.Specifications(1) Sound a 2-kHz buzz beep by use of timer A0.(2) Effect pull-up in the relevant port by use of a pull-up resistor. When the buzzer is off, set theport high-impedance, and stabilize the potential resulting from pulling up.(3) Connect a 16-MHz oscillator to XIN.Operation(1) The microcomputer begins performing a count on timer A0. Timer A0 has disabled interrupts.(2) The microcomputer begins pulse output by setting the pulse output function select bit to“Pulse output effected”. P70 changes into TA0OUT pin and outputs 2-kHz pulses.(3) The microcomputer stops outputting pulses by setting the pulse output function select bit to“Pulse output not effected”. P70 goes to an input pin, and the output from the pin becomeshigh-impedance.(1) Start count (2) Buzzer output ON (3) Buzzer output OFFTimer A0overflow timingCount start flag“1”“0”Pulse outputfunction select bit“1”“0”P70 output“1”“0”High-impedanceHigh-impedanceFigure 3.4.1. Operation timing of buzzer output468

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

Saved successfully!

Ooh no, something went wrong!