28123 Parallax Inc, 28123 Datasheet - Page 249

TEXT WHAT'S A MICROCONTROLLER

28123

Manufacturer Part Number
28123
Description
TEXT WHAT'S A MICROCONTROLLER
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet

Specifications of 28123

Style
Book
Title
What's a Microcontroller?
Contents
Whats a Microcontroller? Text
Product
Microcontroller Accessories
Core Processor
PIC16C57c
Flash
128 Bytes
Operating Supply Voltage
9 V
Board Size
31 mm x 16 mm
Lead Free Status / RoHS Status
Not applicable / Not applicable
LOOP
END
How MusicWithMoreFeatures.bs2 Works
Below is the musical data for the entire song. For each note in the
there is a corresponding entry in the
For example, the first note is a C note in the 7
dotted. Here is another example: the second from the last note (not including “Q”) is an
E note, in the 7
constant that sets the tempo for the song.
Notes
Octaves
Durations
Dots
BeatsPerMin
In the previous example program,
that will hold the duration of a whole note in ms. After this value is calculated,
WholeNote
program. The
in the same manner they were in the previous program. The
handled a little differently since now it has to be adjusted depending on the octave the
note is played in. The
the octave and dot features.
FREQOUT 9, noteDuration, noteFreq
index = index + 1
wholeNote
index
offset
noteLetter
noteFreq
noteDuration
will be used to determine all the other note durations, just like in the previous
index
th
octave. It’s a half note, and it is dotted. There is also a
,
DATA
DATA
DATA
DATA
CON
offset
noteOctave
VAR
VAR
VAR
VAR
VAR
VAR
,
"C","E","E","E","D","E","F","E","E","D","D",
"D","C","D","E","C","Q"
320
noteLetter
Word
Byte
Nib
Byte
Word
Word
7,
7,
4,
4,
0,
0,
WholeNote
Octaves, Durations,
and
7,
7,
2,
4,
0,
0,
noteDot
7,
7,
4,
4,
0,
0,
, and
was a constant. This time, it’s a variable
th
7,
7,
4,
2,
0,
1,
noteDuration
octave; it’s a quarter note and it’s not
variables have been added to handle
7,
7
4,
2
0,
0
7,
4,
0,
and
7,
2,
1,
variables are also used
Notes DATA
Dots DATA
noteFreq
7,
2,
0,
BeatsPerMin
7,
4,
0,
variable is
directives.
directive,
7,
2,
0,
7,
4,
0,

Related parts for 28123