Brian's PIC resource page  
 Please Select a link


  PIC Code

  PIC boards

  RS232 cable


  Mailing list

PIC Code

Here is a fantastic assortment of code to get you started.  I have also included a VERY short Borland C++ (I used the DOS compiler) for accessing the parallel port on your PC.  Please be careful to only use the relevant pieces from the equates file, as most of the programs will not work without them!   Same goes for the delays.

Please feel free to send your comments / requests at the bottom of the page, but if you would like a reply... you will have to leave your email address too!  The code on these pages have no warranty and are offered for you to download for free and use as you will.

The code below is designed to work with the 16CXX and the 16FXXX series.  The delays will only be accurate if you use a clock speed of 20Mhz but all the code on this page will work with slower clocks, as the IIC protocol and the LCD are not speed dependant.

  • General equates file - Please only extract what you need.

  • Delay routines - Delays for 1 microsecond and 1 second

  • Hitachi LCD display using the HD44780 on board controller

  • General IIC code.  I used this to access the 2404 serial eeprom.  Download the ZIP file to see an actual example.  24LC64.ZIP

  • Interface a 4 by 4 matrix keypad with this code.

  • Serial routine using the bit bang principle. (Oscillator must be 3.6864 Mhz for this routine to work at 9600 N81)

  • Transmitting using the internal Usart. (Oscillator must be 3.6864 Mhz for this routine to work at 9600 N81).  Now includes a software transmit and receive routine with Interrupts using TMR0.

  • Interface to the parallel port on your PC! Here is a short Borland C++ program (you MUST have an ECP port for this).

By the way, if you are into gadgets, take a look at this site.  They ship anywhere in the world too!

Comments and suggestions.  What would you like to see here?



Home | PIC code |PIC boards | FAQ's | Contact Us |