The CRT Controller How to modify CRTC registers to achieve a non-standard horizontal and vertical screen resolution.

Slides:



Advertisements
Similar presentations
The 8051 Microcontroller and Embedded Systems
Advertisements

VGA Text Mode An introduction to font selection and to reprogramming of the Character Generator ram.
1 PC Peripherals for Technicians PC Peripherals for Technicians Chapter Video Graphics Mode Operation Chapter Video Graphics Mode Operation.
1 Graphic adapters and monitors – the summary. 2 Outline The summary of principles of displaying the information – adapters and monitors. Black and white.
Early PC Graphics Capabilities of the IBM Color Graphics Adapter (CGA) and Enhanced Graphics Adapter (EGA)
CS 686: Programming SuperVGA Graphics Devices Introduction: An exercise in working with graphics file formats.
Programming Super-VGA Graphics Devices Introduction to VESA graphics modes and to organization of the linear frame-buffer memory.
PC Peripherals for Technicians
A code-walkthrough Commentary on our ‘wfmodel.cpp’ demo-program – an initial ‘prototype’ for 3D wire-frame animations.
1 Hardware and Software Architecture Chapter 2 n The Intel Processor Architecture n History of PC Memory Usage (Real Mode)
EET Advanced Digital Display Adapters. A vital part to the system provides the visual part of the Human/Computer interface In boot process, goes.
Display Technology  Images stolen from various locations on the web...
Michener’s Algorithm An efficient scheme for drawing circles (and filling circular disks) on a raster graphics display.
Display of Objects on Screen. COUNTERS b A horizontal counter represents the horizontal position of the monitor’s electron beam. b A vertical counter.
Wire-frame Modeling An application of Bresenham’s line-drawing algorithm.
Vertical Retrace Interval An introduction to VGA techniques for smooth graphics animation.
Graphics Bitmaps Drawing characters glyphs and multicolor patterns.
How to do ‘page-flipping’ The steps needed when revising our ‘wfmodel1.cpp’ prototype to achieve ‘smooth’ animation.
Early PC Graphics Capabilities of the IBM Color Graphics Adapter (CGA) and Enhanced Graphics Adapter (EGA)
A device-driver for Video Memory Introduction to basic principles of the PC’s graphics display.
VGA Color Registers How we can reprogram the Digital-to-Analog Converter’s 256 color-table registers.
Vertical Retrace Interval An introduction to VGA techniques for smooth graphics animation.
VGA Port Discussion D9.1. Raster Scan Displays Electron beam CRT.
SiS 315 An introductory exploration of features of the SVGA graphics processor used in our classroom’s workstations.
Drawing Lines The Bresenham Algorithm for drawing lines and filling polygons.
EET Advanced Digital Display Adapters. A vital part to the system provides the visual part of the Human/Computer interface In boot process, goes.
Copyright © 2007 Heathkit Company, Inc. All Rights Reserved PC Fundamentals Presentation 40 – Displays and Resolution.
Presentation by David Fong
 A monitor or display is an electronic visual display for computers.  The monitor consists of : o the display device o circuitry o enclosure The display.
