You Are Here: Home » AVR ATmega Projects » Game - Entertainment Projects » Color Video Game on AVR

Color Video Game on AVR




Introduction

Our project is to make a color video game that runs primarily on the ATmega 1284P. To do this, we adhered to the NTSC standard for color video. The sync signals used for NTSC are generated on the ATmega 1284P itself, and all game logic is implemented on the microcontroller as well. To actually encode the color signal, we used an AD724 chip. This is necessary because the color video signal is created by modulating a 3.58MHz signal, and our MCU only runs at 16MHz.

Color Video Game on AVR

Figure 1: our project setup in lab

We chose this project because color video is so prominent in our lives, and we were curious about how it works after doing black and white video in lab 3. For our project, we referenced the many previous color video projects, but we did not reuse the code from previous years. This was mainly because color video requires writing AVR assembly, and the code from previous years was written for the CodeVision compiler and was not compatible with GCC.

High Level Design

Logical Structure

The design of this project can logically be broken down into three parts: the hardware design, the low level software that works with hardware, and the game processing. Both the hardware and software design will be covered in detail in the Program/Hardware Design section, but the overview is as follows:

Schematic Color Video Game on AVR

Figure 2: block diagram of key components

The hardware includes a joystick, the microcontroller and its logic board, the AD724 and its supporting peripherals such as a ~3.58MHz crystal, and an LCD TV with composite video input. The joystick takes user input; this can be up/down, left/right, or activating the built in push button. The microcontroller receives this input and processes it accordingly. It then outputs RGB signals as well as a sync signal to the AD724, which encodes the information into a composite signal, which is then output to the TV.

The low level software interfaces with the hardware. This involves using the ADC to take input from the joystick, using the MCU timers to accurately generate the sync signal, and using assembly code to quickly output data to the GPIO pins for the video signal.

The game logic is processed entirely on the microcontroller. After each frame is displayed, there is time during the vertical blanking period for doing calculations. All game logic is implemented here and will be detailed in the Software Design section.

For more detail: Color Video Game on AVR

Leave a Comment

You must be logged in to post a comment.

Read previous post:
Working with Atmel AVR Microcontroller Basic Pulse Width Modulation (PWM) Peripheral
Working with Atmel AVR Microcontroller Basic Pulse Width Modulation (PWM) Peripheral

Pulse Width Modulation (PWM) is a technique widely used in modern switching circuit to control the amount of power given...

Close
Scroll to top