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.

Controlling Power ApplicationsMitsubishi microcomputers<strong>M16C</strong> / 62 GroupSINGLE-CHIP 16-BIT CMOS MICROCOMPUTER3.7 Controlling Power Using Stop ModeOverviewThe following are steps for controlling power using stop mode. Figure 3.7.1 shows the operationtiming, Figure 3.7.2 shows an example of circuit, and Figures 3.7.3 and 3.7.4 show the set-upprocedure.Use the following peripheral functions:• Key-input interrupts• Stop mode• Pull-up functionSpecifications_____(1) Use P100 through P103 for the scan output pins of a key matrix. Use the input pins (KI0_____through KI3) of the key-input interrupt function for the key-input reading pins. The pull-upfunction is also used.(2) If a key-input interrupt request occurs, clear the stop mode and read a key.Operation(1) Enable a key-input interrupt and set the pull-up function to pins KI0 through KI3. Change theoutput of P100 through P103 to “L” and enter stop mode.__________(2) If a key is pressed, “L” is input to one of pins KI0 through KI3 to clear stop mode. A key-inputinterrupt occurs to execute the key-input interrupt handling routine.(3) Sequentially set P100 through P103 to “L” to determine which key was pressed.(4) When the process to determine the key pressed is completed, change the output from P100through P103 to “L” again and enter stop mode.__________(1) Shift to stop mode(2) Cancel a stop mode(3) Key scan (4) Shift to stop modeKey matrix scanP100 outputP101 outputP102 outputP103 outputP104 to P107 inputKey input Key OFF Key ON Key OFF Key ONKey inputinterrupt processingCPU clockStop modeStop modeFigure 3.7.1. Operation timing of controlling power using stop mode476

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

Saved successfully!

Ooh no, something went wrong!