ECPE-5 - PIC Project Board

Rev. F ( Pictures and notes from Rev E.)
J. Dunmire
February 8, 2003


The ECPE-5 PIC Project Board is designed to meet the goals set forth in "ECPE-5 PIC Experimental PCB". This board will be used for two or more of the labs associated with ECPE-5 as taught by Dr. Richard Turpin at the UOP School of Engineering and Computer Science.

In addition to the core requirements set forth in "ECPE-5 PIC Experimental PCB", the PIC Project Board includes a sub-section with dot matrix displays, switches and a potentiometer. This sub-section was designed to support a BCD clock project envisioned by Dr. Turpin. The BCD clock sub-section can be cut off from the main board and used as a daughter board. Dividing the BCD clock sub-section from the main CPU section allows the CPU section to be used with alternate daughter boards in the future.

Ref. F fixes several problems with the Rev E. board and adds a dual output DAC and a digital temperature sensor.


(Actual size = 4.1 x 2.5 inches)

The ECPE-5 PIC Project Board is a self-contained computer that includes a power supply, dot-matrix displays, discreet LED's, push-button switch input, digital to analog converter (DAC), digital thermometer, and a potentiometer for analog control. The project board is based on the Microchip 16F877 RISC microprocessor. The processor includes on-chip I/O ports, 10 bit, ADC, timers, UART, and oscillator.

The remainder of this description is divided into sections along functional lines as indicated in the image above: CPU, Dot Matrix Display, Miscellaneous I/O, Programming Interface, Power Supply, Digital to Analog converter, and Temperature Sensor.


The CPU section consists of the Microchip 16F877 PIC microprocessor (U3), oscillator, reset circuit, and reverse voltage protection.

D5 protects the board against inverse voltage applied to J4. To make full use of this protection, the external power supply should be fused with a 1amp fuse. Otherwise the power supply will be damaged, or D5 will burn out and the CPU will be damaged.

S1 is the reset switch.

There are two options for the CPU clock. The oscillator, composed of a 20MHz crystal and capacitors C7 and C8, can be replace with a three pin 20MHz ceramic resonator. The frequency will not be as precise or stable with the ceramic resonator, but it should be adequate for the WLoader application. Also note that C7 and C8 are 22pF capacitors, but X1 is cut for a 20pF parallel circuit. The larger capacitance values will skew the crystal frequency slightly, but 20pF capacitors were not readily available in through hole packages, nor could a crystal for a 22pf parallel circuit be found.

Dot Matrix Display

The dot matrix display section of the project board can be configured with one large, or two small 5x7 dot matrix LED displays.

U6 is a 1.2 inch high 5x7 dot matrix LED display. It is wired in parallel with a 0.7 inch high 5x7 dot matrix display, U5. U4 is a 0.7 inch high 5x7 dot matrix display that shares row signals with U5 and U6. U6 occupies the same board space as U4 and U5 and therefore can not be installed if either U4 or U5 is present.

The dot matrix LED's are connected to the 16F877 signals as shown below. To turn on a LED, a column signal must be set low and a row signal set high. Resistors R10-R19, connected to the columns, limit the LED current to less than 10mA to protect the 16F877.

Row Signals:

16F877 Signal
LED Display
Row 1
Row 2
Row 3
Row 4
Row 5
Row 6
Row 7

Column Signals:

16F877 Signal
LED Display
Col 1, U5/U6
Col 2, U5/U6
Col 3, U5/U6
Col 4, U5/U6
Col 5, U5/U6
Col 1, U4
Col 2, U4
Col 3, U4
Col 4, U4
Col 5, U4

Miscellaneous I/O

The PIC Project Board include some simple I/O devices for testing and experimental use. These include discrete LEDs, switches, and a potentiometer.

There are four LED's, D1-D4 available for application use. These LEDs are connected to Port C of the CPU. Setting one of the four least significant bits (RC0-RC3) of Port C low will turn on the associated LED. Current through the LEDs is limited to less than 10mA by resistors R6-R9.

There are two switches on the right hand section of the PIC Project Board. S2 is connected to the 16F877 RB6 signal and S3 is connected to the RB7 signal. To use the switches the weak-pullup resistors in the 167F877 must be enabled for Port B bits 6 and 7. Note that bits 6 and 7 of Port B can be configured to generate an interrupt thereby allowing S2 and S3 to be used in an event mode rather than polled.

R20 is a 10k potentiometer connected through the series resistor R22 to signal RE0 of the 16F877. RE0 can be configured as an analog input (AN5) connected to the 16F877's internal 10 ADC. The signal from R20 can be adjusted from GND to VCC.

J3 and J5 are expansion connectors that include all of the signals, except those for the crystal, from the 16F877. The PIC Project board can be cut between these two connectors to create general purpose CPU board and an I/O expansion board. This allows the CPU board to be used in other applications with alternate I/O requirements.

