High-Level Design

Since the goal of this project was to emulate the 6502 chip, most of the work consisted of programming, and the amount of hardware needed was minimal. Besides using the Atmel Mega32 microcontroller chip, we needed to use a 32K external SRAM chip as the data memory for the 6502. Additionally, we needed a way to load 6502 code into the Atmel's memory. We decided that the best way to do this was through the USART's RS-232 connection on the Atmel. A block diagram of the complete emulator is shown below:

Once the Atmel has been turned on and the user has opened a connection to the Atmel via Hyperterm, the first thing they must do is load a 6502 program onto the chip. In Hyperterm the user gives the Atmel a command telling the microcontroller that a program will be loaded. The user will then send the program binary via Hyperterm to the microcontroller using the Xmodem protocol. Once the microcontroller has received the binary, it will send a reply via Hyperterm, confirming that the program has been loaded. Upon completion, the user can then run the program, and while it is running the microcontroller will send the results of each instruction back to Hyperterm. The user can then choose to either run the program again or load a new program to run.

In order to implement these features, we designed various state machines to control the different aspects of the system, which are described in the software section of this site. The hardware section of this site gives an in-depth look at the integration of the three main components of our project.