mikroElektronika Clicker 2 User Manual

Page 1
Page 1
A compact starter kit with your favorite microcontroller and two mikroBUS™ sockets
Page 2
Page 2
I want to express my thanks to you for being interested in our products and for having
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.
The PIC® and Windows® logos and product names are trademarks of Microchip Technology® and Microsoft® in the U.S.A. and other countries.
TO OUR VALUED CUSTOMERS
Nebojsa Matic
General Manager
Page 3
Page 3
Table of contents
Introduction to clicker 2 for PIC18FK 4
Key features 5
1. Power supply 7
2. PIC18F67K40 microcontroller 8
Key microcontroller features 8
3. Programming the microcontroller 9
3.1 Programming with mikroBootloader 10
step 1 – Connecting clicker 2 for PIC18FK 10
step 2 – Browsing for .HEX file 11
step 3 – Selecting .HEX file 11
step 4 – Uploading .HEX file 12
step 5 – Finish upload 13
3.2 Programming with mikroProg programmer 14
mikroProg Suite for PIC® software 15
4. Buttons and LEDs 16
5. Power management and battery charger 17
6. Oscillators 18
7. USB connection 19
8. Pinout 20
8.1 mikroBUS™ pinout 21
9. click boards™ are plug and play! 22
10. Dimensions 23
Page 4
Page 4
clicker 2 for PIC18FK is a compact develompent
kit with two mikroBUS™ sockets for click board
connectivity. You can use it to quickly build your
own gadgets with unique functionalities and
features. It carries the PIC18F67K40, a 8-bit
microcontroller, two indication LEDs, two general
purpose buttons, a reset button, an on/off
switch, a li-polymer battery connector, a micro
USB connector and two mikroBUS™ sockets.
A mikroProg connector and a 2x26 pinout for
interfacing with external electronics are also
provided. The mikroBUS™ connector consists of
two 1x8 female headers with SPI, I 2C, UART, RST,
PWM, Analog and Interrupt lines as well as 3.3V,
5V and GND power lines. clicker 2 for PIC18FK
board can be powered over a USB cable.
Introduction to clicker 2 for PIC18FK
Page 5
Page 5
1
ON/OFF switch
2
16 MHz crystal oscillator
3
two 1x26 connection pads
4
mikroBUS™ sockets 1 and 2
5
Pushbuttons
6
Additional LEDs
7
LTC3586 USB power manager IC
8
Power and Charge indication LEDs
9
RESET button
10
Micro USB connector
11
PIC18F67K40 MCU
12
Li-Polymer battery connector
13
mikroProg™ programmer connector
9
10
11
3
4
5
6
12
13
1
2
3
4
5
6
8
7
Key features
Page 6
Page 6
VCC-3.3V VCC-5V
1
VCC-3.3V VCC-5V
2
AN RST CS SCK MISO MOSI
3.3V GND
PWM
INT
RX
TX SCL SDA
5V
GND
MIKROBUS 1
MIKROBUS HOST CONN
AN RST CS SCK MISO MOSI
3.3V GND
PWM
INT
RX
TX SCL SDA
5V
GND
MIKROBUS 2
MIKROBUS HOST CONN
VCC-BAT
VCC-BAT
VCC-BAT
VCC-3.3VVCC-BAT
R5
10kR610k R10 1M
R12 100k
R13 100k
R14 100k
C33
0.1µF
R11
1k
R8 470
LD1
LD2
LD3 LED GREEN
C36 10µF
3 2
1
M1 DMP2305U-7
2
1
CN1
SHM1x2
R1
1k
R2
1k
4 5 6
1 2 3
9 10 11
7
8
12 13 14 15
18 19 20
16 17
21 22
26
23 24 25
HDR1
4 5 6
1 2 3
9 10 11
7 8
12 13 14 15
18 19 20
16 17
21 22
26
23 24 25
HDR2
AN
INT
SPI
PWM
SCL
RX
VCC-3.3V VCC-3.3V
RG2-UART2-RX RG7-UART2-TX
RD4-GPIO
RD3-GPIO
RD2-GPIO
RD1-GPIO
RH1-GPIO
RC2-CCP1 RC6-CCP2 RC7-CCP3 RG6-CCP4
RA0-ANA0 RA1-ANA1 RA2-ANA2
RB0-INT0 RB1-INT1 RB2-INT2 RB3-INT3
GPIO
GPIO
VCC-3.3V VCC-3.3V
RE1-GPIO RE0-GPIO
RE2-GPIO
RE3-G
PIO
RE4-GPIO
RE5-GPIO
VCC-USB
VCC-USB
VCC-3.3V
VCC-3.3VVCC-3.3V
VCC-3.3V
VCC-5V
VCC-5V
VCC-5V VCC-5V
LDO3V3
LDO3V3
PWR-ENPWR-EN
VCC-BAT
VCC-3.3V
VCC-5V VCC-5V
VCC-3.3V
LDO3V3LDO3V3
VCC-USB
VSYS
VSYS VSYS
VSYS
LDO3V3
PWR-EN
LDO3V3
FAULT
R15
2.2k
R16
10k
R18
3.3k
R20
10k
R17 1k
C18
0.1µF
R27
16.9k
R23
1.69k
R26
88.7k
R21
15k
R22 105k
R19 324k
C25
0.1µF
ILIM01ILIM1
2
LDO3V33CLPROG4NTC
5
VOUT4
6
VOUT4
7
SW4
8
MODE9FB410FB3
11
VC3
12
SWAB3
13
VIN3
14
VIN3
15
VOUT3
16
VOUT3
17
EN3
18
SWCD3
19
EN220EN1
21
VIN4
22
FB2
23
VIN2
24
SW2
25
SW1
26
VIN1
27
FB1
28
PROG
29
CHRG#
30
GATE
31
BAT
32
EN4
33
VOUT
34
VBUS
35
VBUS
36
SW
37
FAULT#
38
LTC3586
U2 LTC3586EUFE
LD4
C15 1µF
C17 1µF
C16
10000pF
C14 22µF
C31 22µF
C30 22µF
C27 1µF
C28
10000pF
C32 10µF
C29 10pF
C19
2.2µF
C20
2.2µF
3
2
1
M2 DMP2305U-7
L3
2.2µH
L2
2.2µH
L1 3.3µH
C24
300pF
C21 33pF
C2310pF
C22 47µF
1
2
3
4
5
6
SW1
JS202011AQN
R30 10k
R37
220
T1
C4
0.1µF
VSYS
VCC-3.3V
RA4-ANA4 RA5-ANA5 RF0-ANF0
RE7-GPIORE6-GPIO
RH0-GPIO
TX
SDA
FM1 FM2 FM3 FM4
T2T3
RE1
1
PIC18F67K40
RE0
2
RG0
3
RG1
4
RG2
5
RG3
6
VPP/MCLR/RG5
7
RG4
8
VSS
9
VDD
10
RF7
11
RF6
12
RF5
13
RF4
14
RF3
15
RF2
16
RF1
17
RF0
18
RG7
19
RG620RA3
21
RA2
22
RA123RA0
24
RH1
25
RH0
26
RA5
27
RA428RC129RC0
30
RC6
31
RC7
32
RC2
33
RC3
34
RC4
35
RC5
36
RB7
37
VDD
38
RA7
39
RA6
40
VSS
41
RB6
42
RB5
43
RB4
44
RB3
45
RB2
46
RB1
47
RB0
48
RD749RD650RD551RD4
52
RD3
53
RD2
54
RD1
55
RH3
56
RH2
57
RD0
58
RE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
RESET#
3V3OUT
USBDM USBDP
FT232RL
U3
FT232RL
FB1
VCC-USB
RX/TX
USBD_N USBD_P
RC0-UART4-TX
RC1-UART4-RX
RF7-GPIO
RF7-GPIO
RB4-UART3-TX RB5-UART3-RX
RB4-UART3-TX
RB5-UART3-RX
RD7-LED
RH3-LED
RG2-UART2-RX RG7-UART2-TX
RB6-GPIO
RB7-GPIO
RB6-GPIO RB7-GPIO
RD7-LED
RH3-LED
RA0-ANA0 RA1-ANA1
RF2-BUTTON
RF3-BUTTON
RF2-BUTTON
RF3-BUTTON
C7
0.1µFC80.1µF
R3 27
R4 27
C5
0.1µFC60.1µF
R28 100
R25 100
R7 220
R24 10k
R9
4.7k
C9 10nF
R29 100k
VCC-3.3V
VCC-3.3V
VCC-3.3V VCC-3.3V VCC-3.3V
VCC-3.3V VCC-3.3V
MCLR#
RA3-GPIO
RF6-ANF6
RF6-ANF6
RA3-GPIO
C3 10µF
1 2 3 4 5
ID
D+
D-
VBUS
GND
CN2
10118192-0001LF
C2 10pFC110pF
clicker 2 for PIC18FK schematic
Page 7
Page 7
1. Power supply
You can supply power to the board with a micro USB cable provided
in the package. On-board voltage regulators provide the appropriate
voltage levels to each component on the board. Power LED (GREEN)
will indicate the presence of power supply.
You can also power the board using a Li-Polymer battery, via onboard
battery connector. On-board battery charger circuit enables you
to charge the battery over USB connection. LED diode (RED) will
indicate when battery is charging. Charging current is ~300mA and
charging voltage is 4.2V DC.
Battery power supply
USB power supply
Figure 1-1: Connecting USB
power supply
Figure 1-2: Connecting
Li-Polymer battery
Some click boards need more current than the USB connection can supply. For 3.3V clicks, the upper limit is 750 mA; for 5V clicks, it’s 500
mA. In those cases you would need to use the battery as the power supply, or the vsys pin on the side of the board.
NOTE
Page 8
Page 8
2. PIC18F67K40 microcontroller
PIC18F67K40 is a 64-Pin, low-power, high performance
microcontroller with XLP technology. equipped with a 10-bit
ADC with Computation (ADCC) automating Capacitive Voltage
Divider (CVD) techniques for advanced touch sensing, averaging,
filtering, oversampling and performing automatic threshold
comparisons.
Key MCU features
- 128K bytes Program Flash
- 3568 Bytes Data SRAM
- 1024 Bytes Data EEPROM
Sleep mode: Lowest Power Consumption
Page 9
Page 9
01
02
Using the mikroBootloader,
Using external mikroProg for PIC programmer
Figure 3-1:
PIC18F67K40
microcontroller
The microcontroller can be programmed in two ways:
3. Programming the microcontroller
Page 10
Page 10
You can program the microcontroller with a bootloader
which is preprogrammed by default. To transfer .hex
file from a PC to MCU you need bootloader software
(mikroBootloader USB HID) which can be downloaded
from:
3.1 Programming with mikroBootloader
Figure 3-2: mikroBootloader window
step 1 – Connecting clicker 2 for PIC18FK
01
To start, connect the USB cable, or if already connected press the Reset button on your clicker 2 for PIC18FK. Click the Connect button within 5s to enter the bootloader mode, otherwise existing microcontroller program will execute.
After the mikroBootloader software is downloaded,
unzip it to desired location and start it.
https://download.mikroe.com/examples/starter-boards/ clicker-2/pic18fk/clicker-2-pic18fk-mikrobootloader-v100.zip
clicker 2 for PIC18FK Bootloader
WinRAR ZIP archive
clicker 2 for PIC18FK Bootloader
File folder
Software
File folder
mikroBootloader USB.exe
Bootloader tool for mikroElektron... mikroElektronika
PIC18F67K40_Bootloader_Firmware_v100.hex
HEX File
Firmware
File folder
01
Page 11
Page 11
step 3 – Selecting .HEX file step 2 – Browsing for .HEX file
Figure 3-3: Browse for HEX
Figure 3-4: Selecting HEX
01 01
02
01
01
02
Click the Browse for HEX button and from a
pop-up window (Figure 3-4) choose the .HEX file
which will be uploaded to MCU memory.
Select .HEX file using open dialog window.
Click the Open button.
Page 12
Page 12
step 4 – Uploading .HEX file
Figure 3-5: Begin uploading Figure 3-6: Progress bar
01
01
01 01
To start .HEX file bootloading click the Begin uploading button.
Progress bar enables you to monitor .HEX file uploading.
Page 13
Page 13
step 5 – Finish upload
Figure 3-7: Restarting MCU
Figure 3-8: mikroBootloader ready for next job
01
01
02
Click OK button after the uploading process is finished.
Press Reset button on clicker 2 for PIC18FK board and wait
for 5 seconds. Your program will run automatically.
Page 14
Page 14
The microcontroller can be programmed with external
mikroProg for PIC programmer and mikroProg Suite for
PIC® software. The external programmer is connected to
the development system via 1x5 connector Figure 3-9.
mikroProg is a fast USB 2.0 programmer with hardware
debugger support. It supports PIC10®, dsPIC30/33®,
PIC24® and PIC32® devices in a single programmer.
It supports over 570 microcontrollers from
Microchip®. Outstanding performance, easy
operation and elegant design are its key
features.
3.2 Programming with mikroProg programmer
Figure 3-9: mikroProg connector
You can also
program it
with ICD2®
or ICD3® if
you reroute
the wires like
shown here.
4. GND
5. VCC 3.3V
6. MCLR#
2. PGC
3. PGD
1. NC
GND
RST
PGD
PGC
VCC 3.3V
ICD2/3 programmer
clicker 2 for PIC18FK 1x5 programming headers
Page 15
Page 15
mikroProg Suite for PIC software
mikroProg programmer requires
special programming software
called mikroProg Suite for PIC. This
software is used for programming
of ALL Microchip® microcontroller
families, including PIC10®, PIC12®,
PIC16®, PIC18®, dsPIC30/33®, PIC24®
and PIC32®. Software has intuitive
interface and SingleClick™ programming
technology. Just by downloading the
latest version of mikroProg Suite your
programmer is ready to program new
devices. mikroProg Suite is updated
regularly, at least four times a year, so
your programmer will be more and more
powerful with each new release.
Figure 3-10: Main window of mikroProg Suite for PIC® programming software
Page 16
Page 16
Figure 4-1: Two LEDs, two buttons and a reset button
4. Buttons and LEDs
The board also contains a reset
button and a pair of buttons and
LEDs, as well as an ON/OFF switch.
The Reset button is used to manually
reset the microcontroller—it
generates a low voltage level on the
microcontroller’s reset pin. LEDs
can be used for visual indication of
the logic state on two pins (RH3 and
RD7). An active LED indicates that
a logic high (1) is present on the
pin. Pressing any of the two buttons
can change the logic state of the
microcontroller pins (RF3 and RF2)
from logic high (1) to logic low (0).
Page 17
Page 17
5. Power management and battery charger
clicker 2 for PIC18FK features LTC®3586, a highly integrated power management and battery charger IC that includes a
current limited switching PowerPath manager. LTC®3586 also enables battery charging over a USB connection.
Figure 5-1:
power management and battery charger IC
Page 18
Page 18
6. Oscillators
Board is equipped with 16MHz crystal oscillator (Y1) circuit that provides external clock waveform to the microcontroller
CLKO and CLKI pins. This base frequency is suitable for further clock multipliers and ideal for generation of necessary
USB clock, which ensures proper operation of bootloader and your custom USB-based applications.
Figure 6-1:
16MHz crystal
oscillator module (Y1)
Page 19
Page 19
PIC18F67K40 microcontrollers has an integrated USB module, which enables
you to implement USB communication functionality to your clicker 2 board.
Connection with target USB host is done over a micro USB connector which is
positioned next to the battery connector.
7. USB connection
Figure 7-1:
Connecting USB
cable to clicker 2
Page 20
Page 20
SPI LinesInterrupt LinesAnalog Lines
Digital lines I2C Lines
UART lines
PWM lines
8. Pinout
VSYSRSTReset pin
System power supply
GNDGNDReference Ground
Reference Ground
RA0NC RA1NC RA2RC2 RF6RC6 RA4RC7 RA5RG6 RF0RA3
RB0RF7 RB1RB6 RB2RB7 RB3RH0
RE0RH1 RE1RD1 RE2RD2 RE3RD3 RE4RD4 RE5RG0 RE6RG1 RE7RG2
RC3RG7 RC4RD6 RC5RD5
3.3V3.3V3.3V power supply GNDGNDReference Ground
Pin functions Pin functions
Digital I/O lines
SPI1 Lines
Interrupt Lines
Analog Lines
RX
TX
SCK
SCL
MISO
SDA
MOSI
UART2 Lines
I2C2 Lines
PWM lines
Digital I/O lines
3.3V power supply Reference Ground
Page 21
Page 21
Figure 9-1: mikroBUS™ individual and shared lines
8.1 mikroBUS™ pinouts
RB5
RB3
RC6
RG2
RC2
RB4
RG7
RB2
RD6
5V
RD6
5V
RD5
RD5
RD5
GND
RX
Interrupt line
PWM line
RX
PWM line
TX
TX
Interrupt line
SCL
5V power supply
SCL
5V power supply
SDA
Reference ground
SDA
Reference ground
UART2 lines
UART2 lines
I2C2 lines
I2C2 lines
RC3
RA1
RC3
RA0
3.3V
RC4
3.3V
RG4
RC4
RG3
GND
RC5
GND
RH2
RC5
RD0
SPI1 lines
SPI1 lines
SCK
Analog line
SCK
Analog line
3.3V power supply
MISO
3.3V power supply
MISO
Digital lines*
Reference ground
MOSI
Reference ground
MOSI
Digital lines*
SPI LinesInterrupt LinesAnalog Lines
Digital lines I2C Lines
UART lines
PWM lines
Page 22
Page 22
Up to now, MikroElektronika has released
more than 300 mikroBUS™ compatible
click boards. On the average, three click
boards are released per week. It is our
intention to provide you with as many
add-on boards as possible, so you will
be able to expand your development
board with additional functionality.
Each board comes with a set of working
example code. Please visit the click
boards™ webpage for the complete list
of currently available boards:
https://shop.mikroe.com/click
9. click boards™ are plug and play!
Figure 10-1:
clicker 2 for PIC18FK
driving click boards
Page 23
Page 23
10. Dimensions
Page 24
Page 24
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.
TRADEMARKS
The MikroElektronika name and logo, mikroC, mikroBasic, mikroPascal, Visual TFT, Visual GLCD, mikroProg, Ready, MINI, mikroBUS™, EasyPIC, EasyAVR, Easy8051, click boards™ 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.
Copyright © 2017 MikroElektronika. All Rights Reserved.
HIGH RISK ACTIVITIES
The products of MikroElektronika are not fault – tolerant nor designed, manufactured or intended for use or resale as on – line control equipment in hazardous 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.
Page 25
Page 25
If you want to learn more about our products, please visit our web site at www.mikroe.com
If you are experiencing some problems with any of our products or just need additional
information, please place your ticket at www.mikroe.com/support
If you have any questions, comments or business proposals,
do not hesitate to contact us at office@mikroe.com
Loading...