NES Controller Display Board
The NES controller, ahhh brings back memories of when games were good. Basically this board tells you which button is being pressed on the controller at any given time. I got this idea from here
The NES controller uses serial communication to tell the NES console what state it is in. It does this by way of the 4021 IC, an 8-bit shift register, or a parallel to serial converter. To start off communication the strobe line is pulsed high. This tells the chip to load the value of the 8 parallel inputs, this value is then "shifted" through the serial output line at a certain clock rate. There are 8 different buttons on the NES controller: A, B, Up, Down, Left, Rigth, Select, and Start. Each of them are hooked up to a parallel input and correspond to a certain bit.
| Bit # (Clock Cycle) | Button |
|---|---|
| 1 | A |
| 2 | B |
| 3 | Select |
| 4 | Start |
| 5 | Up |
| 6 | Down |
| 7 | Left |
| 8 | Right |
Depending on how you have the 4021 chip set up the parallel input pins can be normally pulled high or pulled low. For those non-technical people out there it means that the state of the input pin will be by default 1 (pulled high) or 0 (pulled low). In the case of the NES controller the input pins are pulled high, which means that an unpressed button is represented by a 1 at that bit. So when you push a button the input pin is pulled low and that state is represented by a 0.
The diagram below illustrates how the NES console would get the button state from the controller. In this example just the "B" button is pressed and we can see it here represented by 0 in the serial out line. Notice also on the diagram that the "B" happens after the 2nd clock cycle on the falling edge of the clock line.
Because the output of the NES controller is serial, reading and interpreting the data should be a breeze. This is where the famed microcontroller makes its appearance. Ah good ole micro what can't it do? *cough* floating point *cough*. But thankfully we don't have to worry about that. One candidate for this project would be a micro with the 8051 architecture (eg. the ATMEL AT89S53). This chip can receive and transmit serial data, and can be written in an abundance of programming languages. But for this project I chose the all mighty PIC16F628. Why the PICmicro??? Well first of all you can get them cheap as free from Microchip as samples. Secondly, all the pins can transmit or receive serial data. Lastly, I chose this chip in particular because of the 4 MHz internal oscillator.