ATTENTION: J3 and J5 are dual row pin headers. Generally the pins on a dual row pin header are number with the even number pins on one row and the odd number pins on the other row. This makes sense when a ribbon cable is connected to the header because the wires in the cable will then be numbered sequentially. However in this application the pins need to correspond to pins on U3. So an alternate numbering scheme is shown inside the body of the schematic symbol for J3 and J5). Using the alternate pin numbering, the signals are the same as those on U3. Refer to the 16F877 data sheet for signal names and pin numbers. Pins 14 and 15 (alternate numbering) on J3 are not connected to avoid degrading the crystal oscillator (X1, C7, C8).

Programming Interface

There are two programming interfaces on the PIC Project Board. J6 is configured specifically for use with the Wisp628 programmer, including the serial pass through option. J6 can also be used, with an appropriate cable, with any PIC programmer that supports In-Circuit Serial Programming (ICSP).

The second programming interface is an RS-232 interface for connection to a PC running the XWisp program, or the older Wisp tool program. To use this interface, connect J1 to an available serial port on the PC. The 16F877 must be preprogrammed with the WLoader program from Van Ooijen Technische Informatica. U1 provides the signal level translation from RS-232 voltage levels to TTL.

J6 - ICSP Interface
  Pin 1 - GND
  Pin 2 - +5v
  Pin 3 - RB6
  Pin 4 - RB7
  Pin 5 - /MCLR
  Pin 6 - LVP (PGM)
  Pin 7 - RC7/RX
  Pin 8 - RC6/TX

Pins 7 and 8 are not required for programming, but can by used with the async serial pass through capability of the Wisp628. They connect to the 16F877 UART pins.

Power Supply

The ECPE-5 PIC Project Board includes a simple +5v power supply composed of a full wave rectifier (D6) and a fixed voltage linear regulator (U2). The power supply components, U2, D6, C5, C6, and J2 can be omitted and a 5v source applied to J4.

