EE 476: Laboratory 3

Cricket-call generator.

Introduction.

You will construct a cricket-call generator which will produce audio output of a simplified cricket call. A cricket call may be very complex, but we will limit ourselves to the following form.

  1. A call is made up by repeating indefinitely a chirp and a silent period. If the duration of the silence is zero, the call is refered to as a trill.
  2. A chirp is made up of a certain number of syllables with specific duration and repitition interval.
  3. A syllable is made up of a squarewave burst at a certain frequency.

The image below summerizes the definition ( from bionb 420).


Procedure:

You will need the 8515 header file for CodevisionC. You will probably want to review the code examples given in the CodevisionC Tutorial.

You will use PortB of the mcu to read four switches. One bit of another port, perhaps bit 6 (which happens to be adjacent on the connector to ground), will be used to drive an earphone.

You will need to figure out how to generate a variety of time delays and durations. I suggest one of the following, but you may use any scheme you want.

Scheme 1

Scheme 2:


Assignment

  1. Write a C program which implements a cricket-call generator with the following specifcations:

  2. Demo this program to a staff member. Show that all specifications are met by verifying times and frequencies with an oscilloscope. Frequency accuracy should be +/-1%. Duration accuracy should be +/-1 mSec.

  3. Your written lab report should include:

     


Copyright Cornell University December 2000