Académique Documents
Professionnel Documents
Culture Documents
MikroElektronika
Development tools - Books - Compilers
EasyPIC3
Users Manual
with on board
USB
2.0 programmer
MikroElektronika
Development
tools
No part of this manual, including the product and software described in it, may be
reproduced, transmitted, transcribed, stored in a retrieval system, or translated into
any language in any form or by any means, except documentation kept buy the purchaser for backup purposes, without the express written permission of
MikroElektronika company.
Product warranty or service will not be extended if the product is repaired, modified
or altered, unless such repair, modification or alteration is authorized in writing by
MikroElektronika.
MIKROELEKTRONIKA PROVIDE THIS MANUAL AS IS WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY OR
FITNESS FOR A PARTICULAR PUROSE.
IN NO EVENT SHALL MIKROELEKTRONIKA, ITS DIRECTORS, OFFICERS,
EMPLOYEES OR DISTRIBUTORS BE LIABLE FOR ANY INDIRECT , SPECIAL,
INCIDENTAL, OR CONSEQUENTIAL DAMAGES(INCLUDING DAMAGES FOR
LOSS OF PROFITS, LOSS OF BUSINESS, LOSS OF USE OR DATA, INTERRUPTION OF BUSINESS AND THE LIKE) EVEN IF MIKROELEKTRONIKA HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES ARISING FROM ANY
DEFECT OR ERROR IN THIS MANUAL OR PRODUCT.
SPECIFICATION AND INFORMATION CONTAINED IN THIS MANUAL ARE FURNISHED FOR INTERNATIONAL USE ONLY, AND ARE SUBJECT TO CHANGE AT
ANY TIME WITHOUT NOTICE , AND SHOULD BE CONSTRUED AS A COMMITMENT BY MIKROELEKTRONIKA
MikroElektronika assumes no responsibility or liability for any errors or inaccuracies
that may appear in this manual, including the product and software described in it.
Product and corporate names appearing in this manual may or may not be registered trademarks or copyrights of their respective companies, and are used only for
identification or explanation and to the owners benefit, without intent to infringe.
USB
EasyPIC
page
MikroElektronika
Development
tools
CONTENTS
USB
EasyPIC
page 4
INTRODUCTION
page 5
page 6
page 6
Jumpers
page 7
MCU sockets
page 8
Power Supply
page 10
page 11
LEDs
page 12
Pushbutton Switches
page 14
7-segment displays
page 17
Graphic LCD
page 18
page 19
page 20
RS-232 Communication
page 22
USB Communication
page 23
PS/2 keyboard
page 24
page 25
page 26
page 28
page
CONTENTS
MikroElektronika
Development
tools
The development system box in basic option contains a development system, CD,
USB cable, serial cable and this manual.
Step no.1 The first thing to do is to insert the CD into your PC's CD-ROM drive.
Step no.2 Take the system out of a box. Unpack the USB cable and connect it to the PC.
Please use USB ports from the back of the PC, with direct contact to the motherboard.
Step no.5 Copy the file PICFlash2.exe to the folder of your choice. You can find this file in
the PICFLASH2 folder on the CD.
Step no.6 Run and use PICflash2 as explained in the document PICflash programmer.
After these 6 steps, your EasyPIC3 is installed and ready for use. You should try to
read a program from the chip or to load an example from the examples folder.
page
USB
EasyPIC
MikroElektronika
Development
tools
INTRODUCTION
The EasyPIC3 development system is a full-featured development board for
Microchip PIC microcontrollers. It has been designed to allow students and engineers to easily exercise and explore the capabilities of PIC microcontrollers. It
allows PIC microcontrollers to be interfaced with external circuits and a broad range
of peripheral devices, allowing the user to concentrate on software development.
Figure 1 illustrates the development board. Each component is marked on a
silkscreen. These marks describe connections to the microcontroller, operation
modes, and provide some useful notes. The need for additional schematics is minimized as all the information is printed on the board.
Figure 1.
USB
EasyPIC
page
INTRODUCTION
MikroElektronika
Development
tools
SWITCHES
SWITCHES
The EasyPIC3 development board features a number of peripherial devices. In
order to enable these devices before programming, you need to check if appropriate jumpers or switches have been properly set.
Switches are devices that have two positions - ON and OFF, which have a role to
establish or break a connection between two contacts. The EasyPIC3 development
system has two groups of switches.
The first group, SW1, enable a connection between the microcontroller ports with
analog capabilities (PORTA and PORTE) and external pull-up/down resistors. The
pull up/down resistors should be disconnected from the analog input pins, otherwise
they will affect the input voltage level. When PORTA and PORTE pins are used as
digital inputs/outputs, the appropriate pull-up/down resistors should be enabled.
The upper four switches of SW2 are used to enable LEDs connected to PORTA/E,
PORTB, PORTC and PORTD. For example, if switch PORTB is OFF, all PORTB
LEDs will be turned off.
The lower four switches of SW2 are used to enable the 7-segment displays. If you
dont need the 7-segment displays in your project, these switches should be OFF.
ON
Group of 8 switches
1 2 3 4 5 6 7 8
Figure 2.
Switch is ON
Switch is OFF
page
USB
EasyPIC
MikroElektronika
Development
tools
Figure 3.
Jumper as a
switch
Jumper is OFF
More often jumpers are used as a selector between two possible connections using
a three pin connector. As illustrated in Fig. 4, the middle contact can be connected
to the left or right pin, depending on the jumpers position.
Figure 4.
Jumper as a
multiplexer
USB
EasyPIC
page
JUMPERS
JUMPERS
MikroElektronika
Development
tools
MCU SOCKETS
MCU SOCKETS
The EasyPIC3 is delivered with a 40-pin microcontroller. Users can remove this,
and fit a different microcontroller in DIP40, DIP28, DIP18, DIP14 or DIP8 packages of an adequate pin-out.
Figure 5.
MCU sockets
NOTE: Since all packages have parallel connections, there must not be more than
one microcontroller on the board at a time.
page
USB
EasyPIC
MikroElektronika
Development
tools
Figure 6.
System connection
vcc
RA4
ON
RA4
SW2
1 2 3 4 5 6 7 8
PORTA
vcc
vcc
PortA
RA4
RB7
RA0
RB6
RA1
RB5
RA2
RB4
RA3
RA4
RA5
RE0
RE1
RE2
USB
EasyPIC
DIP40
MCLR
RB3
RB2
DIP28
DIP8
RA4
RA4
GP4
(RA4)
RA4
DIP18
DIP14
RB1
RB0
VDD
VSS
VDD
RD7
VSS
RD6
page
MCU SOCKETS
MikroElektronika
Development
tools
As a power supply source, users can select either a regulated supply from the USB
cable (default) or an external non-regulated power supply.
In case of the USB power supply, the system should be connected to a PC using the
USB programming cable and jumper JP1 should be set in the right-hand position.
In the case of an external power supply, the EasyPIC3 board produces +5V using
an LM7805 voltage regulator. The external power supply can be AC or DC, with a
voltage between 9V and 16 V and jumper JP1 should be set in the left-hand position. In Fig. 7 you can see the USB (left) and power supply (right) connectors.
Figure 8. Power supply select jumper
POWER SUPPLY
POWER SUPPLY
8-12V (AC/DC)
USB
EXT
USB
JP1
REG1
7805
CN2
EXT
Vin
Vout
5V
5V
FP1
GND
2
2
E1
470uF
C8
100nF
E2
470uF
E3
470uF
C15
100nF
VCC
DD+
GND
USB
VCC
page
10
USB
EasyPIC
MikroElektronika
Development
tools
To the right of the USB programmer, there are jumpers JP2, JP3 and JP4.
Figure 11.
Default position
JP4 jumper
explanation
USB
EasyPIC
Figure 12.
JP2 and JP3 for
DIP18, DIP28, or DIP40
Figure 13.
JP2 and JP3 for
DIP8 or DIP14
page
11
MikroElektronika
Development
tools
LEDs
LEDs
Light Emitting Diodes (LEDs) are the most commonly used components, usually for
displaying pins digital state. The EasyPIC3 has 32 LEDs that are connected to the
microcontrollers PORTA/E, PORTB, PORTC and PORTD.
Each group of eight LEDs can be enabled or disabled using switch SW2. Connection for PORTA/E is shown in Fig. 15.
Figure 14.
Light Emitting Diodes
A resistor is used in series with the LED to limit the LED's current. In this case the
resistor's value is 1K. All eight LEDs from one port are connected to a common
point through these resistors, which can then be connected or disconnected to
ground by the corresponding switch on SW2.
page
12
USB
EasyPIC
MikroElektronika
Development
tools
The LEDs are enabled when connected to ground and will display the state of the
corresponding microcontroller pin; otherwise the LEDs will always be off, no matter what the port state is as no current can flow through it.
ON
1 2 3 4 5 6 7 8
PORTA/E LED
PORTB LED
PORTC LED
PORTD LED
CURRENT FLOW
RA0
RA1
RN5
R-SIL 8/9
RA2
RA3
RA4
MCLR
RB7
RA0
RB6
RA1
RB5
RA2
RB4
RA3
RB3
RA4
RB2
RA5
RA5
RE0
RE1
RE2
RE0
VDD
VSS
RE1
OSC1
OSC2
X1
8MHz
RC0
C6
22pF
USB
EasyPIC
C7
22pF
PICxxxx
1
2
3
4
5
6
7
8
9
RC1
RB1
RB0
VDD
VSS
RD7
RD6
RD5
RD4
RC7
RC6
RC2
RC5
RC3
RC4
RD0
RD3
RD1
RD2
VCC
page
13
LEDs
MikroElektronika
Development
tools
PUSHBUTTON SWITCHES
PUSHBUTTON SWITCHES
R17
10K
Figure 17.
RB7
RA0
RB6
RA1
RB5
RA2
RB4
RA3
RB3
RA4
RB2
RA5
RE1
RE2
C14
100n
Reset
RE0
VDD
VSS
OSC1
OSC2
X1
8MHz
RC0
C6
22pF
C7
22pF
RC1
PICxxxx
PICflash
On-Board USB
programmer
MCLR
RB1
VCC
RB0
VDD
VSS
RD7
RD6
RD5
RD4
RC7
RC6
RC2
RC5
RC3
RC4
RD0
RD3
RD1
RD2
page
14
USB
EasyPIC
MikroElektronika
Development
tools
PORTA/E
PORTB
PORTD
PORTC
RA0
RB0
RC0
RD0
RA1
RB1
RC1
RD1
MCLR
RB7
RA0
RB6
RA1
RB5
RA2
RB4
RA3
RB3
RA4
RB2
RA2
RB2
RC2
RE0
RD2
RE1
RA3
RB3
RC3
RE2
RD3
VDD
RA4
RB4
RC4
RD4
RA5
RB5
RC5
RD5
RE0
RB6
RC6
RD6
RE1
RB7
RC7
RD7
VSS
OSC1
OSC2
X1
8MHz
RC0
C6
22pF
C7
22pF
PICxxxx
RA5
RC1
RB1
RB0
VCC
VDD
VSS
RD7
RD6
RD5
RD4
RC7
RC6
RC2
RC5
RC3
RC4
RD0
RD3
RD1
RD2
VCC
JP20
0V while button +5V while button
is pressed
is pressed
USB
EasyPIC
page
15
PUSHBUTTON SWITCHES
vcc
PortB
MCLR
RB7
RA0
RB6
RA1
RB5
RA2
RB4
RA3
RA4
RA5
RE0
RE1
RE2
DIP40
PUSHBUTTON SWITCHES
MikroElektronika
Development
tools
pull-up
RB3
RB2
RB4
RB1
RB0
VDD
vcc
VSS
VDD
RD7
VSS
RD6
0V while pressed
vcc
PortB
MCLR
RB7
RA0
RB6
RA1
RB5
RA2
RB4
RA3
RA4
RA5
RE0
RE1
RE2
DIP40
pull-down
RB3
RB2
RB4
RB1
RB0
VDD
vcc
VSS
VDD
RD7
VSS
RD6
5V while pressed
page
16
USB
EasyPIC
MikroElektronika
Development
tools
The EasyPIC3 has four 7-segment displays in multiplex mode. Data lines are connected to PORTB, while each display is enabled through the lower four bits of
PORTA.
Figure 22.
7-segment displays
8.
a
DIS1
dp
R2 - R9
RB7
MCLR
RA0
RB6
RA1
RB5
RA2
RB4
RA3
RB3
RE0
RE1
RE2
VDD
VSS
OSC1
OSC2
X1
8MHz
RC0
C6
22pF
C7
22pF
PICxxxx
RA5
RB1
dp
RB0
VDD
DIS3
VCC
10
8 7 6
10 9
8 7 6
10
8 7 6
10 9
8 7 6
3 4 5
3 4 5
3 4 5
3 4 5
RD7
RD6
RD5
RD4
RC7
RC1
RC6
RC5
RC3
RC4
RD0
RD3
RD1
RD2
Q1
R10
10K
Q3
Q2
R11
10K
R12
10K
ON
RA3
1 2 3 4 5 6 7 8
RA2
10K
ON
ON
ON
ON
DIS1
DIS2
DIS3
DIS4
Q4
R13
SW2
PORTA
PORTB
PORTC
PORTD
RA0
RA1
EasyPIC
VSS
RC2
USB
DIS4
8. 8. 8. 8.
a
b
c
d
e
f
g
RB2
RA4
DIS2
Figure 23.
page
17
7-S
SEGMENT DISPLAYS
7-SEGMENT DISPLAYS
MikroElektronika
Development
tools
GRAPHIC LCD
The Graphic LCD (GLCD) allows advanced visual messages to be displayed.
While a character LCD can display only alphanumeric characters, a GLCD can be
used to display messages in the form of drawings and bitmaps. The most commonly used graphic LCD has a screen resolution of 128x64 pixels. Before a GLCD is
connected, the user needs to set jumper JP17 (Fig. 24) to the upper position. The
GLCDs contrast can be adjusted using potentiometer P3, which is placed to the left
of the GLCD below jumper JP17.
Figure 24.
GLCD
selection
jumper
GLCD
LCD8 contrast
selected
Vee
GRAPH.
VCC
VCC
Vo
RA0
RB6
RA1
RB5
RA2
RB4
RA3
RB3
RA4
RB2
RA5
RE0
RE1
VCC
RE2
VDD
20
VSS
CS1
CS2
GND
VCC
Vo
RS
R/W
E
D0
D1
D2
D3
D4
D5
D6
D7
RST
Vee
LED+
LED-
OSC1
X1
8MHz
OSC2
RC0
C6
22pF
C7
22pF
D0
D1
PICxxxx
CHAR.
P3
5K
GLCD contrast
selected
RB7
MCLR
JP17
Contrast
Adjustment
Figure 25.
E
R/W
RS
CS2
CS1
RB1
VCC
RB0
VDD
VSS
RD7
RD6
RD5
RD4
D7
D6
D5
D4
RC7
RC1
RC6
RC2
RC5
RC3
RC4
RD0
RD3
RD1
RD2
GLCD schematic
RST
D3
D2
Figure 26.
page
18
USB
EasyPIC
MikroElektronika
Development
tools
Figure 28.
VCC
P3
5K
Contrast
Adjustment
MCLR
RB7
RA0
RB6
RA1
RB5
RA2
RB4
RA3
RB3
RA4
RB2
RA5
RE0
RE1
RE2
VDD
VSS
OSC1
OSC2
X1
8MHz
RC0
14
GND
VCC
VEE
RS
R/W
E
D0
D1
D2
D3
D4
D5
D6
D7
USB
EasyPIC
C6
22pF
C7
22pF
RC1
PICxxxx
RB1
RB0
VDD
VCC
VSS
RD7
RD6
RD5
RD4
RC7
RC6
RC2
RC5
RC3
RC4
RD0
RD3
RD1
RD2
page
19
MikroElektronika
Development
tools
Figure 29.
LCD 2x16 in 8-bit mode
The LCD must be placed in the marked position with two free pins to the left and
four free pins to the right (Figure 29). Only add or remove the LCD from the
EasyPIC3 when the power is off. Before adding the LCD, set jumper JP17 to the
lower position. The LCD's contrast can be adjusted using potentiometer P3 which is
located to the left of the GLCD/LCD connector.
NOTE: Special attention is required when placing the LCD. Otherwise the LCD
can be permanently damaged.
page
20
USB
EasyPIC
MikroElektronika
Development
tools
LCD8 contrast
selected
GLCD contrast
selected
GRAPH.
RB6
RA1
RB5
RA2
RB4
RA3
RB3
RA4
RB2
RE0
Contrast
Adjustment
RE1
RE2
VDD
VSS
OSC1
VCC
X1
8MHz
USB
EasyPIC
RC0
14
GND
VCC
VEE
RS
R/W
E
D0
D1
D2
D3
D4
D5
D6
D7
OSC2
C6
22pF
C7
22pF
D0
D1
PICxxxx
P3
5K
RB7
RA0
RA5
JP17
CHAR.
MCLR
E
R/W
RS
RB1
RB0
VCC
VDD
VSS
RD7
RD6
RD5
RD4
D7
D6
D5
D4
RC7
RC1
RC6
RC2
RC5
RC3
RC4
RD0
RD3
RD1
RD2
D3
D2
page
21
MikroElektronika
Development
tools
RS-2
232 COMMUNICATION
RS-232 COMMUNICATION
RS-232 communication enables point-to-point data transfer. It is commonly used in
data acquisition applications for the transfer of data between the microcontroller
and a PC. Since the voltage levels of a microcontroller and PC are not directly compatible with those of RS-232, a level transition buffer such as the MAX232 must be
used. In order to provide a more flexible
system, the microcontroller is connected to
the MAX232 through the two jumpers JP5
and JP6. Jumper JP5 is used to connect the
Rx line to RC7, RB2 or RB1. Jumper JP6 is
used to connect the Tx line to RC6, RB5 or
RB2. Note that JP5 and JP6 must not be
connected to RB2 at the same time.
Figure 32.
RC7
E3
10uF
1
6
E4
10uF
C1+
VCC
V+
GND
C1-
T1out
C2+
R1in
C2-
R1out
RB2
E5
10uF
RB5
RA2
RB4
RA3
RB3
RA4
Tx
RA5
RB1
RE0
T1in
RE1
T2out
T2in
RE2
C7
22pF
R2out
RC6
RB6
RA1
V-
R2in
RA0
MAX232
Rx
RB5
C6
22pF
VDD
VSS
X1
8MHz
OSC1
OSC2
RC0
RC1
RB2
RB2
PICxxxx
Connection
between microcontroller and a PC
RB7
MCLR
E6
10uF
RB1
RB0
VCC
VDD
VSS
RD7
RD6
RD5
RD4
RC7
RC6
RC2
RC5
RC3
RC4
RD0
RD3
RD1
RD2
Serial Cable
1
6
Rx
Tx
9
5
page
22
USB
EasyPIC
MikroElektronika
Development
tools
VCC
VCC
USB
100n
D+
100n
D-
Figure 34.
USB communication
schematic
RC3
JP7
RC3-U
RC4
JP8
MCLR
RB7
RA0
RB6
RA1
RB5
RA2
RB4
RA3
RB3
RA4
RB2
RC4-U
RE0
RE1
RC5
JP9
RE2
VDD
RC5-U
VSS
OSC1
X1
8MHz
OSC2
RC0
C6
22pF
USB
EasyPIC
C7
22pF
PICxxxx
RA5
RC1
RB1
RB0
VSS
RD7
RD6
RD5
RD4
RC7
RC6
RC2
RC5
RC3
RC4
RD0
RD3
RD1
RD2
VCC
VDD
page
23
USB COMMUNICATION
USB COMMUNICATION
MikroElektronika
Development
tools
PS/2 COMMUNICATION
PS/2 COMMUNICATION
The PS/2 connector allows direct connection
between the EasyPIC3 and devices that use
PS/2 communication, such as a PC, keyboard
or mouse. For example, the microcontroller
can be connected to a keyboard to read the
pressed keys or it can be connected to a PC to
act as a keyboard. For data tansfer CLK and
DATA lines are used. In this case, they are
connected to pins RC1 and RC0 respectively.
Figure 35.
PS/2 connector
Figure 36.
Keyboard connected to development board
NC
CLK
RB7
RA0
RB6
RA1
RB5
RA2
RB4
RA3
RB3
RA4
RB2
RA5
RE0
NC
DATA
RE1
RE2
VDD
VCC
VSS
OSC1
OSC2
PS2
CONNECTOR
DATA
NC
GND
VCC
CLK
NC
RC0
RC1
X1
8MHz
C6
22pF
C7
22pF
PICxxxx
+5V
MCLR
RB1
RB0
VDD
VCC
VSS
RD7
RD6
RD5
RD4
RC7
RC6
RC2
RC5
RC3
RC4
RD0
RD3
RD1
RD2
24
USB
EasyPIC
MikroElektronika
Development
tools
125 C
-50 C
DS1820
VCC
There is a mark in
the form of half-circle
for proper orientation
of DS1820 sensor.
VCC
MCLR
RB7
RA0
RB6
RA1
RB5
RA2
RB4
RA3
RB3
RA4
RB2
RA5
RE0
RE1
DQ
RE2
VDD
JP14
VSS
OSC1
OSC2
X1
8MHz
RC0
C6
22pF
DQ line is
connected to RE2
DQ line is
connected to RA5
C7
22pF
RC1
PICxxxx
GND
DS1820
RB1
RB0
VCC
VDD
VSS
RD7
RD6
RD5
RD4
RC7
RC6
RC2
RC5
RC3
RC4
RD0
RD3
RD1
RD2
DQ line is
disconnected
EasyPIC
page
25
MikroElektronika
Development
tools
Figure 40.
A-D Converter input
The application of A-D Conversion is various. Microcontroller takes analogue signal from its input pin and translates it into a digital number. Basically, you can measure any analogue signal that fits in range acceptable by PIC. That range is 0V to 5V.
page
26
USB
EasyPIC
MikroElektronika
Development
tools
Figure 41.
vcc
pull-up/down
Pull-up/down resistors on
pins RA2 and RA3
should be disabled using
SW1
PortA
SW1
P1
10K
ON
1 2 3 4 5 6 7 8
vcc
JP15
0 - 5V
0 - 5V
RB7
RA0
RB6
RA1
RB5
RA2
RB4
RA3
RB3
RA4
RB2
RA5
vcc
RE0
RE1
P2
10K
RE2
VDD
VSS
OSC1
X1
8MHz
OSC2
RC0
C6
22pF
USB
EasyPIC
C7
22pF
PICxxxx
JP16
0 - 5V
MCLR
RC1
RB1
VDD
VSS
RD7
RD6
RD5
RD4
RC7
RC6
RC2
RC5
RC3
RC4
RD0
RD3
RD1
RD2
vcc
RB0
page
27
MikroElektronika
Development
tools
Figure 42.
These connectors can be used for system expansion with external boards such as
Compact Flash, CAN, RS-485, etc. Ensure that the on-board peripherals are diconnected from microcontroller by setting the appropriate jumpers while external
peripherals are using the same pins. The connectors can also be used for attaching
logic probes or other test equipment.
Figure 43.
page
28
USB
EasyPIC
MikroElektronika
Development
tools
Pull-up line is
connected
JP13
Figure 44.
VCC
PORTB connection
2
3
RN2
Pull-down line
is connected
All lines
are disconnected
1
RB0 2
RB1 3
RB2 4
RB3 5
RB4
RB5
RB6
RB7
MCLR
RB7
RA0
RB6
RA1
RB5
RA2
RB4
RA3
RB3
RA4
RB2
RE0
RE1
RE2
VDD
VSS
OSC1
OSC2
X1
8MHz
RC0
C6
22pF
C7
22pF
PICxxxx
RA5
6
7
8
9
RB1
RB0
VDD
VSS
RD7
RD6
VCC
CN7
RB0
RB1
RB2
RB3
RB4
RB5
RB6
RB7
RD5
RD4
RC7
RC1
RC6
RC2
RC5
RC3
RC4
RD0
RD3
RD1
RD2
VCC
HEADER 5x2
USB
EasyPIC
page
29
MikroElektronika
Development
tools
page
30
USB
EasyPIC