Course notes on communication (RS-232, in particular).
Handout of the Palm Pilot application code with which your EVB board will communicate.
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:
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.
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.