- Project Team
- Sharad Bhargava
- Cody Hartwig
- Jacob Moshenko
- Chirag Patel
- Project Description
Our project was centered around CAD software. Input for the CAD device was done with a HyperTerminal on a slave I2C PowerPC board, while the output was done through first a Television screen and then a confirmed design was outputted through an Etch-a-Sketch.

Block diagram of hardware layout
With this layout, a user can input shapes on the menus on the slave computer and the output will be displayed on the remote machine.
- Project Components
- I2C Master -- The I2C Master was in charge of most of the calculations of our project. It is responsible for getting data from the user on the remote terminal. This is done by performing an I2C receive. However, since the slave device is not always prepared to send, our receive function needs to be able to determine if the receive was successful. In order to do this, we can use the knowledge that the slave will only ACK on a successful transaction. Therefore, if the slave NAKs then we know that we should block and attempt the receive again. In addition, the master is responsible for initializing the video encoder chip (ADV7176) using the I2C interface. Finally, the master PowerPC, in addition to it's I2C duties, was responsible for calculating the shapes to be drawn and using the Video Controller to send signal to the Video Encoder, it also uses it's bus to send the servo control signals.
The I2C master moves through several states in it's operation:
- Command Fetch -- Use I2C to fetch command from slave.
- Command Decode -- Decode the byte array to determine command.
- Execute Command -- Plot line to display, store points, or draw to Etch-a-Sketch.
- Video Controller -- The video controller is built into the MPC823 chip. This controller takes care of generating the proper signals for a digital display. The input of this is provided by the frame buffer in memory using DMA. The output of this is directed into the Video Encoder.
- Video Encoder -- The video encoder is on the FADS board. We use the video encoder to convert the signal from the Video Controller into an S-video signal. The video encoder is configured using I2C. The first test we were able to run with the video encoder was to use it to display a test pattern on the TV. This can be done without any configuration of the Video Controller, since the Encoder itself generates the signal. That makes this a good test of the I2C interface.
- Etch-a-Sketch hardware -- The Etch-a-Sketch hardware consists of two Futaba S3003 servos that are directly mounted to the Etch-a-Sketch knobs. As packaged, these servos do not have a control throw long enough for our purposes. For this reason, we had to modify the servos so that they could make full turns. After this modification, the servos had three useful signal frequencies. One frequency to turn counterclockwise, one frequency to remain motionless (it turns out no pulse achieves this result better), and a final frequency for clockwise motion.
- Servo Bus Hardware -- The servos were connected to the MPC823 bus using this hardware. This hardware allowed us to write a byte to a specific location that, depending on the value of the byte, would cause the servos to move a small amount in that direction. When read from, this hardware would read 0 if the servo was not in motion and 1 if the servo was in motion. This allows us to be sure not to attempt to move the servo again until it is done moving from the previous.
- I2C Slave -- The I2C slave is used to get input from the user. This is done in HyperTerminal using the UART serial interface. After a successful command is parsed and interpretted, it is encoded as an array of 9 bytes. These nine bytes contain all the data included in the command. After these bytes are set, we call an I2C send function that will hold until the master requests the information that is waiting.
The I2C slave travels through several states in its operation:
- Get input -- Get input from the HyperTerminal
- Encode input -- Encode the input as an array of 9 bytes.
- Send input -- Use I2C to send input to the master.
- Most difficult component
The most difficult component that we interfaced in our project was I2C. We didn't have much trouble setting up the Master device, since this was used with the video encoder, but setting the second device up as a slave presented more of a problem. The logic analyzer worked very well to analyze transactions, but we could tell that our slave would not send the ACK signal when it was addressed. Finally, we found some discrepencies in the initialization of our slave. After resolving these, we still had some problems with our send and receive functions. We determined that our receive function depended on the slave already being ready to send. However, in our application, we could not be sure that it would be ready to send when we wanted to receive. Therefore, we needed to be able to detect a NAK and respond appropriately. The white book was fairly useful in this, but we felt it was slightly vague about whose responsibility it was to reset the NAK bit on the I2C event register.
- Graphics from demonstration

Main menu of MicroPlot program.

Design as shown on TV display

Design being drawn on Etch-a-Sketch