The Implementation
Our project, The Ear Challenger,
began its life as simple three state Final State Machine (FSM) on a piece of semi-white,
cheapy looking piece of paper that was grabbed from a printer in the CS labs. The three
states: START_STATE, ACTION_STATE, and RING_STATE were tediously hand written by two
compassionate embedded system apprentices--Suvi D. and Dawson K.
Unfortunately, the number of states in the FSM
never grew at the expected exponential rate we predicted. In fact, it NEVER grew.
Getting a working prototype was our first goal.
This means that we have to have a device that generates some kind of frequency through a speaker.
Sounds easy? But Dawson K. and Suvi D. had no idea where to start so they violently
banged their heads against the table in good faith of believing that free floating brain cells equates to
"a freer state of mind" which equals to finding "the solution." However, the two apprentices suffered
severe concusions. Fortunately, co-star Reverend Romand Lev Lysecky arrived at the scene and
blessed us with new knowledge to arrive at our solution. We did not need a Digital to Analog Converter (DAC) to generate a frequency
as we thought. A simple square wave will be able to generate a freqency on the speaker as well. And to
generate the square wave, we simply pulse a pin on the 8051 hi and low. Doing this requires the use
of a timer interrupt which is then variably set so that we can increment or decrement the frequency at our will.
But the output current from the 8051 micro controller was too low to make the frequency decently audible so we
used a
Onto the final device. To make our Ear Challenger any useful, it would
have to generate more than just a single frequency. So we came up with code that would let the user increment or
decrement the the frequency. Since the average human ear can hear from 20Hz to 20000Hz, we set out initial
frequency to be 10000Hz; right smack in the middle bewteen the upper and lower bound. Then if the user hears the frequency
and pushes the "Heard" button, the outputed frequency will be displayed on screen, and the user will have a choice to
to increment or decrement the frequency.
To prevent our valuable user from cheating, we implemented a second timer
interrupt that times out at 5 seconds and terminates the output frequency. A dummy state is also included to prevent cheating
by a user who is just pressing the "Heard" button beserkly.
Implementing the code that tests for cheating was the last feature we added to
make our device fully functional. But since Dawson K. and Suvi D. has a fetish with those tini-tiny LED lights so much they decided to
use them as a scam to make the circuit look more complex that what it really is. Therefore a red LED was added to a the
start/dummy state button. A yellow LED to each of the increment/decrement button, a green LED to the "Heard" button, and
three red LEDs that lights up when power is applied to the bread board.
| Project Description | Implementation | User Manual | Code |