Escolar Documentos
Profissional Documentos
Cultura Documentos
MikroElektronika
Development tools - Books - Compilers EasyPIC4
Users Manual
3 in 1
With useful implemented peripherals, plentiful practical
USB 2.0
mikro
ICD
IN-CIRCUIT IN-CIRCUIT
code examples and a broad set of additional add-on
boards (Serial Ethernet, Compact Flash, MMC/SD,
ADC, DAC, CAN, RTC, RS-485, etc.), MikroElektronika
DEBUGGER PROGRAMMER
development boards make fast and reliable tools that
MICROCHIP
PIC
can satisfy the needs of experienced engineers and
beginners alike.
DEVELOPMENT
BOARD
Software and Hardware
solutions for Embedded World
MikroElektronika
Development tools EasyPIC4 Users Manual
Second edition
January 2007
No part of this manual, including the product and software described in it, may be repro-
duced, 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 pur-
poses, 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.
Product and corporate names appearing in this manual may or may not be registered trade-
marks or copyrights of their respective companies, and are used only for identification or
explanation and to the owners benefit, without intent to infringe.
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
2
MikroElektronika
Development tools EasyPIC4 Users Manual
CONTENTS
CONTENTS
CONNECTING THE SYSTEM page 4
INTRODUCTION page 5
Switches page 6
Jumpers page 7
MCU sockets page 8
Power Supply page 10
On-board USB 2.0 programmer page 11
Oscillator page 13
mikroICD (In-Circuit Debugger) page 15
LEDs page 16
Pushbutton switches page 18
7-segment displays page 21
Graphic LCD page 22
LCD 2x16 in 4-bit mode page 23
LCD 2x16 in 8-bit mode page 24
RS-232 Communication page 26
USB Communication page 27
PS/2 keyboard page 28
DS1820 Digital Thermometer page 29
A/D Converter input page 30
Direct Port Access page 32
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
3
EasyPIC4 Users Manual
CONNECTING THE SYSTEM MikroElektronika
Development tools
The development system box contains the development system, product CD, USB cable,
RS232 cable and this manual.
Step no.1 The first thing to do is to take the system out of the box. Unpack the USB cable and con-
nect it to the PC. Please use USB ports on the back of the PC with direct connection to the
motherboard.
Step no.2 Install the PICFLASH2 programmer and drivers. Start the installation from the product CD:
CD_Drive:\product\zip\PICFlash_setup.exe.
Step no.3 After the installation connect the USB cable to the EasyPIC4 board. You will be asked for
the PICprog drivers. Point to them in order to finish the driver instalation. They are placed
in the folder:
System_Drive:\Program Files\Mikroelektronika\PICFLASH-mikroICD\Driver.NT
Step no.4 Run and use PICFLASH2 as explained in the document PICflash2 programmer.
CD_Drive:\product\pdf\picflash_manual_v4.pdf
After these 4 steps, your EasyPIC4 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 of mikroElektroni-
kas compilers for PIC or from the product CD:
CD_Drive:\product\zip\easypic4_examples.zip.
page ICD
INTRODUCTION
MICROCHIP INTRODUCTION
PIC
DEVELOPMENT The EasyPIC4 development system is a full-featured development board for Microchip PIC
BOARD 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 inter-
faced with external circuits and a broad range of peripheral devices, allowing a user to con-
centrate on software development.
Figure 1 illustrates the development board. Each component is marked on a silkscreen, both
top and bottom. These marks describe connections to the microcontroller, operation modes,
and provide some useful notes. The need for additional schematics is minimized since all
relevant information is printed on the board.
Figure 1. EasyPIC4 development board
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
5
EasyPIC4 Users Manual
SWITCHES MikroElektronika
Development tools
SWITCHES
ON
Figure 2.
Group of 8 switches
Switch is ON
Switch is OFF
page ICD
JUMPERS
JUMPERS
Jumpers, like switches, can break or establish a connection between two points. Beneath the
plastic cover of the jumper is a metal contact, which makes a connection if the jumper is
placed between two disconnected pins.
For example, the jumper group JP10 have two jumpers used as switches. They are used to
connect or disconnect PS/2 CLK pin to RC1 and PS/2 DATA pin to RC0 pin of the micro-
controller. A connection is made when the jumpers are placed between two contacts.
Jumper is ON
Jumper is OFF
More often jumpers are used as a selector between two possible connections by 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.
All lines are Left line Right line
Figure 4. disconnected is selected is selected
Jumper as a
multiplexer
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
7
EasyPIC4 Users Manual
MCU SOCKETS MikroElektronika
Development tools
MCU SOCKETS
EasyPIC4 is delivered with a 40-pin microcontroller. Users can remove this one and fit a dif-
ferent microcontroller in DIP40, DIP28, DIP20, DIP18, DIP14 or DIP8 packages of an ade-
quate pinout.
Note: There are two DIP18 sockets, with different pinouts (DIP18A and DIP18B). When
putting 18-pin microcontoller into DIP18 socket choose the one with corresponding pinout.
For example, PIC18F1220 uses DIP18A socket, while PIC16F628A uses DIP18B socket.
The 10F MCU socket is used only for PIC10F family and the DIP8 socket is used for all
other 8-pin microcontrollers.
Note: Since all packages have parallel connections, there must not be more than one micro-
controller on the board at a time.
Note: Make sure to place jumper JP18 in lower position (labeled as VCC) while using
PIC18F2331 microcontroller. When using some other 28-pin MCU this jumper must be at
upper position (labeled as RA5).
page ICD
MCU SOCKETS
direct connections to Direct Port Access connectors. Such connectors are typically used for
connecting external peripherals to the board or for providing useful points for connecting
digital logic probe.
All ports are connected to LEDs, push-button switches and pull-up/down resistors, which
allow easy monitoring and testing of digital pin state .
Some pins are connected to other peripherials such as the DS1820 temperature sensor, RS-
232 communication, 7-segment displays, LCD, etc.
vcc
PortA
SW2
PORTA/E vcc
PORTA/GP
1 2 3 4 5 6 7 8
ON
JP17
RA4 ON
SW1
1 2 3 4 5 6 7 8
RA4
vcc
RA4 RA4
MCLR RB7
RA0 RB6 DIP28 DIP8
RA1 RB5
RA4 RA4 GP4
RA2 RB4
(RA4)
DIP40
RA3 RB3
RA4
RA4 RB2 DIP18 DIP14
RA5 RB1
RE0 RB0
RE1 VDD
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
9
EasyPIC4 Users Manual
POWER SUPPLY MikroElektronika
Development tools
External power
supply connector REG1
EXT USB
7805
CN1 8-12V (AC/DC) JP1
5V FP1 5V
Vin Vout VCC
1 + 1 3
GND
2 2
D-
D+
USB
E1 C8 E2 E3 C15 GND
470uF 100nF 470uF 470uF 100nF
USB
Figure 9. JP1 is set to USB power supply connector
VCC
page ICD
IN-CIRCUIT
There is no need for the use of external
PROGRAMMER equipment during programming as
EasyPIC4 development system has its
own on-board USB programmer. All
you need to do is connect the system to
a PC using USB cable. Then, load your
program into the microcontroller via
the PICFlash2 programming software
which is supplied with EasyPIC4.
Note: There is no need for reseting MCU after programming. The programmer will reset the
MCU automatically.
On the right of the USB programmer there is the JP5 jumpers group. These jumpers are used
for PGM pin selection. There are two different programming modes for PIC MCUs: Low-
Voltage and High-Voltage programming mode. PICflash2 supports only High-Voltage pro-
gramming mode which can be applied regardless of MCUs programming state. Since some
PIC MCUs are being shipped whith Low-Voltage programming mode as default, you must
select a proper PGM pin (depending on chip). For most of the MCUs you dont have to use
PGM selection and the JP5 jumpers group should stay in the Default position.
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
11
EasyPIC4 Users Manual
ON-BOARD USB PROGRAMMER MikroElektronika
Development tools
Figure 12.
JP3 and JP4 for DIP40,
DIP28, DIP18A and DIP18B
Figure 13.
JP3 and JP4 for DIP20,
DIP14 and DIP8
When using DIP40, DIP28, DIP18A and DIP18B sockets, jumpers JP3 and JP4 should be
in the upper position (default) as shown in Fig. 12.
For DIP20, DIP14 and DIP8 sockets, these jumpers should be in the lower position
(Fig. 13).
Jumper JP2 allows using the MCLR pin as RESET or as digital I/O. It can be RE3, RA5 or
RA3 pin depending on MCU that you are using.
When JP2 is in the lower position the hardware reset (pressing reset button) is enabled and
MCLR pin can not be used as an I/O pin.
When JP2 is in the upper position the MCLR pin can be used as an I/O pin but the hardware
reset is disabled.
MCLR pin
used as RESET
page ICD
OSCILLATOR
OSCILLATOR
Since there are so many sockets on EasyPIC4 board, there are two oscillators that are con-
nected with two main sections of the MCU sockets. The first oscillator is labeled as OSC1
and is connected to DIP40, DIP28, DIP18A and DIP18B socket. The second oscillator is
labeled as OSC2 and is connected to DIP20, DIP14 and DIP8 socket.
Note: As you can see from the picture above, 10F MCU socket is not connected to any of
the two oscillators. This MCUs have only an internal oscillator and they cant be used with
an external crystal.
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
13
EasyPIC4 Users Manual MikroElektronika
Development tools
For some microcontrollers oscillator input pins can also be used as digital input/output pins.
OSCILLATOR
In order to implement this feature EasyPIC4 has jumpers for connecting MCU either to
oscillator or to digital I/O pins. You can see the schematics for OSC1 oscillator on Fig. 16.
Figure 16.
Oscillator connection with MCU
MCLR RB7
RA0 RB6
RA1 RB5
RA6 and RA7 pins are RA6 and RA7 pins are RA2 RB4
used as oscillator input used as digital I/O
RA3 RB3
RA4 RB2
RA7 RA6
PICxxxx
RA5 RB1 vcc
RE0 RB0
RE1 VDD
RE2 VSS
Note: If the used DIPs oscillator pins are labeled with OSC1 then the oscillator should be
placed in the OSC1 connector. If the used DIPs oscillator pins are labeled with OSC2 then
the oscillator should be placed in the OSC2 connector.
page ICD
ICD
IN-CIRCUIT
mikroICD is highly effective tool for Real-Time debugging on hardware level. mikroICD
DEBUGGER debugger enables you to execute a program on a PIC microcontroller and view variable val-
ues, Special Function Registers (SFR) and EEPROM as the program is running.
You can use mikroICD within any of MikroElektronikas compilers for PIC (mikroC,
mikroBasic or mikroPascal). All you have to do is to select appropriate build type (Release
or ICD Debug), build the project, program the MCU, select appropriate debugger
(mikroICD Debugger) and you are ready to go.
Note: For more information on how to use mikroICD debugger please refer to the mikroICD
documentation: mikroICD Users Manual. You can also find it within the Help documen-
tation inside any of the mentioned compilers.
mikroICD debugger uses on-board programmer to communicate with the compiler and it
supports common debugger commands:
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
15
EasyPIC4 Users Manual
LEDs MikroElektronika
Development tools
LEDs
Light Emitting Diodes (LEDs) are the most commonly used components, usually for dis-
playing pins digital state. EasyPIC4 has 36 LEDs that are connected to the microcontrollers
PORTA, PORTB, PORTC, PORTD and PORTE.
Each group of eight LEDs can be enabled or disabled using the switch SW2. The exception
is PORTE which has 4 LEDs and is connected to the same switch as PORTA.
Fig. 19. illustrates the connection of a LEDs to PORTB of the microcontroller. A resistor is
used in series with the LED to limit the LED's current. In this case the resistor's value is 1K.
page ICD
LEDs
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 LED.
ON
PORTB LED
PORTC LED CURRENT FLOW
PORTD LED
RB0
RB1
RN7
1 RB2
2
3 RB3
4
5 MCLR RB7
PICxxxx
RB6 RA5 RB1
R-SIL 8/9 RE0 RB0
RE1 VDD VCC
RB7 RE2 VSS
VDD RD7
VSS RD6
OSC1 RD5
X1 OSC2 RD4
8MHz
RC0 RC7
C6 C7
22pF 22pF RC1 RC6
RC2 RC5
RC3 RC4
RD0 RD3
RD1 RD2
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
17
EasyPIC4 Users Manual
PUSHBUTTON SWITCHES MikroElektronika
Development tools
PUSHBUTTON SWITCHES
Figure 21.
Reset switch schematic Reset switch Figure 20.
VCC
MCLR RB7
RA0 RB6
R17
10K
RA1 RB5
RA2 RB4
RA3 RB3
PICflash
RA4 RB2
On-Board USB
PICxxxx
programmer RA5 RB1 VCC
RE0 RB0
Reset
RE1 VDD
RE2 VSS
100n
C14
VDD RD7
VSS RD6
OSC1 RD5
X1 OSC2 RD4
8MHz
RC0 RC7
C6 C7
22pF 22pF RC1 RC6
RC2 RC5
RC3 RC4
RD0 RD3
RD1 RD2
Figure 22.
Pushbutton switches
page ICD
PUSHBUTTON SWITCHES
23. Jumper JP17 determines whether a button press will bring logical zero or logical one to
the appropriate pin.
When button is not pressed, pin state is determined by the pull-up or pull-down port
jumpers.
In the example shown in Fig. 23, JP17 is connected to +5V, therefore pressing the buttons
will bring logical one to the appropriate pins.
MCLR RB7
PICxxxx
RA5 RB1
RA2 RB2 RC2 RD2 RE2 RE0 RB0 VCC
RE1 VDD
RA3 RB3 RC3 RE2 VSS
RD3 RE3
VDD RD7
RA4 RB4 RC4 VSS RD6
RD4
OSC1 RD5
RA5 RB5 RC5 X1 OSC2 RD4
RD5 8MHz
RC0 RC7
RA6 C6 C7
RB6 RC6 RD6 22pF 22pF RC1 RC6
RC2 RC5
RA7 RB7 RC7 RD7 RC3 RC4
RD0 RD3
RD1 RD2
VCC
0V while button +5V while button
Figure 23. JP17 is pressed is pressed
Buttons schematic
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
19
EasyPIC4 Users Manual MikroElektronika
Development tools
vcc
set to pull-up, therefore when JP21
DIP40
port pin to be connected to RA3
RA4
RB3
RB2
ground (JP17 is in the lower RA5 RB1 RB4
RE0 RB0
position). RE1 VDD
vcc
RE2 VSS
VDD RD7
Thus, only when the button is VSS RD6 JP17 0V while pressed
pressed the microcontroller
will sense a logical zero; oth-
erwise the pin state will Figure 24. Button with pull-up resistor
always be logical one.
page ICD
8.
7-SEGMENT DISPLAYS
7 R 7-SEGMENT DISPLAYS
S E
A
E D EasyPIC4 has four 7-segment displays in multiplex mode. Data lines are connected to
G Y
PORTD, while each display is enabled through the lower four bits of PORTA.
Figure 26.
7-segment displays
8.
a
f b
g
e c
dp
d
MCLR RB7
RA0
RA1
RB6
RB5
DIS3 DIS2 DIS1 DIS0
RA2 RB4
RA3 RB3
RA4 RB2
PICxxxx
RA5 RB1
VCC
RE0 RB0
8. 8. 8. 8.
RE1 VDD
R9 - R2 10 9 8 7 6 10 9 8 7 6 10 9 8 7 6 10 9 8 7 6
RE2 VSS
dp
VDD RD7
g
VSS RD6
f
OSC1 RD5
e
X1 OSC2 RD4
8MHz
d
RC0 RC7
C6 C7
c
22pF 22pF
RC1 RC6
b
RC2 RC5
a
RC3 RC4 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
RD0 RD3
RD1 RD2
Q1 Q2 Q3 Q4
R10 R11 R12 R13
SW2
PORTA/E LEDs ON
1 2 3 4 5 6 7 8
ON
PORTB LEDs ON
PORTC LEDs ON
PORTD LEDs ON
RA3 DIS3
RA2 DIS2
RA1 DIS1
RA0 DIS0
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
21
EasyPIC4 Users Manual
GRAPHIC LCD 128X64 MikroElektronika
Development tools
Figure 28.
GLCD
selection
jumper
VCC
JP12
Vee GLCD contrast LCD8 contrast GLCD and LCD8
selected selected contrast not selected
E
P3 10K RA2 RB4
R28 2E2 R/W
Contrast Vo
VCC RA3 RB3
RS
Adjustment RA4 RB2
CS2
PICxxxx
RA5 RB1
CS1
RE0 RB0
VCC
RB1
RD1
RB0
RB2
RD0
RD2
RB3
RD3
RD7
RD6
RD5
RB5
RB4
RD4
RE1 VDD
1 20 RE2 VSS
CS1
D1
CS2
GND
VCC
RS
E
D0
D2
D3
D7
LED+
Vo
D6
Vee
D5
D4
RST
LED-
R/W
VDD D7
RD7
VSS D6
RD6
D5
OSC1 RD5
X1
D4
8MHz
OSC2 RD4
RC0 RC7
C6 C7
22pF 22pF RC1 RC6
RC2 RC5
RC3 RC4
Figure 30. D0
D1
RD0 RD3
D3
D2
RD1 RD2
GLCD schematic
page ICD
Figure 31.
LCD 2x16 in 4-bit mode
MCLR RB7
RA0 RB6
RA1 RB5
RA2 RB4
RA3 RB3
RA4 RB2
VCC RA5
PICxxxx RB1
RE0 RB0
RE1 VDD
Contrast
RE2 VSS
P4 Adjustment
10K VCC VDD RD7
VSS RD6
OSC1 RD5
RD2
GND
GND
GND
GND
GND
RD3
RD7
RD6
RD5
RD4
X1 OSC2 RD4
8MHz
RC0 RC7
1 14 C6 C7
RC1 RC6
D1
GND
VCC
VEE
RS
E
D0
D2
D3
D7
D6
D5
D4
R/W
22pF 22pF
RC2 RC5
Figure 32. RC3 RC4
LCD Display RD0 RD3
LCD 2x16 in 4-bit 4-bit mode RD1 RD2
mode schematic
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
23
EasyPIC4 Users Manual
LCD 2X16 IN 8-BIT MODE MikroElektronika
Development tools
Figure 33.
The LCD must be placed in the marked position with two free pins to the left and four free
pins to the right. It is important to note that the LCD should be placed or removed from
EasyPIC4 only when the power is off. Before attaching the LCD, set jumper JP12 to the left
position. The LCD's contrast can be adjusted using potentiometer P3 which is located to the
right of the GLCD/LCD connector.
NOTE: Special attention is required when placing the LCD. Otherwise the LCD can be per-
manently damaged.
page ICD
VCC
JP12
Vee GLCD contrast LCD8 contrast GLCD and LCD8
selected selected contrast not selected
PICxxxx
RA5 RB1
RE0 RB0
VCC
RD1
RB2
RD0
RD2
RB3
RD3
RD7
RD6
RD5
RB4
RD4
RE1 VDD
1 14 RE2 VSS
D1
GND
VCC
VEE
RS
E
D0
D2
D3
D7
D6
D5
D4
R/W
VDD D7
RD7
VSS D6
RD6
Leave two free D5
pins to the left side LCD Display X1
OSC1
OSC2
RD5
RD4
D4
8-bit mode
8MHz
RC0 RC7
C6 C7
22pF 22pF RC1 RC6
RC2 RC5
RC3 RC4
D0 D3
RD0 RD3
D1 D2
RD1 RD2
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
25
EasyPIC4 Users Manual
RS-232 COMMUNICATION MikroElektronika
Development tools
RS-232 COMMUNICATION
VCC
MCLR RB7
E11
10uF RA0 RB6
JP7
Figure 35. C1+ VCC
RC7
RA1
RA2
RB5
RB4
RS232 connector 6
PICxxxx
C2+ R1in RA5 RB1
E9 RB1
10uF C2- R1out RE0 RB0
VCC
V- T1in RE1 VDD
T2out T2in Rx C7 C6
RE2 VSS
Tx
JP6
Serial Cable CTS RB0
RTS RC2
Figure 36. 6
1
Rx
RTS
and a PC
page ICD
USB COMMUNICATION
USB COMMUNICATION
The USB communication connector is placed in the upper right corner of the EasyPIC4. It
is used with specific PIC microcontrollers that have USB support, such as PIC18F2450 or
PIC18F4550. Note that the USB communication connector cannot be used for programming
and that the USB programming connector cannot be
used for communication. In order to enable connection
between the microcontroller and USB communication
connector, the JP9 jumpers group should be set to the
right position. As the result, microcontroller pins
RC3, RC4 and RC5 are disconnected from the rest of
the system and connected to the USB communication
connector. Figure 37.
USB communication
connector
To enable USB
VCC
communication all
VCC
three jumpers have
to be set to the right
side. USB
100n 100n
D+ D-
MCLR RB7
RA0 RB6
JP9
RA1 RB5
RC3 RA2 RB4
RA3 RB3
RC3-U RA4 RB2
PICxxxx
RA5 RB1
RC4 RE0 RB0
VCC
RE1 VDD
RC4-U RE2 VSS
VDD RD7
RC5 VSS RD6
OSC1 RD5
RC5-U X1
8MHz
OSC2 RD4
RC0 RC7
Figure 38. C6
22pF
C7
22pF RC1 RC6
JP9 JP9
RC2 RC5
USB communica- RC3 RC4
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
27
EasyPIC4 Users Manual
PS/2 COMMUNICATION MikroElektronika
Development tools
Figure 39.
Figure 40.
PS/2 connector
Keyboard connected to
development board
MCLR RB7
VCC VCC RA0 RB6
RA1 RB5
RA2 RB4
VCC
PS2 R38 R37 RA3 RB3
NC CLK CONNECTOR
10K 10K
RA4 RB2
PICxxxx
RA5 RB1
DATA
NC RE0 RB0
GND VCC
VCC RE1 VDD
+5V CLK
NC RE2 VSS
VDD RD7
NC DATA VSS RD6
JP10
OSC1 RD5
OSC2 RD4
RC0 RC7
RC1 RC6
X1
8MHz
RC2 RC5
C6 C7
RC3 RC4
22pF 22pF
RD0 RD3
RD1 RD2
Figure 41.
PS/2 communication schematic
page ICD
RC0 RC7
C6 C7
22pF 22pF RC1 RC6
RC2 RC5
RC3 RC4
RD0 RD3
RD1 RD2
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
29
EasyPIC4 Users Manual
ANALOG TO DIGITAL CONVERTER INPUT MikroElektronika
Development tools
Figure 44.
A-D Converter input
In order to measure analog signal without interference, turn the coresponding switch on
SW1 to OFF position. This will disable connection of the used PORTA pin to the pull-
up/down resistors.
Applications of A-D Conversion are various. Microcontroller takes analog signal from its
input pin and translates it into a digital value. Basically, you can measure any analog signal
that fits in range acceptable by PIC. That range is 0V to 5V.
page ICD
RA1
RA0
RA3
RA4
RA5
RA2
ON
SW1
vcc vcc
1 2 3 4 5 6 7 8
0 - 5V 0 - 5V
P1 P2
10K 10K
JP15 JP16
MCLR RB7
RA0 RB6
RA1 RB5
RA2 RB4
RA3 RB3
RA4 RB2
PICxxxx
RA5 RB1 vcc
RE0 RB0
RE1 VDD
Potentiometer P1 is con- RE2 VSS
nected to RA2 pin and
VDD RD7
potentiometer P2 is con-
VSS RD6
nected to RA3 pin.
OSC1 RD5
X1 OSC2
8MHz
RD4
RC0 RC7
C6 C7
22pF 22pF RC1 RC6
RC2 RC5
RC3 RC4
RD0 RD3
RD1 RD2
NOTE: Jumpers JP15 and JP16 should not select the same pin.
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
31
EasyPIC4 Users Manual
DIRECT PORT ACCESS MikroElektronika
Development tools
These connectors can be used for system expansion with external boards such as Serial
Ethernet, Compact Flash, MMC/SD, ADC, DAC, CAN, RTC, RS-485, etc. Ensure that the
on-board peripherals are disconnected 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 47.
Example of how to connect
external peripheral with flat
cable
page ICD
RPACK8/9
8x10K
MCLR RB7
RA0 RB6
RA1 RB5
RA2 RB4
RA3 RB3
RA4 RB2
PICxxxx
RA5 RB1
RE0 RB0
RE1 VDD VCC CN9
RE2 VSS
RB0 RB1
VDD RD7
VSS RD6 RB2 RB3
OSC1 RD5
X1
8MHz
OSC2 RD4 RB4 RB5
RC0 RC7
C6
22pF
C7
22pF RC1 RC6 RB6 RB7
RC2 RC5
RC3 RC4
RD0 RD3
RD1 RD2
VCC
HEADER 5x2
ICD page
EasyPIC 4 MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
33
EasyPIC4 Users Manual MikroElektronika
Development tools
Technical Support :
support@mikroe.com
E-mail: office@mikroe.com
Web: www.mikroe.com
Forum: www.mikroe.com/forum/
page ICD