Skip to content
  • Home
  • Account
  • Restricted content
  • OBEX
  • Chips Tips
  • Logout
  • Shop
  • QuickBytes
Propeller OBEX
  • OBEX
  • Forum
Login
Propeller OBEX

Propeller 2

  • Configuring Visual Studio Code for Programming the P2 on Mac, Windows, and Linux
  • Breakout Board Options for P2 Edge Modules
  • Solar Panel Monitoring Demo (Intro to Using Video 3 of 3)
  • Wireless Programming with the ESP8266 WX Module
  • Brushless DC Motor Control Demo
  • Colorful Terminal Output with ANSI Escape Sequences
  • XBee RF Transparent and API Mode Demo
  • DS3231 Real Time Clock I2C Demo
  • Multiple Servo Control (up to 64) Object
  • Multiple Serial Port (8 UART – 16 Tx/Rx) Object
  • Goertzel Operation with Ultrasonic Transducers
  • Web Page Control of WS2811 LEDs Using the IoT Gateway on Raspberry Pi
  • 320×240 LCD Driver for ILI9341 Controller and XPT2046 Touch Screen
  • Digital Sample ADC to DAC + Analog Frequency to DAC
  • Using Smart Pins to Measure Frequency Output of TSL235R Light-to-Frequency Sensor
  • Ping))) Ultrasonic Distance Sensor with Graphical Debug Demo
  • Simple Analog Input
  • P2 Edge 16 MB Flash Reader and Explorer Utility
  • LED Matrix used as an I/O Test Utility
  • Arlo Conversion to P2 with the Universal Motor Controller
  • Five Buttons On One Pin
  • P2 RTC Add-on Board Demo
  • Simple Video Driver – Using Images (Intro to Using Video 2 of 3)
  • Starting Your P2 Project with a Spin2 Template
  • E-Ink Display Demo
  • MAX7219 LED Display SPI Demo
  • DHT11, DHT22, CM2302 Humidity and Temperature Sensor Object
  • NMEA GPS String Parsing
  • Floating Point Math: DEBUG and Terminal Display Example
  • LEDs – Beyond the Basics
  • Quadrature Encoder Object
  • P2 RTC Add-on with GPS Module
  • DVI/VGA Text Driver Demo
  • PCF8574 I2C LCD Demo
  • Simple Sound Engine Demo
  • 1-Wire Driver with DS18B20 Temperature Sensor Demo
  • Send Email from the Propeller 2 Using the IoT Gateway on Raspberry Pi
  • I2C Device Bus Scanner Utility
  • 32-Channel ADC Object
  • Tetris
  • Video Hardware with Character Map Demo (Intro to Using Video 1 of 3)
  • WS2811, WS2812, WS2812b, WS2813, SK6812x NeoPixel Object
View Categories
  • Home
  • Docs
  • Quick Bytes
  • Propeller 2
  • DVI/VGA Text Driver Demo

DVI/VGA Text Driver Demo

Reading Time: 4 min read

Description #

Forum member rogloh created this easy-to-use text driver API layer that simplifies the setup in his VGA/DVI/TV driver for a single 16-color text screen at a given resolution. This self-documented driver works in both Propeller Tool and FlexProp.

Some features of this driver:

  • easily setup to output via VGA/DVI at different resolutions
  • automatic HW cursor control (hidden/block/underline/flashing/solid/colour) and positioning
  • window scrolling, clearing to end of line, or screen
  • an independent foreground and background colour per character
  • driver can process CR/LF/BS/TAB/FF and scrolls screen automatically
  • optional flashing text attribute, double high, double-wide pixels are options
  • configurable fonts and height, 8 pixels wide, or 16 pixels wide with a 128 character set
  • can be readily coupled to SEND()
  • the P2 PLL and clock speed is automatically setup for you, no extra config is required

To begin to use this driver to output VGA in 800×600 resolution, for example, is as simple as identifying the BASE_PIN for video:

CON
    BASE_PIN  = 0             ' set to the base VGA pin group (HSYNC pin number)
    VSYNC_PIN = BASE_PIN + 4  ' VSYNC pin number for A/V board wiring 

and identifying the p2textdriv object:

OBJ
    vid: "p2textdrv"

. . and start using it.

PUB start()
    vid.initVga(-1, BASE_PIN, VSYNC_PIN, 0, vid.SVGA) ' choose VGA, SVGA, XGA, etc 
    send := @vid.tx
    send("Hello World")

Four Spin2 demos using this are included in the zip file along with an updated P2 low-level video driver (p2textdrv.spin2). The demos are:

  • helloworld.spin2 – very simple hello world example showing easy setup of the text driver with VGA output
  • helloworld_dvi.spin2 – same as helloworld.spin2 demo but with DVI output instead of VGA
  • textdemo.spin2 – a demonstration to show the text driver’s features (VGA & DVI selectable)
  • widefont.spin2 – an example of using a 16 pixel wide font (outputs VGA)

helloworld.spin2 example:

textdemo.spin2 example:

widefont.spin2 example:

In DVI mode, the video driver is able to output up to 800×600 at 50Hz, as well as 800×480 and 640×480 with the default timings for those. The driver API does also support creating your own custom video timings which is functional now but these demos are not yet making use of that particular feature. You can always try that out to see what is possible.

The default text driver is configured to store text at up to 1920×1200 resolution with a 6 scan line font (240 columns x 200 rows) because that can potentially be setup as part of the provided demos when experimenting with them and I didn’t want it to run out of memory if people tried that so I just maxxed it out. In practice, this can and should be reduced down more realistic size to save on-screen buffer memory in a real application that does not require that high an overall screen resolution.

Adjust MAXPIXELS, MAXLINES and MINFONTHEIGHT in the p2textdrv.spin2 object to suit your own requirements if you intend to use this driver more efficiently in your own applications.

CON
        MAXPIXELS = 1920    ' configure these for your maximum supported resolution 
        MAXLINES  = 1200    ' or excessive memory will be used!

        MINFONTHEIGHT = 6   ' set to your smallest font's height

Developer Notes:

It should be compatible with the Parallax WVGA LCD panel over HDMI with the provided timing (based on some previous results from @dgately) but I have not got one of those LCD panels to test it out for myself.

The P2 text driver API is very solid at this stage for displaying text from a P2, but I am still experimenting a little and testing it and optimizing its performance and I may add a couple more features in time. This is not final released software but considered part of a beta release 0.92b. I’ll try to keep the API names stable but can’t guarantee there won’t be any more changes there. Work on further demos for the new external memory framebuffer capabilities this updated video driver now supports with the HyperRAM/HyperFlash external memory breakout board needs to happen along with the proper documentation and more code tidyup.

Parts Used #
  • P2 Edge Module
  • P2 Edge Breadboard
  • P2 Eval A/V Breakout Add-on Board (#64006H)
Source Code #
  • p2textdriver0_92b.zip
Programming Language #
  • Spin 2
  • PASM2
Tools and Operating System #
  • Propeller Tool for Windows
  • FlexProp for Windows, Mac and Linux
Additional Resources #
  • P2 DVI/VGA Driver (P2 discussion forum thread)
Document Author #
  • Ken Gracey (from rogloh content)
Source Code Author #
  • rogloh
Was this useful ?

Share This Article :

  • Facebook
  • X
  • LinkedIn
Still stuck? How can we help?

Still stuck? How can we help?

Updated on September 29, 2026
P2 RTC Add-on with GPS ModulePCF8574 I2C LCD Demo
Table of Contents
  • Description
  • Parts Used
  • Source Code
  • Programming Language
  • Tools and Operating System
  • Additional Resources
  • Document Author
  • Source Code Author

Copyright © 2026 - Parallax Inc.
599 Menlo Drive | Rocklin, CA 95765 | USA