J2 - 8 - 35 VDC or 8 - 24 VAC RMS. Designed for a 9 VAC wall transformer with a 2.1mmID x 5.5mmOD female plug. (Jameco #119204)
J4 - Plug compatible with J3 on the ECPE-5 +5v Power Supply. The signals on this connector are arranged so that the connector can be reversed without effecting the operation of the PIC Project Board. Diode D5 protects the board from reversed polarity when the external power supply is protected with a 1 amp fuse.
    Pin 1, 3 - GND
    Pin 2 - 5 VDC

Digital to Analog Converter

U7 is a dual output digital to analog converter (DAC) with 8-bit resolution. The interface to the DAC is a synchronous serial interface which can be driven by the SPI interface built into the 16F877.
Note: The SPI clock is signal RC3 which is also used to drive one of the discrete LEDs, D4. This should not be a problem because RC3 is driven in both the high and the low state. Of course D4 can not be selectively controlled when the 16F877 is configured for SPI use, but D4 will indicate when the SPI clock is active.

The outputs from the DAC are buffered in the IC. Output A will source and sink up to 5mA. The buffer for output B is weaker than the one for output a and will source and sink only 0.5mA.

The DAC outputs and ground are available on J7:
J7 - DAC signals
  Pin 1 - GND
  Pin 2 - Output A
  Pin 3 - GND
  Pin 4 - Output B
  Pin 5 - GND

Temperature Sensor

The temperature sensor, U7, is also a serial I/O device. It uses a 1-Wire interface rather than an SPI interface. The 1-Wire interface uses a single wire driven by open-collector devices as a bi-directional bus. The 16F877 has a very limited number of open-collector (or more correctly, open-drain) signals. RA4 is the only open-collector signal not associated with the SPI interface and would be a good choice for the 1-Wire interface, except that it is already allocated to the column drive signals for U4 (on of the small 5x7 dot-matrix LED displays). Rather than complicate the display multiplexing, two signals (RB5 and RE1) are combined with the transistor Q1 to create the 1-wire interface. RE1 should be configured as an output. The transistor inverts the signal from RE1, so writing a 1 to RE1 will pull the 1-wire bus low. RB5 is the bus input.

The DS1821 has a temperature range of 0-85°C. It can be replaced with a DS1822 which has a temperature range of -10 - +85°C. The DS1822 has the further advantage that it can be bussed with other 1-Wire devices.

Example Configurations

The following paragraphs provide a brief description of the configuration options listed in the costed bill of materials (BOM). These are certainly not the only configurations and are include only as examples of how the Project Board might be used.

BCD Clock

This configuration does not include the +5v power supply. It is intended for use with the ECPE-5 5v Regulated Power Supply. The BCD Clock sub-section is loaded with a large 5x7 dot matrix LED display (U6) and two switches. Only a single discreet LED (D1) is loaded in the CPU section since the 5x7 dot matrix LED display provides additional output options. Only five (R10-R14) of the ten 120 ohm current limiting resistors are needed in this configuration.

A ceramic resonator is used for the CPU oscillator.

To reduce the cost of the the kit and the amount of soldering required, the Project Board is not cut apart and the two 40 pin headers are not included.

BCD Clock v2

The only difference between this configuration and the one above is the CPU oscillator. The ceramic resonator has been replaced with a 20MHz crystal and two 22pF capacitors (C7 and C8).

Full Kit

This configuration includes the +5v power supply, two 5x7 dot matrix LED displays, four discreet LED's, two input switches and a potentiometer connected to a ADC input. 40 pin headers are included to allow the board to be divided into the CPU and BCD Clock daughter board configuration. A short 40pin ribbon connector (not included) would be necessary to connect the two boards.

CPU with 40 pin header

These are the parts required for just the CPU section. All four discreet  LED's are include as is the +5v power supply. A single 40 pin header is included on the assumption that the Project Board has been cut into it's CPU and BCD Clock sub-sections. A ceramic resonator is used for the CPU oscillator.

BCD Clock daughter board - small

This version of the BCD clock uses one of the small 5x7 dot matrix displays (U5). The potentiometer (R20) has been included- perhaps for use as a dimmer control. As in the BCD clock configuration above, only five (R10-R14) of the current limiting resistors are needed. A single 40 pin header is included on the assumption that the Project Board has been cut into it's CPU and BCD Clock sub-sections.

BCD Clock daughter board - large

Like the BCD Clock daughter board - small, except that U5 has been replaced with U6 to provide a larger display.

Dual 5x7 dot matrix display daughter board

The BCD Clock daughter board is configured with both small 5x7 dot matrix displays (U4 and U5). All ten (R10-R19) current limiting resistors are required. A single 40 pin header is included on the assumption that the Project Board has been cut into it's CPU and BCD Clock sub-sections.

Current analysis

Source Formula Current (Amps)
U1, Max 232 Data sheet 15.0E-3
U3, 16F877 Data sheet @ 20MHz 15.0E-3
Dot matrix display x 2 ((VCC - Vf)/R10)*10 90.0E-3
Discreet LEDs ((VCC - Vf)/R6)*4 38.8E-3
Potentiometer, R20 VCC/R20 500.0E-6
/MCLR pull-up VCC/(R5+R4) 156.3E-6

Associated documentation:

You will need the software from PCB123 to view the original schematic (.EPC) and layout (.XPC) files. You will also need an Acrobat viewer to view the PDF (.pdf) files.

ECPE5PIC.EPC Schematic diagram (also in PDF).
Project_Board_Costed_BOM.html Parts list and estimated costs. All parts are available from Digikey. (Excel file)
LM7805_M78xx-MC78xxA.pdf Data sheet for the LM7805.
022052031_sd.pdf Data sheet for a pin header that mates with J3 on the +5v Power Supply.
ee080_ee8_fc_dne.pdf Data sheet for the 47uF capacitor. Note that the hole spacing on the PCB is larger than required for the 47uF capacitor. This is to allow larger value capacitors, or capacitors from alternative vendors. The assumption is that is easier to fit a component into holes that are spaced too far apart than it is to fit them in holes that are too close together.
df.pdf Data sheet for the rectifier, D6.
mID_4594_cID_3568_monokap.pdf Data sheet for the 1uF, 0.1uf, and 0.01uf capacitors.
171-XXX-21X-XX1.pdf Data sheet for the 9-pin D-sub connector.
1n4001.pdf Data sheet for the power input protection diode, D5.
LTP1557AKR.pdf Data sheet for the 1.2 inch 5x7 dot matrix LED display, U6.
LTP757KR.pdf Data sheet for the 0.7 inch 5x7 dot matrix LED displays, U4 and U5.
205812.pdf Data sheet for the dual-row pin headers, J3 and J5.
hc-49us.pdf Data sheet for the 20MHz crystal, X1.
561-xx0x-xxx.pdf Data sheets for the discreet LED's, D1-D4.
MAX220-MAX249.pdf, MAX232,232I.pdf Data sheets for the MAX-232, U1. This part is available from two vendors, Maxim and TI. The parts list calls out the TI part because it is less expensive.
PIC16F87X.pdf Data sheet for the PIC 16F877 CPU, U3. An 'A' version of this processor is available, but Wouter van Ooijen reports that WLoader does not run on the 16F877A just yet.

For reference: PIC16F87XA.pdf and the errata sheet: PIC16F87XA_Errata_Rev_B2.pdf.

201.pdf Data sheet for the potentiometer, R20.
CFR_Series.pdf Data sheet for the resistors.
ZTT.pdf Data sheet for the 20MHz ceramic resonator, X1.
ATK0000CE10.pdf Data sheet for the reset switch, S1, and the two input switches on the BCD Clock sub-section (S2 and S3).
rapc722.pdf Data sheet for the power jack, J2.
DS1821.pdf Data sheet for the temperature sensor, U8. As an alternate, use a DS1822.
MAX522.pdf Data sheet for the DAC, U7.
PN2222A.pdf Data sheet for transistor Q1. Note that almost any general purpose NPN transistor will work in this application.

 Note: All data sheets were obtained from online documentation at

$Date: 2008-10-21 19:17:35 $
$Source: /home/cvsroot/projectsTop/picProjectBoard/ECPE5_Project_Board.html,v $
Contact me by email: jedunmire at