PIC18FK A compact starter kit with your favorite microcontroller and two mikroBUS™ sockets PIC18FK Page 1
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.
Table of contents Introduction to clicker 2 for PIC18FK 4 3.2 Xpress programmer 14 Key features 5 3.3 Programming with mikroProg programmer 15 Schematic 6 1. Power supply 7 4. Buttons and LEDs 17 2. PIC18F67K40 microcontroller 8 5. Power management and battery charger 18 9 3. Programming the microcontroller mikroProg Suite for PIC® software 16 6. Oscillators 19 10 7. USB connection 20 step 1 – Connecting clicker 2 for PIC18FK 10 8. Pinout 21 step 2 – Browsing for .
Introduction to clicker 2 for PIC18FK 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.
Key features 9 1 10 1 ON/OFF switch 14 2 16 MHz crystal oscillator 3 two 1x26 connection pads 4 mikroBUS sockets 1 and 2 ™ 5 Pushbuttons 6 Additional LEDs 11 3 3 2 7 LTC3586 USB power manager IC 8 Power and Charge indication LEDs 4 4 12 Li-Polymer battery connector 5 5 13 mikroProg programmer connector 6 6 9 RESET button 10 Micro USB connector 11 PIC18F67K40 MCU 14 PIC16F1454 7 12 8 13 Page 5
R1 R2 1k 27 16MHz C1 10pF C2 10pF 10k C15 1µF C16 10000pF R17 1k SW1 2 M2 DMP2305U-7 R18 VSYS 3.3k 32 33 34 35 36 37 38 PWR-EN VSYS VCC-USB L1 3.3µH FAULT R20 C22 47µF 10k BAT EN4 VOUT VBUS VBUS SW FAULT# LDO3V3 VCC-USB C31 22µF L3 2.2µH R21 C32 10µF VCC-5V 3 6 2 5 1 4 PWR-EN PGC PGD MCLR 1 2 3 4 5 C18 0.1µF JS202011AQN VCC-3.3V R19 324k 2.2µH C23 10pF VCC-5V LDO3V3 VCC-5V VCC-5V MCLR 3 R25 4 J2 M1X5 C3 10µF C5 0.
1. Power supply Battery power supply Figure 1-1: Connecting USB 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.
2. PIC18F67K40 microcontroller The clicker 2 for PIC18FK development tool comes with the PIC18F67K40 device. This 8-bit low power high performance microcontroller is rich with on-chip peripherals and features 128KB of program memory and 3568 bytes of RAM.
3.
3.1 Programming with mikroBootloader You can program the microcontroller with a bootloader which is preprogrammed by default. To transfer .hex file step 1 – Connecting clicker 2 for PIC18FK from a PC to MCU you need bootloader software (UART mikroBootloader) which can be downloaded from: https://download.mikroe.com/examples/starter-boards/ clicker-2/pic18fk/clicker-2-pic18fk-mikrobootloader-v100.zip 01 After the mikroBootloader software is downloaded, unzip it to desired location and start it.
step 2 – Browsing for .HEX file step 3 – Selecting .HEX file 01 HEX.file 01 02 Figure 3-3: Browse for HEX Figure 3-4: Selecting HEX 01 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. 01 Select .HEX file using open dialog window. 02 Click the Open button.
step 4 – Uploading .HEX file 01 01 Figure 3-5: Begin uploading Figure 3-6: Progress bar 01 To start .HEX file bootloading click the Begin uploading button. 01 Progress bar enables you to monitor .HEX file uploading.
step 5 – Finish upload 01 Figure 3-7: Restarting MCU Figure 3-8: mikroBootloader ready for next job 01 Click OK button after the uploading process is finished. 02 Press Reset button on clicker 2 for PIC18FK board and wait for 5 seconds. Your program will run automatically.
3.2 XPRESS bootloader The XPRESS bootloader allows for easy drag and drop programming. When plugged into the USB it will show itself as a flash drive onto which you can simply drag a hex file for your MCU. The hex file can be generated by any compiler. After the hex file is placed onto the clicker 2 for PIC18FK it will program the main MCU. This functionality is enabled by the PIC16F1454 which acts both as a drag and drop programmer and Virtual COM port.
3.3 Programming with mikroProg programmer The microcontroller can be programmed with external mikroProg GND RESET# PGD PGC VCC 3.3V 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®.
mikroProg Suite for PIC software PIC18FK 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.
4. Buttons and LEDs The board also contains a 01 reset button and a pair of 02 buttons and 03 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.
5. Power management and battery charger clicker 2 for PIC18FK features LTC®3586-2, 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.
6. Oscillators Board is equipped with 16MHz crystal oscillator (X1) circuit that provides external clock waveform to the microcontroller OSC1 and OSC2 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.
7. USB connection PIC18FK 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.
8. Pinout Reset pin Reference Ground PWM lines Digital I/O lines RX TX SCL I2C2 Lines SDA 3.3V power supply Reference Ground UART2 Lines RST GND VSYS GND RG0 RG1 RA2 RF6 RA4 RA5 RF0 RB0 RB1 RE0 RE1 RE3 RB2 RB3 RC2 RC6 RB6 RE6 RE7 RC3 RC4 RC5 3.3V GND RE2 RE4 RC7 RG6 RA3 RF7 RE5 RD4 RH0 RH1 RD1 RD2 RD3 RB7 RA0 RA1 RG2 RG7 RD6 RD5 3.3V GND System power supply Reference Ground Analog Lines Interrupt Lines Digital I/O lines SCK SDI SPI1 Lines SDO 3.
8.1 mikroBUS™ pinouts Analog line Digital lines* SCK MISO MOSI 3.3V power supply Reference ground SPI1 lines Analog line Digital lines* SCK MISO MOSI 3.3V power supply Reference ground SPI1 lines RA0 RG3 RD0 RC3 RC4 RC5 3.3V GND RC2 RB2 RG2 RG7 RD6 RD5 5V GND PWM line Interrupt line RX UART2 lines TX SCL I2C2 lines SDA 5V power supply Reference ground RA1 RG4 RH2 RC3 RC4 RC5 3.
9. click boards™ are plug and play! 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: mikroe.
10.
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.
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.