Download BIGPIC4 Manual - MikroElektronika

Transcript
SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
MikroElektronika
Development tools - Books - Compilers
BigPIC4
User’s Manual
mikro
3 in 1
ICD
IN-CIRCUIT
DEBUGGER
USB 2.0
IN-CIRCUIT
PROGRAMMER
MICROCHIP
PIC
With useful implemented peripherals, plentiful practical
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
development boards make fast and reliable tools that
can satisfy the needs of experienced engineers and
beginners alike.
DEVELOPMENT
BOARD
Software and Hardware
solutions for Embedded World
BigPIC4 User’s Manual
MikroElektronika
Development tools
Second edition
December 2006
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.
page
ICD
BIGPIC
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
2
CONTENTS
BigPIC4 User’s Manual
MikroElektronika
Development tools
CONTENTS
CONNECTING THE SYSTEM
page 4
INTRODUCTION
page 5
DESCRIPTION OF THE DEVELOPMENT SYSTEM
page 6
Switches and their functions
page 6
Jumpers
page 7
MCU card
page 8
Power Supply
page 11
On-board USB 2.0 programmer
page 12
mikroICD (In-Circuit Debugger)
page 13
LEDs
page 14
Pushbutton switches
page 16
Graphic LCD
page 19
LCD 2x16 in 4-bit mode
page 20
LCD 2x16 in 8-bit mode
page 21
RS-232 Communication
page 23
DS1820 Digital Thermometer
page 26
A-D Converter input
page 27
PS/2 (Keyboard) connector
page 29
Direct port access
page 30
MMC/SD (Multimedia Card)
page 32
page
ICD
BIGPIC
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
3
CONNECTING THE SYSTEM
BigPIC4 User’s Manual
MikroElektronika
Development tools
CONNECTING THE SYSTEM
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 connect 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 PICFLASH 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 BIGPIC4 board. You will be asked for
the PICFLASH drivers. Point to them in order to finish the driver installation. They are
placed in the folder:
System_Drive:\Program Files\Mikroelektronika\PICFLASH\Driver.NT
Step no.4 Run and use PICFLASH as explained in the document ‘PICflash programmer’.
CD_Drive:\product\pdf\picprog_manual.pdf.
After these 4 steps, your BIGPIC4 is installed and ready for use. You can try to read a program from the chip or to load an example from the examples folder of mikroElektronika’s
compilers for PIC or from the product CD:
CD_Drive:\product\zip\bigpic4_examples.zip.
page
4
ICD
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
BIGPIC
4
MICROCHIP
PIC
DEVELOPMENT
BOARD
INTRODUCTION
The BIGPIC4 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. On a silkscreen, there are identification marks
next to each component. These marks describe connections to the microcontroller, operation
modes and provide other useful notes. The need for additional schematics is minimized as
all relevant information is printed on the board.
BIGPIC4 development board
Figure 1.
page
ICD
BIGPIC
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
5
INTRODUCTION
BigPIC4 User’s Manual
MikroElektronika
Development tools
SWITCHES
BigPIC4 User’s Manual
MikroElektronika
Development tools
SWITCHES
The BIGPIC4 development board features many 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 BIGPIC4 development system has three
groups of switches.
The first group, SW1, enables a connection between the microcontroller PORTA with
external pull-up/down resistors. When PORTA pins are used as digital inputs/outputs, the
appropriate pull-up/down resistors should be enabled.
The switches of SW2 are used to enable LEDs connected to PORTA, PORTB, PORTC,
PORTD, PORTE and PORTF. For example, if switch PORTB is OFF, all PORTB LED’s
will be turned off.
The switches of SW3 enable connections among the microcontroller pins and MMC/SD
Card via SPI communication and also among the microcontroller pins and both RS232
communication devices. The first two switches are used for RS232 A communication lines, while the second two are used for RS232 B communication lines and the last four
are used for MMC/SD Card.
ON
Group of 8 switches
1 2 3 4 5 6 7 8
Figure 2.
Switch 1 and 2 are ON,
and other switches are
OFF
Switch is ON
Switch is OFF
page
6
ICD
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
BIGPIC
4
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 when the jumper
is placed between two disconnected pins.
For example, the jumper J10 is used to connect or disconnect potentiometer for analog input.
A connection is made when the jumper is placed between two contacts.
Figure 3.
Jumper is ON
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 connector can be connected to the left or
right pin, depending on the jumper’s position.
Figure 4.
All lines are
disconnected
Left line
is selected
Right line
is selected
Jumper as a
multiplexer
page
ICD
BIGPIC
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
7
JUMPERS
BigPIC4 User’s Manual
MikroElektronika
Development tools
MCU CARD
BigPIC4 User’s Manual
MikroElektronika
Development tools
MCU CARD
The BIGPIC4 development board has a 80-pin MCU Card. If you want to use some other
microcontroller, all you have to do is to change MCU Cards. BIGPIC4 MCU Card is shown
on the following picture:
Figure 5.
MCU Card
page
8
ICD
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
BIGPIC
4
When you are placing MCU Card on the BIGPIC4 MCU socket, you must follow these
steps:
Step no.1
If there is already MCU Card
placed on BIGPIC4, you must
remove it by slowly pulling it up.
Step no.2
Place MCU Card on the board.
Note that label on the MCU Card
must be at the upper-left corner as
it is drawn on the BIGPIC4 board.
Step no.3
When MCU Card is on the place,
push it down by applying the
pressure on all edges at the same
time.
page
ICD
BIGPIC
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
9
MCU CARD
BigPIC4 User’s Manual
MikroElektronika
Development tools
BigPIC4 User’s Manual
MikroElektronika
Development tools
MCU CARD
The microcontroller’s pins are routed to various peripherials as illustrated in Fig.6. All ports
have direct connections to Direct Port Access connectors. Such connectors are typically used
for connecting external peripherials to the board, or for providing useful points for connecting digital logic probes.
All ports are connected to LEDs, push-button switches and pull-up/down resistors , allowing easy digital pin state monitoring and testing.
Some of the pins are connected to other peripherials such as the DS1820 temperature sensor, RS-232 communication, LCD, etc.
SW2
RE1
PORTE
VCC
VCC
ON
CN5
1 2 3 4 5 6 7 8
PORTE
J5
PORTE
RE1
VCC
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
RE1
VCC
J12
System connection
100n
Figure 6.
Reset
10K
VCC
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
X1
10MHz
C1
22pF
page
10
C2
22pF
ICD
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
BIGPIC
4
POWER SUPPLY
POWER SUPPLY
SELECTABLE
As a power supply source, user can select either a regulated supply from 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 J14 should be set in the right-hand position.
In case of an external power supply, the BIGPIC4 board produces +5V using an LM7805
voltage regulator. The external power supply can be AC or DC, with a voltage between 8V
and 16 V and the jumper J14 should be set in the left-hand position. In Fig. 7 you can see
the power connectors : USB (left) and external (right).
Figure 8. Power supply select jumper
Figure 7. USB and power supply connectors
J14 in the left-hand
position: system will
take power from the
external AC/DC
power adapter.
J14 in the right-hand
position: system will
take power from the
USB cable.
USB
connector
External power
supply connector
CN10
REG1
7805
+
1
USB
USB Power Supply
EXT
USB
External Power Supply
EXT
8-16V (AC/DC)
1
EXT
Vin
Vout
5V
J14
USB
FP1
5V
3
GND
2
2
E1
470uF
Figure 9.
C1
100nF
J14 is set to USB power supply
C2
100nF
E2
470uF
C3
100nF
VCC
DD+
GND
VCC
4
USB
connector
page
ICD
BIGPIC
USB
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
11
POWER SUPPLY
BigPIC4 User’s Manual
MikroElektronika
Development tools
MikroElektronika
Development tools
ON-BOARD USB 2.0 PROGRAMMER
USB 2.0
There is no need for the use of external
equipment during programming, as the
BIGPIC4 development system has its own
on-board USB 2.0 programmer.
IN-CIRCUIT
PROGRAMMER
All you need to do is connect the system to
a PC using the USB cable. Then, load your
program into the microcontroller via the
PICflash programming software, which is
supplied with the board.
Figure 10. On-Board USB programmer
Note: There is no need for manually reseting MCU after programming. The programmer
will reset the MCU automatically.
VCC
VCC
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
1K
POWER
Figure 11. Switch schematic
10K
SWITCH
C2
22pF
TO PERIPHERALS
ON DEVELOPMENT BOARD
Reset
100n
U3
X1
10MHz
C1
22pF
VCC
VCC
USB LINK
1K
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
PICflash
On-Board USB
programmer
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
ON-BOARD USB 2.0 PROGRAMMER
BigPIC4 User’s Manual
VCC CN2
1
VCC
2
D3
D+
4
27
GND
27
USB CONN.
page
12
USB
ICD
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
BIGPIC
4
mikro
ICD
IN-CIRCUIT
DEBUGGER
mikroICD (Real-Time Hardware In-Circuit Debugger)
mikroICD is highly effective tool for Real-Time debugging on hardware level. mikroICD
debugger enables you to execute a program on a PIC microcontroller and view variable values, Special Function Registers (SFR) and EEPROM as the program is running.
You can use mikroICD within any of MikroElektronika’s 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 User’s Manual”. You can also find it within the Help documentation inside any of the mentioned compilers.
mikroICD debugger uses on-board programmer to communicate with the compiler and it
supports common debugger commands:
Start Debugger
[F9]
Run/ Pause Debugger [F6]
Toggle Breakpoints [F5]
Run to cursor
[F4]
Step Into
[F7]
Step Over
[F8]
Step Out
[Ctrl+F8]
Flush RAM
[F2]
Stop Debugger [Ctrl+F2]
Figure 12. On-Board USB programmer
with mikroICD
page
ICD
BIGPIC
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
13
mikroICD (IN-CIRCUIT DEBUGGER)
BigPIC4 User’s Manual
MikroElektronika
Development tools
LEDs
BigPIC4 User’s Manual
MikroElektronika
Development tools
LEDs
Light Emitting Diodes (LEDs) are the most commonly used components, usually for displaying pin’s digital state. The BIGPIC4 has 46 LEDs that are connected to the microcontroller’s ports PORTA, PORTB, PORTC, PORTD, PORTE and PORTF.
Figure 13. Light Emitting Diodes
Each group of eight LEDs (except PORTA which has 6 LEDs) can be enabled or disabled
using switch SW2, as shown in Fig. 13.
Fig. 14. illustrates the connection of a LEDs to PORTD 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
14
ICD
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
BIGPIC
4
All 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. The
LEDs are enabled when connected to a ground and will display the state of the corresponding microcontroller pin; otherwise the LEDs will always be off, no matter what the pin state
is, because no current can flow through them.
LEDs
BigPIC4 User’s Manual
MikroElektronika
Development tools
SW2
ON
1 2 3 4 5 6 7 8
PORTA LED
PORTB LED
PORTC LED
PORTD LED
PORTE LED
PORTF LED
RD7
RD6
CURRENT FLOW
RN13
1
2
3
4
RD5
RD4
5
6
7
8
9
RD3
RD2
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
RD1
RPACK8/9
8x1K
RD0
VCC
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
X1
10MHz
C1
22pF
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
100n
Reset
10K
VCC
Figure 14. LED schematic
page
ICD
BIGPIC
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
15
C2
22pF
MikroElektronika
Development tools
PUSHBUTTON SWITCHES
The BIGPIC4 has 46 push buttons, which can be
used to provide digital inputs to microcontroller's
ports. There is also one push button that acts as a
RESET (Figure 15).
VCC
Figure 16.
10K
VCC
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
100n
PICflash
On-Board USB
programmer
Reset button Figure 15.
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
Reset button scheme
Reset
PUSHBUTTON SWITCHES
BigPIC4 User’s Manual
X1
10MHz
C1
22pF
C2
22pF
Figure 17.
Pushbutton switches
page
16
ICD
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
BIGPIC
4
Buttons connections to PORTA, PORTB, PORTC, PORTD, PORTE and PORTF are shown
in Fig. 18. Jumper J12 determines whether a button press will bring logical zero or logical
one to the appropriate pin.
When the button is not pressed, the pin state is determined by the pull-up or pull-down port
jumpers.
In the example shown in Fig. 18, J12 is connected to +5V, so pressing the buttons will bring
logical one to the appropriate pins.
PORTA
PORTB
PORTC
PORTE
PORTD
PORTF
RA0
RB0
RC0
RD0
RE0
RF0
RA1
RB1
RC1
RD1
RE1
RF1
RA2
RB2
RC2
RD2
RE2
RF2
RA3
RB3
RC3
RD3
RE3
RF3
RA4
RB4
RC4
RD4
RE4
RF4
RA5
RB5
RC5
RD5
RE5
RF5
RB6
RC6
RD6
RE6
RF6
RB7
RC7
RD7
RE7
RF7
VCC
J12
VCC
Figure 18.
+5V while button
is pressed
VCC
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
100n
Reset
10K
0V while button
is pressed
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
Buttons schematic
4
C1
22pF
C2
22pF
page
ICD
BIGPIC
X1
10MHz
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
17
PUSHBUTTON SWITCHES
BigPIC4 User’s Manual
MikroElektronika
Development tools
On Fig. 19 the J5 jumper is set
to pull-up, so when the button is
not pressed pull-up resistor
pulls the microcontroller’s RE0
pin to +5V.
MikroElektronika
Development tools
vcc
J5
PORTE
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
RE0
A button press causes the port
pin to be connected to ground
(J12 is in the lower position).
VCC
RE0
10K
vcc
J12
0V while pressed
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
X1
10MHz
C1
22pF
100n
vcc
J5
PORTE
VCC
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
pull-down
RE0
A button press causes the port
pin to be connected to +5V (J12
is in the upper position).
RE0
VCC
10K
vcc
100n
5V while pressed
Reset
J12
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
X1
10MHz
C2
22pF
C1
22pF
Figure 20. Button with pull-down resistor
page
18
C2
22pF
Figure 19. Button with pull-up resistor
On Fig. 20 the J5 jumper is set
to pull-down, so when the button is not pressed pull-down
resistor sets the microcontroller’s RE0 pin to 0V.
Thus, only when the button is
pressed the microcontroller
will sense a logical one; otherwise the pin state will always be
logical zero.
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
Reset
Thus, only when the button is
pressed the microcontroller will
sense a logical zero; otherwise
the pin state will always be logical one.
VCC
pull-up
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
PUSHBPUSHBUTTON SWITCHES
BigPIC4 User’s Manual
ICD
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
BIGPIC
4
GRAPHIC LCD 128X64
BigPIC4 User’s Manual
MikroElektronika
Development tools
GRAPHIC LCD
GRAPHIC LCD
CONNECTOR
A 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 the
screen resolution of 128x64 pixels. Before a GLCD is connected, the user needs to set the
jumper J9 (Fig. 21) to the lower position. The GLCD’s contrast can be adjusted using the
potentiometer P3. Jumper J9 and potentiometer P3 are placed to the upper-right of the
GLCD.
ON-BOARD
Figure 21.
GLCD
selection
jumper
In order to enable GLCD
jumper J9 should be set to
the lower position, labeled
as GRAPH.
GLCD Figure 22.
VCC
J9
CHAR.
GLCD contrast
selected
GRAPH.
LCD8 contrast
selected
GLCD and LCD8
contrast not selected
VCC
Vee
E
D5
D6
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
4
R/W
X1
10MHz
C1
22pF
C2
22pF
page
ICD
BIGPIC
RS
RST
10K
D7
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
GLCD schematics
100n
Figure 23.
D3
D4
RH5
RH6
RH7
RJ5
RH4
RJ2
RJ3
RJ4
RH0
RH1
RH2
RH3
D2
VCC
20
Reset
1
CS1
CS2
GND
VCC
Vo
RS
R/W
E
D0
D1
D2
D3
D4
D5
D6
D7
RST
Vee
LED+
LED-
RJ0
RJ1
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
VCC
CS1
D1
R16 10
Vo
D0
P3 10K
Contrast
Adjustment
CS2
VCC
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
19
2x16 LCD
CONNECTOR
2x16 LCD
ON-BOARD
MikroElektronika
Development tools
LCD 2X16 IN 4-BIT MODE
The standard character LCD is probably the most widely used data visualization component. Usually, it can display two lines of 16 alphanumeric characters, each character made
up of 5x8 pixels. The character LCD communicates with the microcontroller via a 4-bit or
8-bit data bus, each requiring the use of a different connector on the BIGPIC4 development
board. For 4-bit data bus use, the LCD should be placed in the upper left of the board, above
the LEDs. The connection to the microcontroller is shown in Fig. 25 where there are only
four data lines. It is important that the LCD is only inserted or removed from the BIGPIC4
when the power is off.
Figure 24.
LCD 2x16 in 4-bit mode
VCC
RS
E
14
D7
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
D6
D5
LCD Display
mikroElektronika
100n
1
Reset
RH2
GND
RH3
GND
GND
GND
GND
RH4
RH5
RH6
RH7
10K
Vo
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
VCC
X1
10MHz
C1
22pF
C2
22pF
D4
Contrast
Adjustment
P4
10K
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
VCC
GND
VCC
VEE
RS
R/W
E
D0
D1
D2
D3
D4
D5
D6
D7
LCD 2X16 IN 4-BIT MODE
BigPIC4 User’s Manual
Figure 25. LCD 2x16 in 4-bit mode schematics
page
20
ICD
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
BIGPIC
4
2x16 LCD
CONNECTOR
2x16 LCD
ON-BOARD
LCD 2X16 IN 8-BIT MODE
When using a character LCD in 8-bit mode, it should be placed on the GLCD connector.
Since GLCD connector has 20 pins and the character LCD has only 14 pins, special attention is required when placing the LCD. Otherwise the LCD can be permanently damaged.
The LCD must be placed in the marked position with two free pins to the left and four free
pins to the right. When you add or remove LCD be sure that the power supply is off.
View from the back:
shows which pins
stays disconnected.
Figure 26. LCD 2x16 in 8-bit mode
Before adding the LCD, set the jumper J9 to the upper position, labeled as CHAR. The
LCD's contrast can be adjusted using potentiometer P3, which is located to the upper-right
of the GLCD/LCD connector (Fig. 26).
NOTE: Special attention is required when placing the LCD. Otherwise the LCD can be permanently damaged.
page
ICD
BIGPIC
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
21
L C D 2 X 1 6 I N 8- B I T M O D E
BigPIC4 User’s Manual
MikroElektronika
Development tools
MikroElektronika
Development tools
In order to enable LCD,
jumper J9 should be set to
the position labeled as
CHAR.
VCC
J9
CHAR.
GLCD contrast
selected
LCD8 contrast
selected
GLCD and LCD8
contrast not selected
Vee
GRAPH.
VCC
VCC
D1
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
Leave two free
pins to the left side
Figure 27. LCD 8-bit mode schematic
100n
10K
Reset
LCD8 Display
mikroElektronika
D7
D6
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
RS
R/W
page
22
X1
10MHz
C1
22pF
E
D3
14
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
D2
VCC
1
D4
RJ2
RJ3
RJ4
RH0
RH1
RH2
RH3
RH4
RH5
RH6
RH7
Leave four
free pins to
the right side
D5
Vo
D0
P3 10K
Contrast
Adjustment
GND
VCC
VEE
RS
R/W
E
D0
D1
D2
D3
D4
D5
D6
D7
L C D 2 X 1 6 I N 8- B I T M O D E
BigPIC4 User’s Manual
ICD
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
BIGPIC
4
C2
22pF
RS232
ENABLED
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 each other,
a level transition buffer such as the MAX232 must be used.
Figure 28. RS232 connectors
BIGPIC4 development board have two RS-232 communication devices, RS-232 A and RS232 B. In order to provide a more flexible system, the microcontroller is connected to the
MAX232 through DIP-switch SW3. The first two switches on SW3 are used to connect Rx
and Tx lines from microcontroller to RS-232 A port, and the second two for connecting Rx
and Tx lines to RS-232 B.
page
ICD
BIGPIC
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
23
R S- 2 3 2 C O M M U N I C A T I O N
BigPIC4 User’s Manual
MikroElektronika
Development tools
R S- 2 3 2 C O M M U N I C A T I O N
BigPIC4 User’s Manual
MikroElektronika
Development tools
PC
6
RS-232
CON
9
1
5
Receive
data (Rx)
CONNECT
MCU TO PC
SERIAL
CABLE
CONNECT
PC TO MCU
6
RS-232 A
CON
9
8
CN11
SUB-D 9p
VCC
4
9
5
1
2
7
3
5
6
1
Send
Data (Tx)
VCC
VCC
E4
10uF
VS+
C1C2+
C2VS-
T2OUT
R2IN
VCC
GND
T1OUT
R1IN
R1OUT
T1IN
T2IN
R2OUT
16
15
14
13
12
11
10
9
SW3
X1
10MHz
C1
22pF
ON
1 2 3 4 5 6 7 8
RS-232 B
Tx
Connection between microcontroller and a PC: RS-232 A
page
24
C2
22pF
Rx
RS-232 A
Figure 29.
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
C1+
MAX232
E5
10uF
1
2
3
4
5
6
7
8
Reset
U1
100n
E6
10uF
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
10K
C11
100nF
E3
10uF
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
VCC
ICD
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
BIGPIC
4
R S- 2 3 2 C O M M U N I C A T I O N
BigPIC4 User’s Manual
MikroElektronika
Development tools
PC
6
RS-232
CON
9
1
5
Receive
data (Rx)
CONNECT
MCU TO PC
SERIAL
CABLE
CONNECT
PC TO MCU
6
RS-232 B
CON
9
8
CN12
SUB-D 9p
VCC
4
9
5
1
2
7
3
5
6
1
Send
Data (Tx)
VCC
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
C11
100nF
10K
VCC
U2
C1C2+
C2VS-
T2OUT
R2IN
VCC
GND
T1OUT
R1IN
R1OUT
T1IN
T2IN
R2OUT
16
15
14
13
12
11
10
9
100n
VS+
SW3
RS-232 B
ON
RS-232 A
1 2 3 4 5 6 7 8
E8
10uF
C1+
Reset
E9
10uF
1
2
3
4
5
6
7
8
MAX232
E7
10uF
Rx
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
X1
10MHz
C1
22pF
C2
22pF
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
VCC
E10
10uF
Tx
Connection between microcontroller and a PC: RS-232 B Figure 30.
page
ICD
BIGPIC
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
25
MikroElektronika
Development tools
DS1820 DIGITAL THERMOMETER
The DS1820 digital thermometer is well suited
to environmental temperature measurement,
having the temperature range of -55°C to
125°C and the accuracy of +/-0.5°C. It must be
placed correctly in the 3-pin socket provided on
the BIGPIC4, with its rounded side to the left,
as marked on the board (Fig 31). Otherwise the
DS1820 could be permanently damaged. In
order to work, DS1820 must be connected to
microcontroller’s RA5 pin, by enabling jumper
J13.
Figure 31. DS1820
VCC
There is a mark in the form
of half-circle for proper orientation of DS1820 sensor.
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
125 C
10K
VCC
DS1820
VCC
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
X1
10MHz
C1
22pF
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
VCC
100n
-50 C
Reset
DS1820 DIGITAL THERMOMETER
BigPIC4 User’s Manual
GND
VCC
C2
22pF
J13
DQ
RA5 is connected
RA5 is disconnected
Figure 32.
DS1820 Schematic
page
26
ICD
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
BIGPIC
4
ADC INPUT
ENABLED
A-D CONVERTER INPUT
BIGPIC4 development board has two potentiometers for working with Analog to Digital
Converter (ADC). Both potentiometers outputs are in the range of 0V to 5V. Two analog signals can be connected on two different analog input pins at the same time. The jumper J10
enables connection between potentiometer P1 and pin RA2. The jumper J11 enables connection between potentiometer P2 and pin RA3.
Figure 33.
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 from the used PORTA pin to the pullup/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
BIGPIC
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
27
A-D CONVERTER INPUT
BigPIC4 User’s Manual
MikroElektronika
Development tools
MikroElektronika
Development tools
Figure 34.
vcc
J1
pull-up/down
A-D Converter input schematics
PORTA
vcc
SW1
P1
10K
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
X1
10MHz
C1
22pF
RA2
0 - 5V
RA3
0 - 5V
vcc
P2
10K
RA2 is connected
J10
RA3 is connected
J11
RA2 is disconnected
RA3 is disconnected
Potentiometer P1 is connected to RA2 pin and
potentiometer P2 is connected to RA3 pin.
Potentiometers P1
and P2 are disconnected from the
microcontroller.
page
28
C2
22pF
J10
J11
0 - 5V
ON
vcc
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
Pull-up/down resistors on PORTA
analog input pins
should be disabled
using SW1
100n
Reset
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
10K
vcc
1 2 3 4 5 6 7 8
A-D CONVERTER INPUT
BigPIC4 User’s Manual
ICD
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
BIGPIC
4
PS/2 READY
DEVELOPMENT
PS/2 (KEYBOARD) CONNECTOR
The PS/2 connector allows direct connection
between BIGPIC4 and devices that use PS/2
communication, such as PC, keyboard or
mouse. For example, the microcontroller can
be connected to a keyboard to capture
pressed keys or it can be connected to a PC to
act as a keyboard. CLK and DATA lines are
used for data tansfer. In this case, they are
connected to pins RC1 and RC0 respectively.
Figure 35.
CLK
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
NC
VCC
Figure 36.
100n
DATA
Reset
NC
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
10K
+5V
PS2
CONNECTOR
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
PS/2 communication
schematic VCC
DATA
NC
GND
VCC
CLK
NC
PS/2 connector
VCC
Keyboard connected to
development board
X1
10MHz
C1
22pF
RC0
RC1
CLK and DATA lines are
connected to RC1 and
RC0 pins respectively.
page
ICD
BIGPIC
4
C2
22pF
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
29
PS/2 (KEYBOARD) CONNECTOR
BigPIC4 User’s Manual
MikroElektronika
Development tools
DIRECT PORT ACCESS
BigPIC4 User’s Manual
MikroElektronika
Development tools
DIRECT PORT ACCESS
All microcontroller input/output pins can be accessed via connectors placed along the right
side of the board. For each of PORTA, PORTB, PORTC, PORTD, PORTE, PORTF and
PORTG there is one 10-pin connector providing VCC, GND and up to eight port pins.
Direct port access connectors Figure 37.
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 38.
Example of how to connect
external peripheral with flat
cable
page
30
ICD
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
BIGPIC
4
VCC
Pull-up line is
connected
J2
Figure 39. Port B connection
RN2
Pull-down line
is connected
All lines
are disconnected
1
RB7 2
RB6 3
RB5 4
RB4 5
RB3
RB2
RB1
RB0
VCC
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
RPACK8/9
8x10K
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
CN2
X1
10MHz
C1
22pF
RB0
RB1
RB2
RB3
RB4
RB5
RB6
RB7
VCC
C2
22pF
HEADER 5x2
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
100n
Reset
10K
VCC
6
7
8
9
page
ICD
BIGPIC
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
31
DIRECT PORT ACCESS
BigPIC4 User’s Manual
MikroElektronika
Development tools
MMC/SD (MULTIMEDIA) CARD
BigPIC4 User’s Manual
MMC/SD
MASS STORAGE
256MB
SUPPORTED
MikroElektronika
Development tools
MMC/SD (MULTIMEDIA CARD)
MMC card is used as storage media for a portable devices, in a form that can easily be
removed for access by a PC. For example, a digital camera would use an MMC card for
storing image files. With an MMC reader (typically small box that connects via USB or
some other serial connection) you can easily transfer data from MMC card to your computer. Microcontroller on BIGPIC4 communicates with Multi Media Card via SPI communication.
Modern computers, both laptops and desktops, often have
SD slots, which can read
MMC cards.
Figure 40.
MMC slot on-board
To enable MMC card you must turn on switches 5, 6, 7 and 8 on SW3. By doing that, microcontrollers’s SPI comunnication lines (SDI, SDO and SCK) and Chip Select are connected
to MMC. Working voltage of BIGPIC4 is 5V DC, while working voltage of MMC card is
3.3V DC. Because of that, there is a voltage regulator on-board with MMC card
(MC33269DT-3.3). Data lines from microcontroller to MMC card must be also adjusted to
3.3V. It is done with resister voltage dividers as shown on Figure 41.
page
32
ICD
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
BIGPIC
4
SPI-SDI
MMC-CS#
SPI-SDO
SPI-SCK
R19
2K2
VCC3
R21
2K2
CN22
1
2
3
4
5
6
7
R22
3K3
3
VCC
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
Vdd
Vss
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
MC33269
DT-3.3
C13
100nF GND
1
2
C12
100nF
VIN
VOUT
E16
10uF
SW3
VCC3
VCC
ON
SPI-SCK
RC4
RC3
RC5
RJ6
RH2
RH3
RE1
RE0
RG0
RG1
RG2
RG3
MCLR
RG4
Vss
Vdd
RF7
RF6
RF5
RF4
RF3
RF2
RH7
RH6
PIC18FXXXX
RJ2
RJ3
RB0
RB1
RB2
RB3
RB4
RB5
RB6/PGC
Vss
OSC2
OSC1/CLKI
Vdd
RB7/PGD
RC5
RC4
RC3
RC2
RJ7
RJ6
X1
10MHz
C1
22pF
C2
22pF
RH5
RH4
RF1
RF0
AVdd
AVss
RA3
RA2
RA1
RA0
Vss
Vdd
RA5
RA4
RC1
RC0
RC6
RC7
RJ4
RJ5
SPI-SDO
MMC-CS#
1 2 3 4 5 6 7 8
SPI-SDI
VCC
REG2
VCC
VCC3
MMC/SD
CARD
10K
R20
3K3
Reset
R18
3K3
CS
Din
GND
+3.3V
SCK
GND
Dout
100n
R17
2K2
MMC schematic Figure 41.
page
ICD
BIGPIC
4
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
33
MMC/SD (MULTIMEDIA) CARD
BigPIC4 User’s Manual
MikroElektronika
Development tools
BigPIC4 User’s Manual
MikroElektronika
Development tools
If you are experiencing problems with any
of our products or you just want additional
information, please let us know. We are
committed to meeting your every need.
Technical Support :
[email protected]
If you have any other question, comment
or a business proposal, please contact us:
E-mail: [email protected]
Web:
www.mikroe.com
Forum: www.mikroe.com/forum/
page
34
ICD
MIKROELEKTRONIKA SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD
BIGPIC
4