English
Language : 

M16C26A-C Datasheet, PDF (3/17 Pages) Renesas Technology Corp – Sample Program (Calendar)
ç
M16C/26A Group
Sample Program (Calendar)
ç
4. Operational Outline
A calendar is created that shows a date of the day on liquid crystal display. (Dates from January 1, 2000 to December 31, 2099, including
leap years, are supported.)
Press the decision switch (SW16) to enter the setup mode. First, fix a “year” using the UP switch (SW13), DOWN switch (SW14) and
numeric switches 0 through 9. Next, change a “month” and “day” using the UP switch (SW13) and DOWN switch (SW14). When a
“day” is fixed, a “day of the week” is automatically displayed, by which the setup mode is exited.
Pressing the UP switch changes the date to a date of the next day. Pressing the DOWN switch reverts the date to a date of the preceding
day. Pressing the CLR switch initializes the display and date.
SW1
7
SW2
4
SW3
1
SW4
0
SW5
8
SW6
5
SW7
2
SW8
SW9
9
SW10
6
SW11
3
SW12
CLR
SW13
UP
SW14
DOWN
SW15
SW16
PRESS
LCD
Note: In this program, pressing two or more switches at the same time has no effect (i.e., ignored).
• Timer A0 (timer mode, main 2 ms cycle)
This timer counts 2 milliseconds using the main clock of the microcomputer as the count source.
It is used as the basic timer of RSK_LIB.
Time management, key scan, and LCD display management are performed using this timer.
REJ05B0813-0120 Rev.1.20
2007.11
Page 3 of 17