English
Language : 

M16C26A-MS Datasheet, PDF (3/17 Pages) Renesas Technology Corp – Sample Program (Musical Scale)
ç
M16C/26A Group
Sample Program (Musical Scale)
4. Operational Outline
The variable resistor (R9) mounted on the board is used to adjust the musical scale and sound a buzzer. Scales and frequencies are
displayed as adjusted with the variable resistor (R9).
Turning the variable resistor (R9) clockwise lowers the sound, and turning it counterclockwise raises the sound. When SW1 is pressed
while a scale is sounded, the sound stops and a string “mute” is displayed on liquid crystal display.
Liquid crystal display
Scale
̎̑̕Hz
Do
Liquid crystal display
Scale
̎̎̕Hz
Re
Liquid crystal display
Scale
̎̑̕Hz
Do
M16C26A
M16C26A
M16C26A
Buzzer
R9
SW3
SW2
SW1/
BOOT
Buzzer
R9
SW3
SW2
SW1/
BOOT
Buzzer
R9
SW3
SW2
SW1/
BOOT
Outputs the sound do
Outputs the sound re
Outputs the sound do
The operation described above is accomplished using the following microcomputer facilities:
• 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, LCD display management and AD input are performed using this timer.
• AD24 (single-shot mode, AD value measurement)
Analog voltages are converted to digital data using the main clock of the microcomputer as a conversion clock.
More specifically, the analog voltages output from the variable resistor (R9) are A/D converted.
• Timer A1 (pulse modulation mode, buzzer output)
This timer outputs a waveform with different high and low pulse widths using the main clock of the microcomputer as the count source.
The high-level width of the output pulse is changed to alter the frequency, by which the buzzer tone is varied.
REJ05B0817-0110 Rev.1.10
2007.12
Page 3 of 17