Introduction to VGA Wei Miao Yuxuan Zhou 1. 2 VGA VGA = Video Graphics Array Introduced by IBM in 1987, still using today All points addressable Transmitting.
Bitmapped Images. Bitmap Images Today’s Objectives Identify characteristics of bitmap images Resolution, bit depth, color mode, pixels Determine the most.
Video Monitor Uses raster scanning to display images
Peripherals The term peripherals refers to all hardware devices that are attached to your computer and are controlled by your computer system Peripherals.
display screens and ergonomics
ORG ; FOUR INT 21H and INT 10H Programming and Macros Dec Hex Bin
ECE291 Computer Engineering II Lecture 9 Josh Potts University of Illinois at Urbana- Champaign.
Lecture No. 3.  Screen resolution  Color  Blank space between the pixels  Intentional image degradation  Brightness  Contrast  Refresh rate  Sensitivity.
Video Monitor Uses raster scanning to display images –Beam of electrons illuminates phosphorus dots on the screen called pixels. Starting at the top of.
Objectives Differentiate between raster scan display and random scan display.
Introduction to Experiment 5 VGA Signal Generator ECE 448 Spring 2009.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL VGA Display Part 1 VGA Synchronization ECE 448 Lecture 9.
Lab 8 Bit-Mapped Graphics Moving from text-based graphics to bit- mapped graphics. Easy to draw graphic points and lines using INT 10h, Function 0Ch (write.
Video Monitor CRT: Cathode Ray Tube
Using HiColor graphics
ECE291 Lecture 12 Mode 13h Graphics. ECE 291 Lecture 12Page 2 of 27 Lecture outline Color theory Video Hardware Mode 13h Graphics File Formats.
ECE291 Computer Engineering II Lecture 15 Josh Potts University of Illinois at Urbana- Champaign.
Video systems. Lesson plan Review the code for the previous exercise Video systems Review for midterm exam.
1 Objectives Objectives Explain how video displays work Explain how video displays work CRT and LCD monitors Understand the concept of resolution Understand.
Digression on r/w ‘/proc’ files An application of kernel module programming to Super VGA graphics device control.
Figure 10.1 Color CRT and Phosphor Dots on Face of Display.
YCbCr 4:2:2 with Embedded Syncs In / RGB Graphics Out Using an SDTV Generic Setup CSC Setup for HD YCbCr to RGB REG 0x04 = 0x81 // csc_ric1 0x05 = 0xD5.
4. Kernel and VGA ENGI 3655 Lab Sessions. Richard Khoury2 Textbook Readings  None.
Week 9 Monitors and output to the screen. Monitors, also known as Visual display units (V.D.Us) Desktop computers contain a Cathode Ray Tube (C.R.T.)
Graphics Cards and Monitors. GRAPHICS CARDS components video processor (and GPU)GPU video RAMRAM video ROM BIOS video DAC (DVI adapters don’t)(DVI resolution.
Lecture 11 Text mode video
Direct-Access Color Graphics Chapter 11. Graphics modes C++ provides a different combination of graphics characteristics. These characteristics include.
TFT-LCD Display + Camera
1 COMP541 Video Monitors Montek Singh Mar 11, 2016.
80C51 Block Diagram 1. 80C51 Memory Memory The data width is 8 bits Registers are 8 bits Addresses are 8 bits – i.e. addresses for only 256.
Computer Graphics Lecture 03 Graphics Systems Cont… Taqdees A. Siddiqi
Graphics Basic Concepts 1.  A graphic is an image or visual representation of an object.  A visual representation such as a photo, illustration or diagram.
Problems in IO CS 1550 Recitation December 2 nd /4 th, 2002 The questions in this slide are from Andrew S. Tanenbaum's textbook page 376, 377.
DISPLAY DEVICES CIS 10, Group #1 April 01, 2006 C. X. A. L. K. H. A. V. ((( L. C.
COMP541 Video Monitors Montek Singh Oct 7, 2016.
Flowchart of basic interrupt mechanism
COMP541 Video Monitors Montek Singh Sep 15, 2017.
Microprocessor and Assembly Language
Graphics Hardware: Specialty Memories, Simple Framebuffers
COMP541 Video Monitors Montek Singh Feb 6, 2019.
Embedded Image Processing: Edge Detection on FPGAs
Presentation transcript:

The CRT Controller How to modify CRTC registers to achieve a non-standard horizontal and vertical screen resolution

Video bandwidth PC systems display pixels at a rate that is determined by an internal hardware timer An oscillator generates this rate-frequency (it is known as the ‘dot clock’) Modern SVGA systems can select among several different dot clocks Faster dot clock rates are used with higher screen-resolutions

Example: VESA mode 0x101 Radeon BIOS programs CRTC hardware for 640-by-480 screen-resolution (8bpp) Screen refresh-rate is 60 Hz (frames/sec) This mode uses a 25.2 MHz Dot Clock One pixel is drawn per dot-clock oscillation But extra time is needed for the horizontal and vertical retrace operations

Horizontal timing parameters Horizontal Display-Enable End Horizontal Blanking Start Horizontal Retrace Start Horizontal Retrace End Horizontal Blanking End Horizontal Total

Vertical timing parameters Vertical Display-Enable End Vertical Blanking Start Vertical Retrace Start Vertical Retrace End Vertical Blanking End Vertical Total

Dot-clock operation Two internal counters are used: –The character-counter (horizontal) –The scanline-counter (vertical) Both counters start from zero After eight dot-clocks, the character-counter is incremented (since character-width is 8 pixels) When character-counter reaches the horizontal total, the scanline-counter is incremented (and the character-counter is reset to zero)

Dot-clock operation (2) When scanline-counter reaches vertical total, both counters are reset to zero (and a new frame begins to be displayed) As the counters reach programmed values for the horizontal and vertical parameters, the CRT enters a different ‘state’ (such as screen blanked, or a retrace operation)

The ‘border color’ After the ‘display-enabled’ state ends, and before the ‘display-blanked’ state begins, a traditional CRT displays a ‘overscan color’ The overscan-color is programmable (and normally is set to ‘black’ by default) On our classroom’s LCD monitors, we do see this border color Border width & height are programmable

Example: mode 0x101 Horiz Display-Enable End = 80 chars Horiz Blanking Start = 81 chars Horiz Retrace Start = 84 chars Horiz Retrace End = 96 chars Horiz Blanking End = 99 chars Horiz Total = 100 chars

Horizontal timings visualized Horizontal display enabled Horizontal Retrace is active Horizontal Blanking is active Overscan Color is visible

Example: mode 0x101 (cont) Vertical Display-Enable End = 480 Vertical Blanking Start = 487 Vertical Retrace Start = 489 Vertical Retrace End = 498 Vertical Blanking End = 516 Vertical Total = 525

Vertical timings visualized Vertical display enabled Vertical Retrace is active Vertical Blanking is active Overscan color is visible

Arithmetic Formulae frameRate = dot-clock / (Htotal * Vtotal) 60 Hz = 25,200,000 / (800 * 525) Horizontal freq = KHz (= 25.2 / 800) Vertical freq = 60 Hz

Reprogramming the CRTC We show how to reprogram the CRTC for a (nonstandard) 256-color display-mode We start with standard VESA mode 0x101 Then we ‘tweak’ this mode my changing the values in five of the CRTC registers Recall that CRTC registers are addressed using a pair of i/o ports: 0x3D4 and 0x3D5

Order for our modifications Our ‘mymode.cpp’ demo does these steps: 1)Lower Horizontal Display End by 8 chars 2)Lower Vertical Disply End by 48 lines 3)Reduce Horiz Retrace Start by 5 chars 4)Reduce Vertl Retrace Start by 15 lines 5)Adjust Offset for narrower screen pitch

