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
- For PIC18 family only
- Must be clocked at 32 MHz (8 MHz crystal with PLL)
- Generates 625-line interlaced PAL signal
- Up to 248 vertical lines of 128 pixels
- Uses inline assembly mixed with C for optimal performance
- Text and graphics drawing primitives
- Minimal external hardware required
API Reference
// 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
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