28905 Parallax Inc, 28905 Datasheet - Page 9

no-image

28905

Manufacturer Part Number
28905
Description
Interface Modules & Development Tools AVRSimon Game Kit
Manufacturer
Parallax Inc
Datasheet

Specifications of 28905

Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Sound
Tone generation is based on the xyloduino project:
http://www.rocketnumbernine.com/2009/03/27/xyloduino-simple-arduinopiezo-organ/
...and modified to support arrays of octaves, notes, and durations in order to create melodies. Timer 0, a
hardware peripheral internal to U1, is used as an 8-bit counter that will toggle the OC0A output pin (Port
B pin 2) from low to high or high to low when the counter value (TCNT0) matches the value programmed
into the Output Compare Register (OCR0A). The toggling of the output pin will generate a square wave
at the desired frequency that is fed into the piezo buzzer LS1.
The play_note() routine is passed the octave, note, and length of the sound. It configures the
Timer/Counter Control Register (TCCR0B) and OCR0A accordingly, waits for the sound to be played, and
then disables the counter:
In order to play a melody (comprising a sequence of notes stored in an array), the routine is called one
time for each note:
The four sounds generated on the original Simon were based on four primary notes of a bugle, which
sound “in tune” when played in any order.
http://www.waitingforfriday.com/index.php/Reverse_engineering_an_MB_Electronic_Simon_game
Copyright © Parallax Inc.
if
{
}
delay_ms(length);
TCCR0B = 0;
for
{
}
TCCR0B = pre[(int)octave];
OCR0A = note >> (octave%2);
// octave, note, length
play_note(pgm_read_byte(startgame_snd_p + i),
delay_ms(50);
Tone 1: Blue, 392 Hz (G note)
Tone 2: Yellow, 330 Hz (E note)
Tone 3: Red, 262 Hz (C note)
Tone 4: Green, 196 Hz (G note)
(note)
(i = 0; i < STARTGAME_SND_SIZE * 4; i = i + 4)
// turn off sound
// pause in between notes
// play sound for specified length
pgm_read_byte(startgame_snd_p + i + 1),
pgm_read_word(startgame_snd_p + i + 2));
AVRSimon Game Kit (#28905)
AVRSimon
// set the prescaler depending on what
// there are two octaves for each
octave is selected
prescale setting, so adjust accordingly
closely mimic those notes:
v1.0 3/22/2010 Page 9 of 10

Related parts for 28905