Register details Unlock CRTC timing registers, by clearing bit 7 in Vert Retrace End reg (index 0x11) Perform ‘image clipping’ (horiz & vertl): –Horizontal Display-Enable End (index 1) outw( 0x4701, 0x3D4 );// 0x4F  0x47 –Vertical Display-Enable End (index 0x12) outw( 0xAF12, 0x3D4 ); // 0xDF  0xAF

More register details Perform image-centering (horiz & vertl): –Horizontal Retrace Start (index 0x04) outw( 0x5004, 0x3D4 );// 0x55  0x50 –Vertical Retrace Start (index 0x10) outw( 0xDA10, 0x3D4 );// 0xE9  0xDA Adjust CRT Offset register (reduced pitch) –Offset Register (index 0x13) outw( 0x4813, 0x3D4 );// 0x50  0x48

Motivation for mode-tweak Consider mode 0x101 memory-required 640x480 = 307,200 pixels 256-colors: requires one byte-per-pixel Total memory exceeds 4*64K (= 262,144) Consider tweaked memory-requirements 576x432 = 248,832 pixels Total memory does NOT exceed 4*64K

Legacy VGA addressing VGA can be programmed to access vram using 128K window: 0xA0000 – 0xBFFFF Hardware can be programmed to access vram in ‘planar’ mode (4 bytes in parallel) Thus two ‘pages’ of planar vram could be available for graphics animations, using ‘square’ pixels and 8086 real-mode 16-bit memory-addressing (cf Abrash ‘ModeX’)

In-class exercise Compile and run our ‘mymode.cpp’ demo Observe final image ‘isn’t centered right’ Can you alter the CRTC register changes that we used to produce a ‘better centered’ screen image? (horizontally & vertically)