PIC 16F877 Evaluation board
User Manual
[Link] PIC Evaluation Board User Manual
Table of Contents
Introduction ............................................................................................................................... 3
Board Features ................................................................................................................... 3
Package contains ................................................................................................................. 4
Technical/Customer Support .......................................................................................... 5
Chapter1 On-board peripherals ................................................................................................. 6
1.1 In-System Programming ............................................................................................ 6
1.2 RS232 in Asynchronous mode .................................................................................... 9
1.3 Configuring Hyper Terminal ..................................................................................... 11
1.4 Single channel ADC................................................................................................... 13
1.5 External Reset on MCLR ........................................................................................... 14
1.6 External Interrupt ..................................................................................................... 15
1.7 I/O Connections ....................................................................................................... 16
1.8 LCD display .............................................................................................................. 17
1.9 Relay Driver .............................................................................................................. 18
Chapter2 Burning into PIC ....................................................................................................... 19
2.1 Configuration of Software .......................................................................................... 19
2.2 Configuration of Hardware......................................................................................... 21
2.3 Burning a Program into PIC ........................................................................................ 22
[Link] PIC Evaluation Board User Manual
Introduction
PIC Evaluation board has the following features:
• Supports all 40 pin 16 and 18 series PIC's compatible with 16F877
• Has on board 5V power supply.
• Serial interface for standard 3 wire serial communications connected to
PIC serial
• 20MHz crystal oscillator
• 32 I/O pins (all except A4) available on FRC box connectors
• Connector for LCD module including brightness control
• Full In Circuit Serial programmer connect to the PC and program hex files
direct to any of the 40 pin PIC's in the 16Fxxx and 18Fxxx series.
• Three Relay Driver
• Single Channel ADC interfacing
• General Purpose Area for Additional components
• External Interrupt via RB0
[Link] PIC Evaluation Board User Manual
Technical or Customer Support
E-mail questions to support@[Link]
Send questions by mail to
Pantech Solutions Pvt Ltd.,
#3/2, Ramachandran Street,
Off: North Usman Road,
[Link]
Chennai – 600 017.
Tamilnadu
India
Phone : +91-44-4260 6470
Fax : +91-44-4260 6480
Website : [Link]
[Link] PIC Evaluation Board User Manual
Package Contains
PIC microcontroller Evaluation Board
Serial Port Cable
ISP Programming Cable
Printed User Manual
Board Schematic
CD contains
o Example Programs,
o User Manual
[Link] PIC Evaluation Board User Manual
CHAPTER 1
On-Board Peripherals
1.1 In System Programming (ISP):
PIC Evaluation board has many features; one of the important features is ISP. By Using ISP
capability we can program the PIC at the board itself. There is no need to remove PIC for re-
programming. The following steps will give you the way to use our On-Board ISP facility.
SW1
MCLR 1 20
RXD 2 19
CLK 3 18
VPP 4 17
DATA 5 16
DATA 6 15
TXD 7 14
PGM 8 13
INT 9 12
ADC 10 11
SW DIP-10
Fig.1
10-Way DIP switch Connection
For programming we have required CLK, VPP, DATA and PGM pins for ISP
Connect ISP Cable provided with the PIC Evaluation Board to DB9 connector on the
board. The other end should be connected to PC serial port.
We have given Icprog Programmer software with this evaluation kit. Configure the
software as necessary. See chapter 2 for how to configure icprog software.
Connect 9V supply adapter provided with PIC board to the DC socket.
Turn on the DIP switch pins CLK, VPP, DATA, DATA and PGM and verify all the
other pins are in off condition.
Open Hex in Ic-prog by File Open file “test. hex”
Select Configuration bits
Click Program icon in Ic-prog software.
Wait for “successfully verified” message box.
Turn ON DIP switch pin MCLR and turn OFF all the remaining pins. Now if you
connect LED between GND and port pins, the LED will glow.
[Link] PIC Evaluation Board User Manual
1.1.1 Configuration bits
Oscillator Selection:
Oscillator is necessary to generate clock for the entire Pic-micro unit inside the chip to RUN.
There are four types of Oscillators which are subjected to PIC.
LP Low Power Crystal
XT Crystal/Resonator
HS High Speed Crystal/Resonator
RC Resistor/Capacitor
Oscillators LP, XT, HS are Crystal type oscillators of varying frequency.
Oscillators having frequency less than 455 KHz are considered as Low power Oscillators (LP)
Oscillators having frequency range from 455 KHz to 4 MHz are considered to be XT oscillator.
Oscillators having frequency range above 4 MHz are considered as High Speed Oscillators (HS).
A combination of Resistor and Capacitor is known as RC Oscillator
Recommended values: 3k R 100 k and C > 20pF
When choosing any of the above Oscillators particularly in case of Crystal Oscillators, it is
necessary to choose bypass capacitors. They are necessary to bypass the unwanted frequency
components to ground.
Recommended values for the bypass capacitor are,
Osc Type Crystal Freq. Cap. Range C1 Cap. Range C2
32 kHz 33 pF 33 pF
LP
200 kHz 15 pF 15 pF
1 MHz 15 pF 15 pF
XT
4 MHz 15 pF 15 pF
8 MHz 15-33 pF 15-33 pF
HS 20 MHz 15-33 pF 15-33 pF
[Link] PIC Evaluation Board User Manual
Fuse bits:
These are not essential but checking the PWRT and BODEN will protect the IC from some
discrepancies regarding Power Supply.
[Link] PIC Evaluation Board User Manual
1.2 RS232 in Asynchronous mode:
Another important Feature is RS232 communication. This feature is very helpful when controlling
our PIC from a PC. Here the PIC and PC are connected in asynchronous mode. In asynchronous
mode of communication we can send and receive data at the same time. Fig.2 shows the internal
structure of the cable connecting Serial Port (Com1, com2, Etc) of your PC and the DB9
connector on the board.
Fig.2
Serial Cable Connection
Most of the PCs are using DB9 male connector for their serial port. PIC evaluation board also
having the same. So we have provided connector cable having female connector on both ends.
This will avoid pin confusions between male and female.
PicMicro and PC are working at different logic levels. PIC is working under TTL logic and your
PC is working at RS232 logic. The difference between the above said logics are their voltage
levels. We cannot send data directly from PC to PIC and vice versa, so we need level shifter to
convert between logic levels. The level shifter we used in our board is MAX232 ic chip.
Connection diagram for the MAX232 level shifter is shown in Fig.3.
[Link] PIC Evaluation Board User Manual
VDD
C1 1 uF
16
2
13 12
V+
VCC
R2IN 8 R1IN R1OUT 9
R2IN R2OUT RX
11 14
10 T1IN T1OUT 7 T2OUT
TX T2IN T2OUT
1
C2 3 C+ MAX232
1 uF 4 C1- U1
5 C2+
C2-
GND
6
V-
15
C3 C4
1 uF 1 uF
Fig.3
MAX232 Connection diagram
R2IN line is connected with RXD pin of 10-way DIP switch and T2OUT is connected with RXD
pin of 10-way DIP switch. RC6, RC7 are PORTC’s 6th and 7th pins respectively. The capacitors
may differ from 1uF to 10uF but 1uF is preferred for better result.
For Serial communication
Load the hex file “[Link]” into Icprog. See section 1.1 for how to load
program into PIC.
Connect Serial cable with DB9 connector on the PIC Evaluation board.
Configure Your PC Hyper Terminal for the specified baud rate and others.
Turn on DIP switch pins RXD, TXD, MCLR pins. Turn OFF remaining pins.
See the result by pressing any one key from your keyboard.
10
[Link] PIC Evaluation Board User Manual
1.3 Configuring the Hyper Terminal:
1. Click start Programs Accessories Communications Hyper Terminal
2. Enter a Name at the Name field and click OK
3. Select COM1 in the Connect using drop down box (select COMx if more than one Port)
11
[Link] PIC Evaluation Board User Manual
4. Select 9600, 8, None, 1, None respectively or click “Restore defaults” button. Click OK.
5. Now Port is configured as we needed.
12
[Link] PIC Evaluation Board User Manual
1.4 Single channel ADC:
PIC Evaluation board has single channel analog source for ADC interfacing. Analog source might
be LM35, LM335, POT or any other device which is compatible with the above devices.
Follow the steps below for ADC interfacing,
Load the hex file “adc_serial.hex” on PIC. See section 1.1 for how to load program
into PIC.
Connect Serial cable with DB9 connector on the PIC Evaluation board.
Turn on ADC pin in DIP switch. This will connect Analog device with PORTA.0
pin.
Turn on DIP switch pin MCLR, RXD, TXD and connect serial Port cable
See the output in your PC Hyper Terminal.
13
[Link] PIC Evaluation Board User Manual
1.5 External reset at MCLR
MCLR
R5
220 ohm
SW2
RESET
Fig.5
External Reset
Fig.5 shows External reset supplied by a Push Button switch to the MCLR pin of PIC. The
function of above reset circuit is to reset the Pic and bring back to its initial position. Reset pulse is applied
when MCLR pin is supplied by an active low signal. This circuit is connected to the microcontroller via
DIP switch MCLR pin.
14
[Link] PIC Evaluation Board User Manual
1.6 External Interrupt:
PIC has 14 sources of interrupt. Out of which 12 are internal interrupts and the remaining 2 are
external interrupts. PORTB pin RB0 serves as external interrupt port pin. Falling edge on RB0 will
generate an interrupt. Fig.4 shows RB0 interrupt connection diagram, INT_DIP is connected to INT pin of
10-way DIP switch.
For RB0 interrupt Demo
Load the hex file “RB0_Interrupt.hex” into PIC. See section 1.1 for how to load
program into PIC.
Turn on DIP switch pins INT and MCLR.
Watch the result on PORTC by pressing RB0.
INT_DIP
INT
R2
1k
Fig.4
Port On-Change Interrupt
15
[Link] PIC Evaluation Board User Manual
1.7 I/O connections:
JP3
RB0 1 2 RB1
RB2 3 4 RB3
VDD RB4 5 6 RB5
RB6 7 8 RB7
9 10
PORTB
JP2
RC0 1 2 RC1
RC2 3 4 RC3
VDD RC4 5 6 RC5
RC6 7 8 RC7
9 10
PORTC
JP5
RA0 1 2 RA1
RA2 3 4 RA3
VDD RA5 5 6 RE0
RE1 7 8 RE2
9 10
PORTA,E
JP4
RD0 1 2 RD1
RD2 3 4 RD3
VDD RD4 5 6 RD5
RD6 7 8 RD7
9 10
PORTD
Fig.6
I/O connections
PIC has 33 general purpose I/O pins. PIC Evaluation Board provides access to all I/O pins except
RA4 open drain pin. These I/O lines are connected via Four FRC connectors. All are 10 pin
connectors with 9th and 10th pins are connected to VDD and VSS respectively. JP2, JP3, JP4 are
connected to PORTC, PORTB, PORTD respectively. PORTA and E are sharing a single
connector JP5.
16
[Link] PIC Evaluation Board User Manual
10-wire FRC cable provided with this board will be used for interconnection with other external
devices. Some of the IO lines are shared with onboard peripherals like LCD, Relay Driver unit etc.
1.8 Lcd display:
PIC evaluation Supports 16x2 LCD display. Connector J1 holds LCD display. J2 is for Backlight
selection. PORTE lines 0, 1 and 2 are Control signals and PORTD is data lines.
J1
R7 VDD 1
1
POT 2
3
2 RE0 4
RE1 5
RE2 6
RD0 7
RD1 8
3
RD2 9
RD3 10
RD4 11
J2 VDD RD5 12
RD6 13
1 RD7 14
2 15
16
BACKLIGHT
LCD
Fig.7
LCD connections
For LCD demo,
Load the hex file “[Link]” into PIC. See section 1.1 for how to load program into
PIC.
Turn on DIP switch pin MCLR.
Put jumper on J2(if back light required)
Watch the result on LCD
17
[Link] PIC Evaluation Board User Manual
1.9 Relay Driver:
Jumper J3, J4 and J5 are connected to PORTC pins RC0, RC1 and RC2 respectively. J6, J7 and J8
are outputs to Relay. The relay to be connected must have VDD or VSS connected on the other
end.
VDD
R8
R
RC0 J6
1
1k
R9
J3 1
REALY 1 2 Q1 CON1
BC547
VDD
R10
R J7
RC1 1
1k
R11
J4 1 CON1
RELAY 2 2 Q2
BC547
VDD
R12
R
RC2 J8
1k 1
R13
J5 1
RELAY 3 2 Q3
BC547 CON1
Fig.8
Relay Driver
For Relay Demo,
Load the hex file “[Link]” into PIC. See section 1.1 for how to load program
into PIC.
Connect Serial cable with DB9 connector on the PIC Evaluation board.
Turn on DIP switch pin MCLR, RXD, TXD.
Open Hyper terminal and Press reset once if the Hyper terminal is blank.
18
[Link] PIC Evaluation Board User Manual
Press 1 to 6 to turn ON and OFF devices.
For Output, measure the voltage on j6,j7 and j8 or connect an LED on j6,j7 and j8
CHAPTER 2
BURNING INTO PIC
Programming a involves three steps,
1. Configuration of Software
2. Configuration of Hardware
3. Burning a Program into PIC
2.1 Configuration of Software:
The burning software we are using for our PIC Evaluation Board is Ic-prog. Fig.2.1 shows Ic-prog
software. When opening for the first time, we have to configure ic-prog as necessary.
Configuration includes selection of Ports, Interfaces, I/O delays, Driver installation for winnt...Etc.
.
19
[Link] PIC Evaluation Board User Manual
Fig.2.1
Hardware Settings
Choose the following from Settings Hardware Menu,
JDM programmer from the Programmer List Box.
Com1 as your Programming port.
Direct I/O as interface to our hardware.
Left unchanged the I/O delay box.
Enable driver by enabling Enable NT/2000/XP Driver Check box from Settings
Options Misc Menu. Message box will be displayed to restart ic-prog, click YES to restart
icprog. After restart choose Process Priority as necessary. Changing Process Priority will adjust
only the I/O delay; it will not affect programming flow. Left this tab unchanged.
Fig.2.2 shows driver installation dialog box.
Fig.2.2
20
[Link] PIC Evaluation Board User Manual
Driver Installation for WINNT
2.2 Configuration of Hardware:
The other important thing when programming PIC is checking hardware connection. This can be
done by enabling DATA, CLK, MCLR, and VCC check boxes from Settings Hardware Check
menu, and verifying the corresponding PIC pins.
Select Settings Hardware Check menu, the following dialog box will appear.
Fig.2.3
Hardware Verification dialog Box
From the dialog box,
Check the Enable Data Out check box, Turn on DIP switch pins DATA(5,6) and measure
the voltage between GND and RB7 pin, there should be an approximate positive voltage
of 2.5v should be present at RB7.
Check the Enable Clock check box, Turn on DIP switch pin CLK(3) and measure the
voltage between GND and RB6 pin, there should be an approximate positive voltage of
2.5v should be present at RB6.
Check the Enable MCLR check box, Turn on DIP switch pin VPP(4) and measure the
voltage between GND and MCLR pin, there should be a positive voltage of >10 should
be present at MCLR pin of PIC.
21
[Link] PIC Evaluation Board User Manual
There is no need for checking VCC because the supply is given via an external power
supply.
2.3 Burning a Test Program into PIC:
Burning a test program into PIC can be done by simply opening a test file, selecting a device and
configuration bits, clicking the Program Icon in Ic-prog. Follow the steps given in chapter 1.1.
22
[Link] PIC Evaluation Board User Manual