CSE477 Laboratory Assignment #3


Serial Communication, Communication Protocols, Palm Pilot Development Environment

Assigned: 30 January
Due: 9 February


Objectives:

When you have completed this lab, you should know how to:


Reading:

Course notes on communication (RS-232, in particular).

Handout of the Palm Pilot application code with which your EVB board will communicate.


Part 1: Using the Palm Pilot as a User Interface

You are provided with a program for controlling the speed of two motors that was written for the Palm Pilot PDA platform.

The user interface provides four number fields and two check boxes. For each of two motors there is a field for the desired speed (user input), a field for actual speed (output to user), and a checkbox specifying whether both motors should be locked to the desired speed.

The application communicates by waiting for a 5-byte packet of data consisting of a framing byte followed by a 2-byte left motor speed and then a 2-byte right motor speed (high-order byte first). Once this packet is received the actual speed fields are updated on the user interface and the contents of the desired fields are read and sent over the serial port in the same format as the received packet.

The code was developed using the MetroWerks CodeWarrior Palm Pilot Integrated Development Environment (program and header files). There are actually two programs of interest:

Both of these should be loaded on all the Pilots in the lab. There are three Pilots available. The protocol for sharing them will be to send a message to cse477@cs whenever you take control of one so that someone can always figure out where they all are by checking the last message on the class e-mail archive.

Part 2: Controlling Two Motors Remotely

Modify the microcontroller program that controls to motors so that the motors can be controlled independently and remotely. First make the modifications necessary so that the motors can either be coupled and run at the same speeds, or the motors can be uncoupled and set to run at different target speeds.

These modifications will need to be able to happen during runtime. Without stopping the execution of the program, modifying a memory location, and restarting the program, your program should be able to couple or uncouple the motors.

Part 3: Operate Two Motors Through the Palm Pilot

Modify your microcontroller program so that the Palm Pilot controls the speeds of the motors. You will need to conform to the serial communications protocol that is implemented in the Palm Pilot CSE477Lab3 application. It allows the microcontroller and the Palm Pilot to communicate over the EVB's second serial port. All communication is initiated by the EVB with the Pilot responding. You are able to use the two functions GetByte() and SendByte() to send and receive data over the second serial communication port on the microcontroller.

What to Turn In

Demonstrate the Palm Pilot controlling the motors both in a coupled and uncoupled fashion. Also turn in a flow chart of your protocol for the serial communication between the Pilot and the microcontroller. It should clearly specify what is implemented using polling and what is implemented using interrupts.


Comments to: cse477-webmaster@cs.washington.edu (Last Update: )