0% found this document useful (0 votes)
85 views

Project Number: A3179 Composite Text Video Display: Theory of Operation

The project describes a circuit that generates a 40x25 character composite video display on a TV using an ATmega8 microcontroller. It uses two timer interrupts, one to generate sync pulses and the other to output character font data to a shift register. The main program receives input and updates RAM, while the interrupt service routine generates the video signal by matching character data to font patterns. It can interface with a host device to display text and respond to cursor/scrolling commands in a 3k program on a small PCB.

Uploaded by

Nilav Chokshi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views

Project Number: A3179 Composite Text Video Display: Theory of Operation

The project describes a circuit that generates a 40x25 character composite video display on a TV using an ATmega8 microcontroller. It uses two timer interrupts, one to generate sync pulses and the other to output character font data to a shift register. The main program receives input and updates RAM, while the interrupt service routine generates the video signal by matching character data to font patterns. It can interface with a host device to display text and respond to cursor/scrolling commands in a 3k program on a small PCB.

Uploaded by

Nilav Chokshi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Project Number: A3179 Composite Text Video Display

The Composite Video Text Display can generate a 40x25 character display on a standard television set through the composite video input jack. The circuit supports the North American NTSC standard and the PAL standard. Theory of Operation The circuit is based around the ATmega8 microcontroller. It has enough speed and internal resources to provide a basic black and white display with a minimum of external parts (see Fig. 1). The software takes only 3k of the program memory, leaving enough space to provide a 512 character font. Display data is stored in the internal RAM. Program operation involves two processes (see Fig. 2). The main loop receives data from the Host device and updates the internal RAM accordingly. The 8-bit data presented at the input can contain either a character or command. A character can be any printable ASCII character such as letter, numbers, and punctuation marks. Commands include several ASCII control characters such as line feed, carriage return, tab, and backspace. In addition, the cursor can be placed anywhere on the screen, turned on and off, and displayed as underscore, block, blinking or solid. To generate the composite video signal, you need to provide video synchronization (sync) pulses and picture data. One of the ATmega8s internal timers is used to generate interrupts every 63.5s. Interrupt service routines are used to provide the necessary sync pulses via a digital I/O port. The picture data is generated by matching the character data from RAM with the appropriate font data in program memory. The font data is written to a shift register and the resulting serial data is combined with the sync pulses to generate the display. The Interrupt Routines use Timer 1 in a two-stage method to ensure exact timing. Using Mode 4 (CTC), Output Compare Register A (OCR1A) is set to provide interrupts every 63.5us. Output Compare Register B is set to interrupt the system just prior to OCR1A with enough time to save system settings and put the CPU into sleep mode. This ensures the OCR1A interrupt is responded to at exactly the same time (very important to proper sync timing). Heres how its looks:
TIM1_COMPB: in sbi effect) sbi sei sleep out reti savsr, SREG portc, syncpin portc, ackdpin ; IRQ service for OCR1B ; save the status register ; raise the sync pin (its low during VSYNC, else no ; ; ; ; ; ; ; ; ; ; raise dack pin (if it was low just before irq) this keeps host from waiting... enable IRQ before we sleep so OCR1A can work wait for TIM1_COMPA IRQ restore the status register all done, go back to Main Prgm IRQ service for OCR1A file that holds the video generation code done. Resume after the sleep instruction in the OCR1B routine above.

SREG, savsr

TIM1_COMPA: .include "vidgen.inc" reti

Using the Display The circuit was assembled onto a double-sided PCB measuring only 2.5 x 1.9 (see fig. 3). The circuit can be connected to any device capable of producing the 8-bit data and an active high strobe. The Busy line should be monitored to ensure the previous command has completed. This is especially true during scrolling operations, as it can take several milliseconds to scroll the entire screen. If you cannot monitor the busy line, then give at least 25 milliseconds between characters to prevent data loss. After power up, the circuit initializes itself and displays a startup banner (see Fig. 4). Initial state is Primary font selected, lower 128 character mode enabled, with a blinking underscore cursor. To clear the screen, you can send a

Form Feed control character - $0C (hexadecimal notation). The screen will clear and the cursor will move the upper left corner. The lower 128 input bytes for both fonts represent the standard ASCII character set. This allows the display to emulate a simple terminal without special encoding from the host. To allow for maximum control, the upper 128 bytes are used for cursor movement, scrolling and mode changes. These commands are always mapped in and available, regardless of font or mode selection. The ATmega8 makes easy work of generating simple composite video!

Figure 1. Schematic

Main Program

Interrupt Service Routine

Initialize program variables Read the NTSC/PAL pin Setup Timers for Interrupts Fill display RAM with a startup

Update line counters Generate Sync Pulses

Is the BUSY pin High?

Active Display line?


No No Yes

Yes

Get the input byte Decode input byte Update Display SRAM

Read display characters Convert to font data Output to shift register

Return Clear the BUSY line

Figure 2. Software Block Diagram

Figure 3. Assembled Project

Figure 4. Sample Display

You might also like