Parallel port LED display
I was looking at some POV display projects, wondered what I could put together with the parts I had in hand.
I came up with this 8X10 dot matrix display controlled using the computers Parallel port.
Used a simple C program to drive the LED board, the program was written to run under Linux, but would not be too hard to convert to MSDOS.
The same code could be used as a basis for a micro processor based unit also, like the pic, Arduinno, etc.
Some images of the completed boards, all done with prototyping boards from Radio Shack and wire wrap.
I have drawn up Schematics and board layout in the Free version of Eagle Schematic layout software. you will find the links below.
Also have Schematics in PDF format.
C source code requires the parapin parallel port library (can be downloaded from the internet) and the font header file listed below.
Disclaimer: I am not responsible for errors, in the Schematic or board design. Use at your own risk, I have not had any of the board made.
My designs are free to use for non-commercial use.
You will need to download from the internet the parapin Libary.
/*************************************************************************** * Copyright (C) 2008 by Eric Stringer * * eric.stringer@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/
#include <stdio.h>#include <stdlib.h>#include <unistd.h>
#include <parapin.h>#include "font8x5.h"
int main(int argc, char *argv[]){ int pin_sequence[] = { 2, 3, 4, 5, 6, 7, 8, 9, -1}; int i,j,k,m, c, d[10]; int prev = 0; char buf[240]; char dbuf[11];
if (pin_init_user(LPT1) < 0) exit(0);
pin_output_mode(LP_DATA_PINS | LP_SWITCHABLE_PINS); set_pin( LP_PIN[2] ); set_pin( LP_PIN[3] ); set_pin( LP_PIN[4] ); set_pin( LP_PIN[5] ); set_pin( LP_PIN[6] ); set_pin( LP_PIN[7] ); set_pin( LP_PIN[8] ); set_pin( LP_PIN[9] ); set_pin( LP_PIN[14] ); set_pin( LP_PIN[16] ); clear_pin( LP_PIN[16] );
i = -1; c = 0; while (1) {for(m = 0; m < 50; m++) { lp_clear_column_counter(); for(k=5; k >= 0;k--) { if (pin_sequence[++i] == -1) i = 0; lp_byte_write( Font8x5[48 + c][k] ); // for(j=0; j <= i; j++ ) clear_pin(LP_PIN[pin_sequence[j]] | prev); // set_pin( LP_PIN[1] ); // clear_pin(LP_PIN[1]); usleep(1000); clear_pin( LP_PIN[14] ); set_pin(LP_PIN[14]); // for(j=0; j <= i; j++ ) set_pin(LP_PIN[pin_sequence[j]] | prev); }; /* prev = LP_PIN[pin_sequence[i]]; */
i=0; };c++;if (c > 42) c = 0; } }
int lp_clear_column_counter(){set_pin( LP_PIN[16] );clear_pin(LP_PIN[16]);}
int lp_byte_write( n ){if ( (n & 0x01) != 0 ) clear_pin(LP_PIN[2]); else set_pin(LP_PIN[2]);
if ( (n & 0x02) != 0 ) clear_pin(LP_PIN[3]); else set_pin(LP_PIN[3]);if ( (n & 0x04) != 0 ) clear_pin(LP_PIN[4]); else set_pin(LP_PIN[4]);if ( (n & 0x08) != 0 ) clear_pin(LP_PIN[5]); else set_pin(LP_PIN[5]);if ( (n & 0x10) != 0 ) clear_pin(LP_PIN[6]); else set_pin(LP_PIN[6]);if ( (n & 0x20) != 0 ) clear_pin(LP_PIN[7]); else set_pin(LP_PIN[7]);if ( (n & 0x40) != 0 ) clear_pin(LP_PIN[8]); else set_pin(LP_PIN[8]);if ( (n & 0x80) != 0 ) clear_pin(LP_PIN[9]); else set_pin(LP_PIN[9]);clear_pin( LP_PIN[1] );set_pin(LP_PIN[1]);}
};