4 / 17 page
REJ05B0817-0110 Rev.1.10
2007.12
Page 4 of 17
M16C/26A Group
Sample Program (Musical Scale)
5.
Operational Specification
(1) Immediately after the reset switch is depressed, the scale
corresponding to a variable resistor position is output.
(2) Scale output and display are changed using the variable
resistor (R9).
(3) Scale output is turned on or off by pressing SW1.
When scale output is turned off, a string “mute” is
displayed.
Relationship between VR Input (Input Voltage) and Scale Output
Input voltage
Frequency
0 -0.625V
do
259Hz
0.625 -1.25V
re
292Hz
1.25 -1.875V
mi
327Hz
1.875 - 2.5V
fa
347Hz
2.5 - 3.125V
so
393Hz
3.125 - 3.75V
la
441Hz
3.75 - 4.375V
si
498Hz
4.375 - 5V
do
524Hz
* The AD values are set by calling the common function “AD
average” (RL_AdVeraging). Within the function, a value is
sampled 6 times, and the sampled values except the maximum
and minimum values are averaged, the result of which is
returned. This average value is acquired 8 times, the average of
which is made a fixed value.
(1) Reset switch depressed
2
5
H z
9
d
s
c
a
l
e
o
(2) Variable resistor
2
9
H z
2
r
s
c
a
l
e
e
m u t
s
c
a
l
e
e
(3) SW1 depressed
2
9
H z
2
r
s
c
a
l
e
e
(4) SW1 depressed