User Tools

Site Tools


milestone_1

This is an old revision of the document!


Milestone 1

Overview

Before starting this milestone, find your team member. Pass off and report submission will be done as a team (not individually).

This milestone requires you to complete three tasks:

  1. Verify that you have one good transmitter and one good receiver board
  2. Submit a report describing your analog board experiments
  3. Implement a queue library module

Requirements

  1. You must have one working transmitter board.
  2. You must have one working receiver board.
  3. You must submit the report as described below.
  4. Your queue code must implement all of the functions listed in the queue.h file. For those of you unfamiliar with how to allocate memory in 'C', the queue_init() and queue_garbageCollect() functions are provided through a link below.
  5. Write your own queue code. Don't download code from the internet, it may have bugs in it. Also, since this queue module has extra functions that are not typically included in a queue implementation, things will just go faster and easier if you write the code yourselves.
  6. Your queue code must pass the provided queue_runTest() test.
  7. You must follow the same coding standards as was done for ECEN 330.

Resources

Videos

These videos provide guidance on the oscilloscope that you will use during the pass off of your receiver board.

Queue Coding Help

Source Code

Note that the source code for each of these files is part of your project directory (ecen390).

  • lasertag/main.c
  • lasertag/queue.h
  • lasertag/queue_test.h
  • lasertag/queue_test.c

Specifications

Receiver Board

For this task, you must verify that you can receive a 20 mV RMS FFT signal from a gun excited with a 0 - 3.3V square wave when the two guns are separated by 40 feet. milestone1verifyanaloghardware.jpg

You will be using the gun mounted on the column. In addition to saving the FFT plot for your report you also need to save the raw data. The raw data needs to be collected with a sample rate of 100 ksamples/second.

Oscilloscope settings

  • Horizontal scale: 50 ms/
  • Under the save menu select CSV
  • Under the save menu select settings set the number of samples to 50,000

You can verify the sample rate by reading the data into MATLAB and subtracting the time sample. The MATLAB code would be the following.

1/max(diff(t))

The MATLAB output should be 1E5.


Queue

You will need to implement a queue library module for your laser-tag system. Create a new file named queue.c in the lasertag directory. You should remember the basics of the queue data structure from some of your CS classes. A link under “Queue Coding Help” provides a quick review of queues. A link also explains the “circular buffer” implementation strategy for queues. You must implement your queue as a circular buffer.

The queue that you must implement will be just a little different than a typical queue. It must have the following properties:

  • Using a special function, your queue must allow you to keep adding (pushing) new elements even after it is full. If the queue is full when you add an additional element, it must remove the oldest element and add the new one, making sure to keep the correct order of things in the queue. For example, let's say that your queue can contain 200 elements. If you add 400 elements to the queue, the queue should contain the last 200 elements that were added, in the same order that they were added. In other words, the queue will contain elements 201 through 400. When you remove an element from the queue, the elements should be removed in arrival order, e.g., element 201, followed by element 202, etc. You write a special function to do this: queue_overwritePush().
  • You must be able to read the contents in the queue without removing them or disturbing them. In other words, your queue must provide a function that can read elements in the queue by index. For example, let's assume that the name of the function is queue_readElementAt(&q, index) and that it takes two arguments (the address of the queue, and the index of the element to read). If index = 0, this will read the oldest element in the queue. Larger values of index will successively read data that arrived later. You must print out an error message if the index-value would access elements beyond what is currently stored in the queue.

Pass Off

Receiver Board

Show the following on the oscilloscope display:

  • Frequency domain plot of received data with hit for player 1 (frequency 1),
  • Frequency domain plot of received data with shooter blocked (without hit) for player 1 (frequency 1).

Queue

  • Ensure that the queue_runTest() function runs to its end and that all tests pass. This can be done by uncommenting #define RUNNING_MODE_TESTS in main.c.
  • Submit your queue code on Learning Suite. Run ”./check_and_zip.py 390m1” to create a .zip file of your project. Submit only one .zip file per team. The TAs will give credit to both members of the team.

Report

You will turn in one report for this Milestone, the report will describe your experiments with your receiver boards and contain the following:

  1. MATLAB plot (in frequency domain) of received data with hit for player 1 (frequency 1).
  2. MATLAB plot (in frequency domain) of received data with shooter blocked (without hit) for player 1 (frequency 1).
  3. Proper titles, etc.

Here is a sample report you can use as an example.

milestone_1.1672520533.txt.gz · Last modified: 2022/12/31 14:02 by scott