Documente Academic
Documente Profesional
Documente Cultură
240x128
TO OUR VALUED CUSTOMERS
I want to express my thanks to you for being interested in our products and for having
confidence in MikroElektronika.
The primary aim of our company is to design and produce high quality electronic products
and to constantly improve the performance thereof in order to better suit your needs.
Nebojsa Matic
General Manager
The PIC®, dsPIC®, PIC24®, PIC32® and Windows® logos and product names are trademarks of Microchip Technology® and Microsoft® in the U.S.A. and other countries.
Page 2
Table of Contents
What is the SmartGLCD 240x128? 4 step 5 – Uploading .hex file 15
Package Contains 5 step 6 – Progress bar 16
1. Key Features 6 step 7 - Finishing upload 16
System Specification 7 Tips and Tricks: Speed-up UART data transfer 17
2. Power supply 8 6. Programming with mikroProg™ programmer 18
3. PIC18F87K22 microcontroller 10 7. mikroProg Suite™ for PIC® Software 20
Key microcontroller features 10 8. microSD Card Slot 22
4. Programming the microcontroller 11 9. Touch Screen 24
5. P
rogramming with bootloader 12 10. RGB backlight 26
mikroBootloader software 12 11. Contrast potentiometer 27
Identifying device COM port 13 12. USB UART 28
step 1 – Choosing COM port 13 13. Buzzer 30
step 2 - Establishing Connection 14 14. Pinout 32
step 3 - Browsing for .HEX file 14 15. Dimensions 33
step 4 – Selecting .hex file 15 What’s next? 34
Page 3
What is the SmartGLCD 240x128?
Page 4
Package Contains
19122011
www.mikroe.com
SmartGLCD SCHEMATICS
240x128 I2C/SPI I2C/SPI
SCK1/SCL1
SCK2/SCL2
RX UART
SDI1/SDA1
SDI2/SDA2
SmartGLCD
Digital I/O
Digital I/O
Digital I/O
Digital I/O
5V power
0 100000 024447
Ground
Digital
supply
SDO1
SDO2
INT PWM Analog I/O mikroProg
AN2
AN3
AN4
I/O
TX
ver. 1.51
GND
RA2
RA3
RA4
RA5
RD1
GND
RB0
RB1
RB2
RB3
RD4
RD5
RB4
RD0
RD2
RD3
RD6
RD7
PGD
RG1
RC3
RC4
RC5
RE1
RG2
RE0
RE2
RE3
RE4
RE5
RE6
RE7
RF1
RF2
RF3
RF5
RF4
RF6
RST
RF7
PGC
5V
NC
5V
SmartGLCD 240x128 - pinout
240x128
We present you with a complete color schematics for SmartGLCD 240x128
Interrupt Lines
development board. We want you to know what your board is consisted of and
UART lines
how it actually works.
Analog Lines
I2C Lines
SPI Lines
3.3V power supply output 5V power supply
Ground Ground
02 RESET button
01
03 Power supply pads
04 I/O pads
06 USB connector
08 PIC18F87K22 microcontroler
09 Contrast potentiometer
12 Buzzer 02 03
Page 6
System Specification
12 04 05 06
power supply
Via USB cable (5V DC)
power consumption
~350mA in idle state
(backlight is ON)
07
board dimensions
140x90cm (5.51x3.24’’)
weight
~210g (0.46 lbs)
10 09 08 11
Page 7
2. Power supply
The SmartGLCD board can be powered in two different ways: via USB connector (CN1) using MINI-B USB cable provided with the board
(Figure 2-1), or via side headers (CN2 or CN4) using external 5V power supply (Figure 2-2 and Figure 2-3).
When the board is powered up the GLCD display will be automatically turned on. The USB connection can provide up to 500mA of current
which is more than enough for the operation of all on-board modules and the microcontroller as well.
Page 8
CN1
VCC-3.3
VCC
VCC
CN4 USB MINI-B
VCC
VCC-MMC VCC-3.3 REG1
VIN
FB1 3
VOUT
2
E2 FERRITE E1 C11 1 C10 E3
BEAD MC33269DT-3.3
10uF 10uF 100nF 100nF 47uF
VCC
CN2
PIC18F
- Up to 64M
peripherals and features 128KB of Flash and 4KB of RAM. It can Hz
easily handle demanding graphical applications. 31 Level
Program
Stack
Counter
Data
Instruction Address Address
Data
Decoder
Key microcontroller features Data/Memor
y Bus
- Up to 12 MIPS Operation;
Flash
- 8-bit architecture; (Up to 128K RAM
B)
(Up to 3.9K
B)
- 128KB of Flash memory;
Data Bus
- 3,862 bytes of RAM;
- 1024 bytes of EEPROM; SPI
I2C I/O Timers Comparators ADC
- 80 pin TQFP; 12-Bit USART CCP MSSP
- 24 ch, 12-bit ADC;
- UART, SPI, I2C; etc.
Page 10
4. Programming the microcontroller
Figure 4-1:
PIC18F87K22
microcontroller
Page 11
5. Programming with bootloader
Microcontroller is preprogrammed with USB UART Bootloader,
mikroBootloader software
which can be used to upload new device firmware. To trans note Before starting mikroBootloader software, connect SmartGLCD
fer firmware .HEX file from a PC to MCU you need to use mikro to a PC using a USB cable provided with the package.
Bootloader USB UART application, which can be downloaded from:
http://www.mikroe.com/smartglcd/
01
02
03
Figure 5-2: Identifying COM port Figure 5-3: Choosing COM port
01 Open Device Manager window and expand Ports 02 From the drop down list, select appropriate Port (in this
(COM & LPT) section to check which COM port is case it is COM18) and Baud rate (115200).
assigned to SmartGLCD board (in this case it is COM18). 03 Click OK.
Page 13
step 2 - Establishing Connection step 3 - Browsing for .HEX file
01
01
Figure 5-4: Connecting with mikroBootloader Figure 5-5: Browse for HEX
01 Press the Reset button on SmartGLCD board and click 01 Click the Browse for HEX button and from a
Connect within 5s, otherwise the existing microcontroller pop-up window (Figure 5-6) choose a .HEX file to be
program will run. If connected, the button’s caption will be uploaded in MCU memory.
changed to Disconnect.
Page 14
step 4 – Selecting .hex file step 5 – Uploading .hex file
01
01
02
Figure 5-6: Locating and selecting .hex file Figure 5-7: Begin uploading
01 Select .HEX file from the Open dialog window. 01 In order to upload .HEX file click the Begin
uploading button.
02 Click the Open button.
Page 15
step 6 – Progress bar step 7 - Finishing upload
01
01
01 Progress bar enables you to monitor .HEX file 01 Click OK button after the uploading process has been
uploading. finished.
Page 16
Tips and Tricks: Speed-up UART data transfer
02
04
03
01
note If .HEX file transfer from your PC to 01 Right click on the USB Serial Port (COM18) item and then select Properties.
MCU is too slow, it’s possible to speed 02 Select Port Settings tab.
up data transfer by setting latency 03 Click the Advanced... button.
time of COM port to 1 ms. This is done
04 Set Latency Timer to 1 and click OK.
in Device Manager:
Page 17
6. Programming with mikroProg™ programmer
The microcontroller can be programmed with the external mikroProg™ programmer which can be connected to the board via CN3
connector. Before establishing this connection it is necessary to solder 1x5 male header to CN3 connection pads. This can be done in
both ways: on the bottom, or the top side, as shown in Figures 6-1 and 6-2.
Figure 6-1:
The mikroProg can be attached on the back
side of the board. Just solder 1x5 header to
back side pads (CN3) before connecting it.
Figure 6-2:
The mikroProg can be also attached on the
front side of the board. In this case, solder
1x5 header to front side pads (CN3).
note If bootloader program is accidently erased you can upload it again through mikroProg programmer.
Program Bootloader18F87K22.hex can be found under Firmware folder (page 12).
Page 18
VCC
R22 VCC
1K
D1
BAT43
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
VCC
GND
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
RH2 RJ2
RH3 RJ3
RE1 RB0
VCC RE0 RB1
PGC RG0 RB2
PGD RG1 RB3
mRST#
RG2 RB4
RG3 RB5
mRST# PGC
MCLR RB6
CN3 RG4
PIC18F87K22 GND
10uF
GND OSC2
E5
VDDcore/Vcap OSC1
RF7 VCC VCC
PGD
RF6 RB7
RF5 RC5
RF4 RC4
RF3 RC3
RF2 RC2
RH7 RJ7
ENVREG
RH6 RJ6
AGND
AVCC
GND
VCC
RH5
RH4
RC1
RC0
RC6
RC7
RA3
RA2
RA1
RA0
RA5
RA4
RF1
RJ4
RJ5
C5
VCC
VCC
100nF
note Make sure to use only the front row of mikroProg’s IDC10 connector (side with a knob and
incision) when connecting it to 1x5 header on your SmartGLCD board.
Page 19
7. mikroProg Suite™ for PIC® Software
Page 20
Software Installation Wizard
01 Start Installation 02 Accept EULA and continue 03 Install for all users
Page 21
8. microSD Card Slot
Figure 8-1:
microSD card slot
Page 22
VCC
RC3-SCK
RC5-MOSI
MMC-CS#
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
VCC
GND
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
RH2 RJ2
RH3 RJ3 VCC-MMC CN5
R27 R28 R29 microSD CARD
RE1 RB0
2K2 2K2 2K2
RE0 RB1
RG0 RB2 CD
RG1 RB3 CMD
RG2 RB4 C12 VCC
MMC-CD#
RG3 RB5 100nF
MCLR RB6 CLK
RG4 GND GND
PIC18F87K22
10uF
G
RF7 VCC VCC
RF6 RB7
R33
RC4-MISO
RC5-MOSI
MMC-CD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9 VEE
100nF
VR
GLCD-RES#
GLCD-MD
10K
GLCD-D5
GLCD-D4
C5 R23
BOTTOM
VCC
TOUCH PANEL GLCD-MD
VCC
100nF
LEFT
CONTROLLER
10K
CONTRAST
Page 26
11. Contrast potentiometer
On the backside of the board there is a small
potentiometer which can be used to change
Figure 11-1:
contrast of the GLCD. The brighter the backlight, the
Constrast
less contrast you will need to properly display the potentiometer
graphical content.
Page 27
12. USB UART
Figure 12-1:
Connecting USB cable
to SmartGLCD board
Fast on-board FTDI® chip allows you to communicate with a PC or other UART devices
using USB UART connection. Before connecting the board to a PC, make sure that you
have the appropriate FTDI drivers installed on your operating system. Drivers can be
found on the Product DVD:
19122011
www.mikroe.com
DVD://download/eng/software/development-tools/universal/ftdi/vcp_drivers.zip
Copyright ©2011 Mikroelektronika.
All rights reserved. Mikroelektronika, Mikroelektronika logo and other
Mikroelektronika trademarks are the property of Mikroelektronika.
USB-B connector (CN1) is used for connecting the USB cable, which is delivered with
D!
ai
All other tradmarks are the property of their respective owners.
DV
Av
lab
le on Product the board package. Plug it in as shown in Figure 12-1.
Page 28
VCC
VCC-3.3 VCC
U12
C15
UART-TX
TXD OSCO
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
RD0
VCC
GND
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
100nF
DTR# OSCI
RH2 RJ2
RTS# TEST
RH3 RJ3 VCC
RE1 RB0 VCCIO AGND
RE0 RB1 UART-RX C16
RXD NC
RG0 RB2
RG1 RB3 RI# CBUS0 VCC 100nF
RG2 RB4
GND CBUS1
RG3 RB5
MCLR RB6 GND
VCC
NC
RG4 GND R9
PIC18F87K22
10uF
USB
GND
VCC
RH5
RH4
RC1
RC0
RC6
RC7
RA3
RA2
RA1
RA0
RA5
RA4
RF1
C17
RJ4
RJ5
100nF MINI-B
UART-RX
C5
UART-TX
VCC
VCC
100nF
Figure 13-1:
Buzzer module
Page 30
VCC
RH1
RH0
RE2
RE3
RE4
RE5
RE6
RE7
VCC
GND
RD0
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RJ0
RJ1
RH2 RJ2
RH3 RJ3
RE1 RB0
RE0 RB1
RG0 RB2
RG1 RB3
RG2 RB4
RG3 RB5
MCLR RB6
RG4 GND VCC
PIC18F87K22
10uF
GND OSC2
E5
VDDcore/Vcap OSC1
RF7 VCC VCC R37
RF6 RB7 BZ1
1K
RF5 RC5
RF4 RC4
RF3 RC3 Q9
RF2 RC2 R36 BC546
RH7 RJ7
ENVREG
R35
GND
VCC
RH5
RH4
RC1
RC0
RC6
RC7
RA3
RA2
RA1
RA0
RA5
RA4
RF1
RJ4
RJ5
1K
C5 VCC
VCC
100nF
Page 31
14. Pinout
RA2 AN2
RA3 AN3
RA4 Digital I/O
RA5 AN4
RB0
RB1
INT
RB2
RB3
RB4 Digital I/O
RC3 SCK1/SCL1
RC4 SDI1/SDA1
I2C/SPI
RC5 SDO1
RD0
RD1
Ground
3.3V power supply output
I/O
RD2
Digital
RD3
RD4 SDO2
RD5 SDI2/SDA2
RD6 SCK2/SCL2
I2C/SPI
Page 32
PWM
RE4
Ground
RE5
RE6
RE7
NC
RF1
5V power supply
RF2
RF3
RF4
RF5
Analog I/O
RF6
RF7 Digital I/O
RG1 TX
RG2 RX UART
GND Ground
5V 5V power
supply
GND
RST
PGD
PGC
mikroProg
5V
SPI Lines
I2C Lines
UART lines
Analog Lines
Interrupt Lines
15. Dimensions 140
5512
114
4488
107.5
4232
2.54
100
16.3 11,6 12,7 12,7 11,56
642 457 500 4000 455
14.73
580
7.77
306
2264
2520
3268
3543
2913
57.5
64
83
90
74
Legend
active surface
display margin
display
12.3
421
Tolerance +/- 0.5mm
128 7
5040 276
Page 33
What’s next?
Your journey through each and every feature of SmartGLCD board ends here. You got to know it’s modules and organization. Now you are ready
to use it. We are suggesting several steps which are probably the best way to begin with. We invite you to join the users of SmartGLCD brand.
You will find very useful projects and tutorials and can get help from a large ecosystem of users. Welcome!
Compiler
You still don’t have an appropriate compiler? Locate PIC® compiler that suits you best on the
Product DVD provided with the package:
DVD://download/eng/software/compilers/
Choose between mikroC™, mikroBasic™ and mikroPascal™ and download fully functional
demo version, so you can begin building your first applications.
Projects
Once you have chosen your compiler, and since you already got the board, you are ready to start writing your first
projects. Visual GLCD software for rapid development of graphical user interfaces enables you to quickly create
your GUI. It will automatically create necessary code which is compatible with mikroElektronika compilers. Visual GLCD
is rich with examples, which are an excellent starting point for your future projects. Just load the example, read well
commented code, and see how it works on hardware. Visual GLCD is also available on the Product DVD.
Page 34
DISCLAIMER
All the products owned by MikroElektronika are protected by copyright law and international copyright treaty. Therefore, this manual is to be treated as any
other copyright material. No part of this manual, including product and software described herein, may be reproduced, stored in a retrieval system, translated or
transmitted in any form or by any means, without the prior written permission of MikroElektronika. The manual PDF edition can be printed for private or local use,
but not for distribution. Any modification of this manual is prohibited.
MikroElektronika provides this manual ‘as is’ without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties or
conditions of merchantability or fitness for a particular purpose.
MikroElektronika shall assume no responsibility or liability for any errors, omissions and inaccuracies that may appear in this manual. In no event shall
MikroElektronika, its directors, officers, employees or distributors be liable for any indirect, specific, incidental or consequential damages (including damages for
loss of business profits and business information, business interruption or any other pecuniary loss) arising out of the use of this manual or product, even if
MikroElektronika has been advised of the possibility of such damages. MikroElektronika reserves the right to change information contained in this manual at any
time without prior notice, if necessary.
The products of MikroElektronika are not fault – tolerant nor designed, manufactured or intended for use or resale as on – line control equipment in hazard-
ous environments requiring fail – safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic
control, direct life support machines or weapons systems in which the failure of Software could lead directly to death, personal injury or severe physical or
environmental damage (‘High Risk Activities’). MikroElektronika and its suppliers specifically disclaim any expressed or implied warranty of fitness for High
Risk Activities.
TRADEMARKS
The MikroElektronika name and logo, the MikroElektronika logo, mikroC™, mikroBasic™, mikroPascal™, mikroProg™, mikroBUS™, Click Boards™, EasyPIC and mikromedia™
are trademarks of MikroElektronika. All other trademarks mentioned herein are property of their respective companies.
All other product and corporate names appearing in this manual may or may not be registered trademarks or copyrights of their respective companies, and are only
used for identification or explanation and to the owners’ benefit, with no intent to infringe.
0 100000 024430