Download mikromedia™
Transcript
mikromedia for PIC18FJ ™ ® Compact development system rich with on-board peripherals for all-round multimedia development on PIC18F87J50 device. 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 Introduction to mikromedia™ for PIC18FJ® 4 Programing with mikroProg™ programmer 16 Package Contains 5 mikroProg Suite™ for PIC® Software 17 Key Features 6 Programing with ICD2® or ICD3® programmer 18 7 5. Crystal oscillator 20 8 6. microSD Card Slot 21 System Specification 1. USB power supply 2. Battery power supply 9 7. Touch Screen 22 3. Microcontroller PIC18F87J50 10 8. Audio Module 24 Key microcontroller features 10 9. USB connection 26 4. Programming the microcontroller 11 10. Accelerometer 28 Programming with mikroBootloader 12 11. Flash Memory 29 step 1 – Connecting mikromedia 12 12. Pads 30 step 2 – Browsing for .hex file 13 13. Pinout 31 step 3 – Select .hex file 13 14. Dimensions 32 step 4 – .hex file uploading 14 15. mikromedia Accessories 33 step 5 – Finish upload 15 16. What’s Next? 34 Page 3 Introduction to mikromedia™ for PIC18FJ® The mikromedia™ for PIC18FJ® is a compact development system with lots of on-board peripherals which allow development of devices with multimedia contents. The central part of the system is a 8-bit PIC18F87J50 microcontroller. The mikromedia™ for PIC18FJ® features integrated modules such as stereo MP3 codec, TFT 320x240 touch screen display, accelerometer, USB connector, MMC/SD card slot and other. It comes pre-programmed with USB bootloader, but can also be programmed with external programmers, such as mikroProg™ or ICD2/3®. Mikromedia is compact and slim, and perfectly fits in the palm of the hand, which makes it convenient platform for mobile devices. Page 4 Page 4 Package Contains 19122011 www.mikroe.com Copyright ©2011 Mikroelektronika. All rights reserved. Mikroelektronika, Mikroelektronika logo and other Mikroelektronika trademarks are the property of Mikroelektronika. All other tradmarks are the property of their respective owners. Unauthorised copying, hiring, renting, public performance and broadcasting of this DVD prohibited. 01 Damage resistant protective box 02 mikromedia™ for PIC18FJ® development system 04 mikromedia™ for PIC18FJ® user’s guide 05 mikromedia™ for PIC18FJ® schematic Page 5 03 DVD with documentation and examples 06 USB cable Key Features 01 Connection Pads 02 TFT 320x240 display 03 USB MINI-B connector 04 LI-Polymer battery connector 05 3.5mm headphone connector 01 06 Power supply regulator 07 Serial Flash memory 08 VS1053 Stereo mp3 coder/decoder 09 RESET button 10 PIC18F87J50 microcontroller 11 Accelerometer 02 12 Crystal oscillator 13 Power indicator LED 14 microSD Card Slot 15 ICD2/3® connector 16 mikroProg™ connector Page 6 04 03 System Specification 05 power supply 06 Over a USB cable (5V DC) 07 power consumption 08 53 mA with erased MCU 09 (when on-board modules are inactive) 10 board dimensions 11 8 x 6cm (3.14 x 2.36 inch) weight 12 ~45,5g (0.10 lbs) 13 14 15 16 Page 7 1. USB power supply Figure 1-1: Powering your mikromedia™ board with USB cable You can apply power supply to the board using MINI-B USB cable provided with the board. On-board voltage regulators will make sure to regulate the appropriate voltage levels to each part of the board. Power LED will indicate the presence of power supply. Page 8 DATA BUS 2. Battery power supply Figure 2-1: Connecting Li-polymer battery to mikromedia™ board VCC-BAT VCC-3.3 VCC-3.3 CN1 R35 10K 1 2 VCC-3.3 R39 4K7 LD2B RED VCC-3.3 VCC-BAT R36 10K E7 STAT R37 10K Q4 Q5 BC846 BC846 R38 10K R45 1K C40 10uF You can also power the board using Li-Polymer battery, via on-board battery connector. On-board battery charger circuit MCP73832 enables you to charge the battery over USB connection. Charging current is ~250mA and charging voltage is 4.2V DC. 2.2uF U5 1 2 3 E5 10uF VCC-SYS BATT CONN STAT VSS VBAT 5 PROG R44 3K9 4 VDD MCP73832 Charging Current approx. 250mA VCC-BAT VCC-SYS VCC-3.3 R6 4K7 VSENSE R49 4K7 R34 4K7 1 2K2 LD1A GREEN VCC-USB REG1 R26 3 E3 10uF E4 10uF R43 Vin GND 2 10K Vout LD29080DT33 D1 PMEG3010ER M1 DMP2160UW VCC-BAT VCC-SYS Page 9 Figure 2-2: Battery charger and power management connection schematic 3. Microcontroller PIC18F87J50 The mikromedia™ for PIC18FJ® development system comes with the PIC18F87J50 microcontroller. This high-performance 8-bit microcontroller with its integrated modules and in combination with other on-board modules is ideal for multimedia applications. 12 MIPS 8bit Core - nanoWatt - 48MHz 31 Level Stack Instruction Key microcontroller features Data/Memor y Bus - Two External Clock modes, up to 48 MHz; Flash (Up to 128K B) - Internal 31 kHz Oscillator, Tunable Internal Oscillator; 31 kHz to 8 MHz; RAM (Up to 3.9K B) VREG Data Bus - 10-Bit, up to 12-Channel Analog-to-Digital (A/D); - 8-Bit or 16-Bit Interface; Data Addresse Addre ss Decode Data - USB V2.0 Compliant SIE; - Address Capability of up to 2 Mbytes; PIC18FJ Program Counter USB PMP Timers - 12-Bit, 16-Bit and 20-Bit Addressing modes; etc. Page 10 Comparators ADC 10-Bit EUSART CCP MSSP 4. Programming the microcontroller Figure 4-1: PIC18F87J50 Microcontroller The microcontroller can be programmed in three ways: 01 Via USB HID mikroBootloader 02 Using mikroProg™ external programmer 03 Using ICD2/3® external programmer Page 11 Programming with mikroBootloader step 1 – Connecting mikromedia You can program the microcontroller with bootloader which is preprogrammed into the device by default. To transfer .hex file from a PC to MCU you need bootloader software (mikroBootloader USB HID) which can be downloaded from: 01 http://www.mikroe.com/eng/products/view/585/ mikromedia-for-pic18fj/ 02 After software is downloaded unzip it to desired location and start mikroBootloader USB HID software. Figure 4-2: mikroBootloader USB HID 01 Connect mikromedia™ board with a PC via USB cable and USB icon will turn red. 02 Click the Connect button within 5s, otherwise existing microcontroller program will execute. Page 12 step 2 – Browsing for .hex file step 3 – Select .hex file 01 01 01 Figure 4-3: Browse for HEX Figure 4-4: Selecting HEX 01 Click on Browse for HEX button 01 Select .hex file via open window 02 Click on Open button Page 13 step 4 – .hex file uploading 01 01 Figure 4-5: Begin uploading Figure 4-6: Progress bar 01 To start .hex file uploading click on Begin uploading button 01 You can monitor .hex file uploading via progress bar Page 14 step 5 – Finish upload 01 Figure 4-8: mikroBootloader ready for next job Figure 4-7: Restarting MCU 01 To finish uploading click on OK button Page 15 Programing with mikroProg™ programmer The microcontroller can be programmed with mikroProg™ programmer and mikroProg Suite™ fo PIC® software. The mikroProg™ programmer is connected to the development system via the CN6 connector, Figure 4-9. mikroProg™ is a fast USB 2.0 programmer with mikroICD™ hardware In-Circuit Debugger. Smart engineering allows mikroProg™ to support PIC10®, PIC12®, PIC16®, PIC18®, 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 it’s key features. Figure 4-9: Connecting mikroProg™ to mikromedia™ Page 16 mikroProg Suite™ for PIC® Software mikroProg™ programmer requires special programming software called mikroProg Suite™ for PIC®. This software is used for programming ALL of 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 4-10: Main Window of mikroProg Suite™ for PIC® programming software Page 17 Programing with ICD2® or ICD3® programmer The microcontroller can be also programmed with ICD2® or ICD3® programmer. These programmers connect with mikromedia board via ICD2 CONNECTOR BOARD. Figure 4-12: Connecting ICD2® or ICD3® programmer Figure 4-11: Placing ICD2® connector In order to enable the ICD2® and ICD3® programmers to be connected to the development system, it is necessary to provide the appropriate connector such as the ICD2 CONNECTOR BOARD. This connector should be first soldered on the CN5 connector, Figure 4-12. Then you should plug the ICD2® or ICD3® programmer into it, Figure 4-11. Page 18 VCC-3.3 Vcap RJ1 RJ0 RD7 RD6 RD5 RD4 RD3 RD2 RD1 GND VCC RD0 RE7 RE6 RE5 RE4 RE3 RH0 RE2 OSC1 VCC RF7 RF6 RB7 RF5 RC5 RF4/D+ RC4 RF3/D- RC3 RF2 RC2 RH7 RJ7 RH6 RH5 20 OSC2 VCCcore/Vcap R15 100 RB6 R14 100 M1X6 RJ6 60 1 2 3 4 5 PGC1 PGD1 MCLR# 59 58 57 X1 56 M1X5 8MHz 55 54 C2 22pF C1 22pF 53 52 PGC1 51 50 CLKO 49 CLKI 48 47 PGD1 46 45 44 43 42 41 RJ5 19 GND RB6 GND RJ4 18 RG4 RC7 17 PIC18F87J50 MCLR RC6 16 RB5 RC0 15 RB4 RC1 14 RG2 RG3 RA4 13 RB3 RA5 12 RG1 VCC Vcap RB2 GND 9 10 11 RG0 RA0/AN0 MCLR# RB1 RA1 8 RB0 RE0 RA2 7 RE1 RA3 6 RJ3 AGND 5 RJ2 AVCC 4 RH2 ENVREG 3 RB7 VCC-3.3 CN6 RH3 VUSB 2 RH4 1 RH1 U1 6 5 4 3 2 1 PGD1 PGC1 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 E9 10uF Figure 4-13: mikroProg™ and ICD2®/ICD3® programmer connection schematic Page 19 mikroProg 63 61 62 64 65 66 67 68 70 69 71 72 73 74 75 76 77 78 79 80 VCC-3.3 ICD2/3 CN5 MCLR# 5. Crystal oscillator Board is equipped with 8Mhz crystal oscillator circuit that provides external clock to the microcontroller OSC 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. VCC-3.3 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 Figure 5-1: Crystal oscillator schematic RH2 RH3 RE1 RE0 RG0 RG1 RG2 RG3 MCLR RG4 GND VCCcore/Vcap RF7 RF6 RF5 RF4/D+ RF3/DRF2 RH7 RH6 RH5 RH4 VUSB ENVREG AVCC AGND RA3 RA2 RA1 RA0/AN0 GND VCC RA5 RA4 RC1 RC0 RC6 RC7 RJ4 RJ5 PIC18F87J50 RJ2 RJ3 RB0 RB1 RB2 RB3 RB4 RB5 RB6 GND OSC2 OSC1 VCC RB7 RC5 RC4 RC3 RC2 RJ7 RJ6 Vcap E9 10uF 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 Vcap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 RH1 RH0 RE2 RE3 RE4 RE5 RE6 RE7 RD0 VCC GND RD1 RD2 RD3 RD4 RD5 RD6 RD7 RJ0 RJ1 U1 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 X1 8MHz CLKO CLKI C2 22pF C1 22pF Figure 5-2: Crystal oscillator module NOTE : The use of crystal in all other schematics is implied even if it is purposely left out, because of the schematics clarity. Page 20 6. microSD Card Slot RH1 RH0 RE2 RE3 RE4 RE5 RE6 RE7 RD0 VCC GND RD1 RD2 RD3 RD4 RD5 RD6 RD7 RJ0 RJ1 RH5 RH4 VUSB ENVREG AVCC AGND RA3 RA2 RA1 RA0/AN0 GND VCC RA5 RA4 RC1 RC0 RC6 RC7 RJ4 RJ5 PIC18F87J50 RJ2 RJ3 RB0 RB1 RB2 RB3 RB4 RB5 RB6 GND OSC2 OSC1 VCC RB7 RC5 RC4 RC3 RC2 RJ7 RJ6 Vcap 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 R9 10K VCC-MMC VCC-3.3 FP1 FERRITE E6 10uF C38 100nF CN4 MMC CARD MICRO R4 56 R5 56 MOSI1-RC5 MISO1-RC4 SCK1-RC3 SD-CS# MOSI1-RC5 SCK1-RC3 MISO1-RC4 SD-CD# R16 56 1 2 4 5 6 7 CS Din +3.3V SCK GND Dout CD E9 10uF 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 Vcap RH2 RH3 RE1 RE0 RG0 RG1 RG2 RG3 MCLR RG4 GND VCCcore/Vcap RF7 RF6 RF5 RF4/D+ RF3/DRF2 RH7 RH6 R10 10K G SD-CD# R11 10K SD-CS# MISO1-RC4 SD-CD# U1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Figure 6-1: microSD card slot VCC-MMC VCC-3.3 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 SD-CS# Board contains microSD card slot for using microSD cards in your projects. It enables you to store large amounts of data externally, thus saving microcontroller memory. microSD cards use Serial Peripheral Interface (SPI) for communication with the microcontroller. Figure 6-2: microSD Card Slot module connection schematic Page 21 Figure 6-3: Inserting microSD card 7. Touch Screen The development system features a TFT 320x240 display covered with a resistive touch panel. Together they form a functional unit called a touch screen. It enables data to be entered and displayed at the same time. The TFT display is capable of showing data in 262.000 different colors. Figure 7-1: Touch Screen Page 22 TFT1 VCC-SYS VCC-3.3 VCC-SYS Q1 BC846 R23 1K D2 LCD-XR T-D0-RJ0 T-D1-RJ1 Q3 BC846 RH1 RH0 RE2 RE3 RE4 RE5 RE6 RE7 RD0 VCC GND RD1 RD2 RD3 RD4 RD5 RD6 RD7 RJ0 RJ1 RH2 RH3 RE1 RE0 RG0 RG1 RG2 RG3 MCLR RG4 GND VCCcore/Vcap RF7 RF6 RF5 RF4/D+ RF3/DRF2 RH7 RH6 RH5 RH4 VUSB ENVREG AVCC AGND RA3 RA2 RA1 RA0/AN0 GND VCC RA5 RA4 RC1 RC0 RC6 RC7 RJ4 RJ5 PIC18F87J50 RJ2 RJ3 RB0 RB1 RB2 RB3 RB4 RB5 RB6 GND OSC2 OSC1 VCC RB7 RC5 RC4 RC3 RC2 RJ7 RJ6 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 T-D7 T-D6 T-D5-RJ5 T-D4-RJ4 T-D3-RJ3 T-D2-RJ2 T-D1-RJ1 T-D0-RJ0 T-D2-RJ2 T-D3-RJ3 X1 8MHz CLKO CLKI C2 22pF C1 22pF VCC-3.3 VCC-3.3 R25 10K R24 10K LCD-RST LCD-CS# VCC-3.3 E13 10uF LCD-BLED T-D7 T-D6 VCC-3.3 C21 47nF 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 1 2 3 LCD-RS 4 5 6 7 8 9 10 Vcap 11 12 13 14 15 16 17 18 19 20 R40 12 LCD-RST U1 PMWR Q2 BC846 BAT43 VCC-3.3 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 PMRD LCD-CS# LCD-RST LCD-YD LCD-BLED R41 300K VCC-3.3 C22 47nF R42 300K PMRD PMWR LCD-RS LCD-CS# LCD-XL LCD-YU T-D4-RJ4 T-D5-RJ5 E9 10uF LCD-YU LCD-XL Vcap LCD-XR LCD-YD LCD-XL LCD-YU Figure 7-2: Touch Screen connection schematic Page 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 LED-K LED-A1 LED-A2 LED-A3 LED-A4 IM0 IM1 IM2 IM3 RESET VSYNC HSYNC DOTCLK ENABLE DB17 DB16 DB15 DB14 DB13 DB12 DB11 DB10 DB9 DB8 DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 SDO SDI RD WR/SCL RS CS FMARK VCC-IO VCC VCC-I GND XR YD XL YU MI0283QT2 8. Audio Module Figure 8-1: On-board VS1053 MP3 codec Figure 8-2: Inserting 3.5mm headphones jack The mikromedia™ for PIC18FJ® features MP3 codec audio controller VS1053. This module enables audio reproduction by using stereo headphones connected to the system via a 3.5mm connector CN2. All functions of this module are controlled by the microcontroller over Serial Peripheral Interface (SPI). Page 24 63 61 64 62 65 66 67 70 68 69 71 72 73 74 75 76 77 RB1 RG0 RB2 RG1 RB3 RG2 RB4 RG3 9 10 RG4 11 GND 12 RB5 PIC18F87J50 MCLR RB6 GND OSC2 VCCcore/Vcap RB7 RF5 RC5 RF2 RC2 RJ7 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 E9 10uF MP3-RST# 12 11 10 9 8 7 6 5 4 3 2 1 13 14 15 16 17 18 19 20 21 22 23 24 MP3-BSYNC 57 56 55 54 MP3-CS# 53 MP3-BSYNC 52 R1 1M 51 MP3-CS# 50 49 C19 48 47 46 R4 56 45 MISO1-RC4 44 SCK1-RC3 43 42 41 X2 12.288MHz 22pF C20 22pF MOSI1-RC5 R5 56 VCC-1.8 VCC-1.8 VCC-1.8 VCC-1.8 R20 10K XDCS/BSYNC IOVDD1 VCO DGND1 XTALO XTALI IOVDD2 DGND2 DGND3 DGND4 XCS CVDD2 VS1053 VCC-3.3 R21 10K RJ5 RJ4 RC7 RC6 RC0 RC1 RA4 RA5 VCC RJ6 GND Vcap RH4 RH5 RH6 VUSB RH7 20 RA0/AN0 RC4 RC3 RA1 RF4/D+ RF3/D- RA2 18 19 VCC RF6 RA3 16 17 OSC1 RF7 AGND 15 AVCC 14 ENVREG 13 58 GPIO7 GPIO6 GPIO3 GPIO2 DREQ CVDD1 IOVDD0 CVDD0 DGND0 XRESET MCN MCP/LN1 RJ1 RJ0 RD7 RD6 RD5 RD4 RD3 RD2 RD1 GND VCC RD0 RE7 RE6 RE5 RE4 RE3 RE2 RB0 RE0 59 C4 100nF VCC-3.3 LN2 AGND3 LEFT AVDD2 RCAP AVDD1 GBUF AGND2 AGND1 RIGHT AVDD0 AGND0 48 47 46 45 44 43 42 41 40 39 38 37 E2 470 C18 3.3nF 10uF R32 E1 470 C17 3.3nF 10uF LEFT C9 100nF VCC-3.3 C10 100nF VCC-3.3 R22 27 RIGHT R29 10 C11 100nF R31 20 R27 10 C15 C16 C14 10nF 10nF 47nF VCC-3.3 VCC-3.3 VCC-1.8 C29 E10 10uF Vout ADJ MIC5205-ADJ 5 4 VCC-1.8 R47 220K R46 100K R50 0R C23 100nF C24 100nF C26 100nF C12 100nF C27 100nF Figure 8-3: Audio module connection schematic Page 25 R17 100K CN2 PHONEJACK R30 20 VCC-3.3 2.2uF U3 1 Vin 2 GND 3 EN R18 100K L 10 RIGHT C13 1uF R R28 LEFT GBUF GPIO5 RX TX SCLK SI SO CVDD3 XTEST GPIO0 GPIO1 GND GPIO4 8 RJ3 RE1 R2 10K 25 26 27 28 29 30 31 32 33 34 35 36 7 RH3 U2 60 SCK1-RC3 MOSI1-RC5 MISO1-RC4 6 MP3-RST# RJ2 R33 GPIO 5 MP3-DREQ MP3-RST# 4 MP3-DREQ RH0 RH1 3 Vcap MP3-CS# RH2 2 VCC-3.3 R19 10K U1 1 VCC-1.8 VCC-3.3 78 79 80 VCC-3.3 9. USB connection PIC18F87J50 microcontroller has integrated USB module, which enables you to implement USB communication functionality of your mikromedia board. Connection with target USB host is done over MINI-B USB connector which is positioned next to the battery connector. Figure 9-1: Connecting USB cable Page 26 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 VCC-3.3 USBDP USBDM Vcap RH2 RH3 RE1 RE0 RG0 RG1 RG2 RG3 MCLR RG4 GND VCCcore/Vcap RF7 RF6 RF5 RF4/D+ RF3/DRF2 RH7 RH6 PIC18F87J50 RJ2 RJ3 RB0 RB1 RB2 RB3 RB4 RB5 RB6 GND OSC2 OSC1 VCC RB7 RC5 RC4 RC3 RC2 RJ7 RJ6 RH5 RH4 VUSB ENVREG AVCC AGND RA3 RA2 RA1 RA0/AN0 GND VCC RA5 RA4 RC1 RC0 RC6 RC7 RJ4 RJ5 Vcap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 RH1 RH0 RE2 RE3 RE4 RE5 RE6 RE7 RD0 VCC GND RD1 RD2 RD3 RD4 RD5 RD6 RD7 RJ0 RJ1 U1 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 X1 8MHz CLKO CLKI C2 22pF C1 22pF CN3 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 VCC-USB E9 10uF Figure 9-2: USB module connection schematic Page 27 FP2 FERRITE 5 4 USBDP 3 USBDM 2 1 C28 10nF GND ID D+ DVBUS USB MINIB 10. Accelerometer On board ADXL345 accelerometer is used to measure acceleration in three axis: x- y- and z-. The accelerometer function is defined by the user in the program loaded into the microcontroller. Communication between the accelerometer and the microcontroller is performed over the I2C interface. Vcap 7 SDA ADD Res NC INT2 INT1 13 12 11 10 9 8 SDA2-RD5 ACC ADDRESS VCC-3.3 3 SCL VCC GND Res GND GND VCC 2 RH1 RH0 RE2 RE3 RE4 RE5 RE6 RE7 RD0 VCC GND RD1 RD2 RD3 RD4 RD5 RD6 RD7 RJ0 RJ1 RH5 RH4 VUSB ENVREG AVCC AGND RA3 RA2 RA1 RA0/AN0 GND VCC RA5 RA4 RC1 RC0 RC6 RC7 RJ4 RJ5 PIC18F87J50 RJ2 RJ3 RB0 RB1 RB2 RB3 RB4 RB5 RB6 GND OSC2 OSC1 VCC RB7 RC5 RC4 RC3 RC2 RJ7 RJ6 1 2 3 4 5 6 ADXL345 VCC-3.3 VCC-3.3 C33 100nF J1 SMD JUMPER C32 100nF Figure 10-1: Accelerometer module You can set the accelerometer address to 0 or 1 by re-soldering the SMD jumper (zero-ohm resistor) to the appropriate position. Jumper is placed in address 1 position by default. E9 10uF 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 Vcap RH2 RH3 RE1 RE0 RG0 RG1 RG2 RG3 MCLR RG4 GND VCCcore/Vcap RF7 RF6 RF5 RF4/D+ RF3/DRF2 RH7 RH6 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 R12 10K 14 CS 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 U9 U1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 R13 10K SCL2-RD6 1 SDA2-RD5 SCL2-RD6 VCC-3.3 VCC-3.3 VCC-3.3 Figure 10-2: Accelerometer connection schematic Page 28 11. Flash Memory Since multimedia applications are getting increasingly demanding, it is necessary to provide additional memory space to be used for storing more data. The flash memory module enables the microcontroller to use additional 8Mbit flash memory. It is connected to the microcontroller via the Serial Peripheral Interface (SPI). 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 VCC-3.3 Vcap RH2 RH3 RE1 RE0 RG0 RG1 RG2 RG3 MCLR RG4 GND VCCcore/Vcap RF7 RF6 RF5 RF4/D+ RF3/DRF2 RH7 RH6 PIC18F87J50 RJ2 RJ3 RB0 RB1 RB2 RB3 RB4 RB5 RB6 GND OSC2 OSC1 VCC RB7 RC5 RC4 RC3 RC2 RJ7 RJ6 RH5 RH4 VUSB ENVREG AVCC AGND RA3 RA2 RA1 RA0/AN0 GND VCC RA5 RA4 RC1 RC0 RC6 RC7 RJ4 RJ5 Vcap FLASH-CS# 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 RH1 RH0 RE2 RE3 RE4 RE5 RE6 RE7 RD0 VCC GND RD1 RD2 RD3 RD4 RD5 RD6 RD7 RJ0 RJ1 U1 X1 8MHz CLKO CLKI R4 56 R5 56 C2 22pF C1 22pF MOSI1-RC5 MISO1-RC4 SCK1-RC3 VCC-3.3 VCC-3.3 R48 10K C37 VCC-3.3 100nF U10 FLASH-CS# MISO1-RC4 R3 56 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 E9 10uF 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 Figure 11-1: Flash memory module connection schematic 1 2 3 4 CS SDO WP GND M25P80 Page 29 VCC HOLD SCK SDI 8 7 6 SCK1-RC3 5 MOSI1-RC5 Figure 11-2: Flash memory module T-D0-RJ0 T-D1-RJ1 RE2 RE3 RE4 RE5 RE6 RE7 SDA2-RD5 SCL2-RD6 12. Pads VCC-3.3 VCC-SYS HDR1 RG4 Vcap RF6 RF5 RX TX SCL SDO RF2 RH6 Vcap E9 10uF RH1 RH0 RE2 RE3 RE4 RE5 RE6 RE7 RD0 VCC GND RD1 RD2 RD3 RD4 RD5 RD6 RD7 RJ0 RJ1 RH2 RH3 RE1 RE0 RG0 RG1 RG2 RG3 MCLR RG4 GND VCCcore/Vcap RF7 RF6 RF5 RF4/D+ RF3/DRF2 RH7 RH6 PIC18F87J50 Pads HDR2 RJ2 RJ3 RB0 RB1 RB2 RB3 RB4 RB5 RB6 GND OSC2 OSC1 VCC RB7 RC5 RC4 RC3 RC2 RJ7 RJ6 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 T-D2-RJ2 T-D3-RJ3 RB0 RB1 RB2 RB3 PGC1 PGD1 R4 R5 56 MOSI1-RC5 MISO1-RC4 56 SCK1-RC3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 SCK 22 SDI 23 SDO 24 25 26 RA2 RA5 RF2 RF5 RF6 RH4 RH6 RB0 RB1 RB2 RB3 T-D0-RJ0 T-D1-RJ1 T-D2-RJ2 T-D3-RJ3 T-D4-RJ4 T-D5-RJ5 RC0 RA4 SCK1-RC3 MISO1-RC4 MOSI1-RC5 VCC-3.3 M1X26 RA5 RA4 RC1 RC0 TX1-RC6 RX1-RC7 T-D4-RJ4 T-D5-RJ5 RG0 RG1 RG2 RG3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 RH4 M1X26 RE1 RA3-VREF-1.8 RA2 VCC-3.3 U1 RH5 RH4 VUSB ENVREG AVCC AGND RA3 RA2 RA1 RA0/AN0 GND VCC RA5 RA4 RC1 RC0 RC6 RC7 RJ4 RJ5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 RST L R RC1 RG0 RG3 RG4 RA3 RE1 RE2 RE3 RE4 RE5 RE6 RE7 RB6 RB7 RG2 RG1 RX1-RC7 TX1-RC6 SCL2-RD6 SDA2-RD5 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 HDR2 Figure 12-1: Pads connecting schematic Pads HDR1 Most microcontroller pins are available for further connectivity via two 1x26 rows of connection pads on both sides of the mikromedia board. They are designed to match additional shields, such as Battery Boost shield, Gaming, PROTO shield and others. Pads with underlined silkscreen markings have multiple functions (see the complete schematic for more information). Page 30 13. Pinout System power supply Reference Ground AN2/VREFAN4/C2INA AN7/C2INB AN10/ C1INB/CVREF AN11/C1INA AN12/P3C/C2INC AN14/P1C/C1INC FLT0/INT0 INT1 INT2 INT3 ALE OE WRL WRH BA0 CE T1OSO/T13CKI T0CKI SCL1/SCK1 SDA1/SDI1 C2OUT/SDO1 3.3V power supply Reference Ground VSYS GND RA2 RA5 RF2 RF5 RF6 RH4 RH6 RB0 RB1 RB2 RB3 RJ0 RJ1 RJ2 RJ3 RJ4 RJ5 RC0 RA4 RC3 RC4 RC5 3.3V GND RST GND L R RC1 RG0 RG3 RG4 RA3 RE1 RE2 RE3 RE4 RE5 RE6 RE7 RB6 RB7 RG2 RG1 RC7 RC6 RD6 RD5 3.3V GND Reset pin Reference Ground left ch. audio out right ch. ECCP2/T1OSI/P2A ECCP3/P3A CCP4/P3D CCP5/P1D AN3/VREF+ AD9/P2C AD10/P2B AD11/P3C/REFO AD12/P3B AD13/P1C AD14/P1B AD15/P2A KBI2/PGC KBI3/PGD RX2/DT2 TX2/CK2 RX1/DT1 TX1/CK1 AD6/SCL2 AD5/SDA2 3.3V power supply Reference Ground Pin functions Programing lines Pin functions Analog Lines Interrupt Lines SPI Lines Page 31 I2C Lines UART lines PWM lines Comparator lines 14. Dimensions 80.90 mm (3.18”) 73.01 mm (2.87”) 36.55 mm (1.44”) 50.27 mm (1.98”) 55.47 mm (2.18”) 5.08 mm (0.20”) 60.56 mm (2.38”) 69.85 mm (2.75”) 4.45 mm (0.17”) 2.54 mm (0.10”) Page 32 2.77 mm (0.11”) 15. mikromedia™ accessories We have prepared a set of extension boards pin-compatible with your mikromedia™, which enable you to easily expand your board basic functionality. We call them mikromedia shields. But we also offer other accessories, such as Li-polymer battery, stacking headers, wire jumpers and more. 04 Gaming shield 01 Connect shield 02 BatteryBoost shield 03 PROTO shield 05 Li-Polimer battery 06 Wire Jumpers 07 Stacking headers Page 33 What’s next? You have now completed the journey through each and every feature of mikromedia™ for PIC18FJ® board. You got to know it’s modules and organization. Now you are ready to start using your new board. We are suggesting several steps which are probably the best way to begin. We invite you to join the users of mikromedia™ 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 TFT™ 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 TFT™ 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 TFT™ 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. 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. TRADEMARKS The MikroElektronika name and logo, the MikroElektronika logo, mikroC™, mikroBasic™, mikroPascal™, mikroProg™, EasyPIC™, EasyPIC PRO™, Visual TFT™ 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 © MikroElektronika, 2012, All Rights Reserved. Page 35 If you want to learn more about our products, please visit our website 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/esupport If you have any questions, comments or business proposals, do not hesitate to contact us at [email protected] mikromedia for PIC18FJ User Manual ver. 1.00 0 100000 019443