CSEP567 Assignment 2/PreLab 7: “SPI/USB Interface”

Objectives

The goal of lab 7 is to extend the lab 6 to interface to a computer using SPI and USB. In this Prelab you will learn how to use the SPI protocol to transfer data from your microcontroller.

Prelab 7-- SPI:

  1. Write code to implement Part I, Section 4 of Lab 7. Be ready to test your code in lab.

Assignment 2 Questions:

Question 1: Briefly describe how the SPI master sends a byte of data to the slave. Please describe the steps (e.g., set SS low...)

Question 2: How does an SPI master handle multiple slaves on the same SPI bus?

Question 3:How could you send data between devices when the data is of arbitrary length? (e.g., 10, 32, 50 bytes, etc.)? How do you know where the data starts and ends?

Question 4: Design a protocol to send bytes from an ATmega16 SPI interface to a sound generator chip that has an SPI interface. Send from 1 to 4 notes, followed by a Play command. A note is defined as follows:

Question 5: In your protocol above, how would you add bit corruption detection?

Question 6, RFID: Where does the power for an RFID tag come from?

Turn-In

Please complete the prelab individually. Please turn-in your answers to the questions at the beginning of next week's lab.