|
|
Communication between the MPC823 and MPC555 was done via a 32-bit
instruction sent across RS232. When data was ready at the MPC823 end, an
interrupt was triggered with data ready to be sent stored in a global
register. Then through a process of sends and acknowledgements, 8-bits per
transactions and 4 transactions were sent at once to create a 32-bit instruction
send. At the receiving end, the data was then parsed, and the appropriate motor
or servo pin was driven in the MPC555.
The RC car itself had a servo that controlled the left and right movements.
There is a built in motor that controls the forward and backwards motion,
which was controlled via H-bridge. Three servo's were used in the turret
design. One servo was used to allow for left-right movements, another was
used for the up-down movements, and a last servo was used to shoot
the projectiles.
The RC was car controlled by the MPC555 processor. This processor was programmed
using C. We used 5 different PWM channels from the MPC555 to generate PWM channels
for the servos and motors. Three pins were also used to control the motor direction
and laser pointer. We also needed several voltage dividers so that we could
provide 5V for the MPC555 and the servos while providing 7.2V to the motor.
Click on the following links to learn more about our controller and display.
Nintendo 64 Controller
LCD Character Display
The following is a table of opcodes that we used to execute instructions.
We did not have a use for 32-bit instructions so we instead, packed 4
smaller instructions into the register so that 4 instructions could be sent
in a single tranaction.
| Opcode |
Argument |
Functionality |
| 0000 |
0000 |
Noop |
| 0001 |
XXXX |
Throttle based on argument. Argument is sign extended so a positive
value means to go forward and a negative value means to go backwards.
Magnitude of value is the speed.
|
| 0010 |
XXXX |
Turn based on argument. Argument is sign extended so a postive
value means to turn. If negative go right, if positive go left.
The magnitude of the argument determines the angle of the turn |
| 1000 |
0001 |
Enable/disable the laser |
| 1000 |
0010 |
Fire both projectiles |
| 1000 |
0011 |
Enable/disable the RC car. When disabled, all car components
return to default position |
| 1000 |
0100 |
Raise the turret |
| 1000 |
0101 |
Lower the turret |
| 1000 |
0110 |
Move the turret left |
| 1000 |
0111 |
Move the turret right |
| 1000 |
1000 |
Shoot the left turret |
| 1000 |
1001 |
Shoot the right turret |
|