Display information on your TV screen for home applications using a PIC18 microcontroller.

Overview

Display information on your TV screen for home applications. Turn a PIC18 into a B&W Text & Graphics PAL video processor with very few inexpensive hardware, and minimum coding effort.

The library uses a simple 2-resistor ladder as a DAC to generate the composite video signal, making the hardware cost extremely low while providing useful video output capabilities.

Library Features

API Reference

PAL Library API
// Initialization
void PAL_init(unsigned char y);              // Initialize PAL signal, y = vertical lines

// Control
void PAL_control(unsigned char st, unsigned char rd);  // Start/stop signal

// Drawing primitives
void PAL_fill(unsigned char c);              // Fill screen
void PAL_setBorder(unsigned char border);    // Set border color
void PAL_setPixel(int x, int y, unsigned char c);  // Set pixel
void PAL_line(int x1, int y1, int x2, int y2, unsigned char c);  // Draw line
void PAL_circle(int x, int y, int r, unsigned char c);  // Draw circle
void PAL_box(int x1, int y1, int x2, int y2, unsigned char c);  // Draw filled box
void PAL_rectangle(int x1, int y1, int x2, int y2, unsigned char c);  // Draw rectangle

// Text
void PAL_char(int x, int y, char chr, unsigned char c);  // Draw character
void PAL_write(int x, int y, char *str, unsigned char c);  // Write RAM string
void PAL_constWrite(int x, int y, const char *str, unsigned char c);  // Write const string

// Bitmap
void PAL_picture(int x, int y, int w, int h, const unsigned char *pic);  // Draw bitmap

Circuit Schematic

PIC PAL video circuit schematic
PIC PAL video circuit schematic

The circuit uses a simple 2-resistor ladder as a DAC connected to the video output pin. This provides the necessary voltage levels for sync, black, and white in the composite PAL signal.

Download

PIC PAL Video Library project files

Download the mikroC project archive:

089-PIC-PAL-TV-mikroc_project.zip

Includes:

  • mikroC project files for PIC18
  • PAL video library source code (PALdemo.c)
  • Pre-compiled .HEX files