Navigation bar
  Print document Start Previous page
 3 of 7 
Next page End  

HARDWARE DESIGN
N64 Controller
The N64 controller was used to control the robot. A write was sent to the controller every
2ms, using a general purpose timer. Upon receiving the write, a hardware controller sent
a polling request to the N64 controller, on a bidirectional serial line. The response was 16
bits corresponding to the buttons currently pressed. When the response was done, the
hardware controller sent an interrupt.
The polling request was made with a shift register clocked at 1us, which was reloaded for
every bit sent. The serial data capture was made by hooking a falling edge detector up to
a timer, which waited approximately 2.5 us, then sent a command to sample the signal
and store it in a shift register.
Button “A” was 0x1, “B” was 0x2, all the way to 0x8000 was c-left(the bits were
reversed). If you want a full input map, along with details about the analog hardware
implementation, follow this link. 
H-Bridge & DC motor
As we have mentioned above, this was used to be able to drive the robot in forward and
reverse as well as left and right. The motor were controlled by four bits from the address,
0x3400000. The motors basically go off when four bits are set or none of them were set.   
Instead of using a timer to control the duty cycle for dc motors, we implemented a clock
divider and a PWM generator. The clock divider basically divides the system clock so
that the clock cycle out from the clock divider is 1ms. The PWM generator is actually
made of a 16 bit counter which counts up to 100, which is equal to 100ms. Based on the
data from the last four bits of the address, the PWM generator determines if it should
output 1 for either 50ms or 0 ms out of 100ms. 
Servos
Since we used four servos for different tasks, we used four different addresses to control
them. We also used the clock divider and the PWM generator instead of using a general
purpose timer. The clock cycle from the divider is 0.1ms instead of 1ms. The 16bits
counter also counts up to 1000 to keep 100ms interval. 
Servo 1
This servo was used for rotating the body of robot. The last three bits from address
0x3800000 were used for this servo. 
DATA(bit29, bit30, bit31)
Duty Cycle of PWM generater
000
001
010
011
100
Servo 2
This servo was used for triggering the gun. The last two bits from address 0x3500000
were used for this servo. 
DATA(bit30, bit31)
Duty Cycle of PWM generator
00
0.6ms/100ms