mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window...

44
Compact development system rich with on-board peripherals for all-round multimedia development on PIC18F87J50 device. for PIC18FJ mikromedia ®

Transcript of mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window...

Page 1: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Compact development system rich with on-board peripherals for all-round

multimedia development on PIC18F87J50 device.

for PIC18FJmikromedia™

®

Page 2: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 2

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.

TO OUR VALUED CUSTOMERS

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 3: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 3

Introduction to mikromedia™ for PIC18FJ® 4

Package Contains 5

Key Features 6

System Specification 7

1. Power supply 8

Battery power supply 8

USB power supply 8

2. PIC18F87J50 microcontroller 10

Key microcontroller features 10

3. Programming the microcontroller 11

Programming with mikroBootloader 12

step 1 – Connecting mikromedia 12

step 2 – Browsing for .HEX file 13

step 3 – Selecting .HEX file 13

step 4 – Uploading .HEX file 14

step 5 – Finish upload 15

Programing with mikroProg™ programmer 16

mikroProg Suite™ for PIC® Software 17

Programing with ICD2® or ICD3® programmer 18

4. Reset Button 20

5. Crystal oscillator 22

6. microSD Card Slot 24

7. Touch Screen 26

8. Audio Module 28

9. USB connection 30

10. Accelerometer 32

11. Flash Memory 34

12. Pads 36

13. Pinout 37

14. Dimensions 38

15. Mikromedia accessories 39

What’s next? 40

Table of Contents

Page 4: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 4

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, audio connector,

MMC/SD card slot, 8 Mbit flash memory,

2x26 connection pads and other. It comes

preprogrammed 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 5: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 5

mik

rom

edia

™ f

or P

IC1

8FJ

® - p

inou

t VSYS RSTGND GNDRA2 LRA5 RRF2 RC1RF5 RG0RF6 RG3RH4 RG4RH6 RA3RB0 RE1RB1 RE2RB2 RE3RB3 RE4RJ0 RE5RJ1 RE6RJ2 RE7RJ3 RB6RJ4 RB7RJ5 RG2

RC0 RG1RA4 RC7RC3 RC6RC4 RD6RC5 RD5

3.3V 3.3VGND GND

SPI LinesInterrupt LinesAnalog LinesDigital lines I2C Lines UART lines PWM lines

Reset pin5V power supplyReference GroundReference Groundleft ch.right ch.

3.3V power supply3.3V power supplyReference GroundReference Ground

Pin functions Pin functions

audio out

UART

I2CSPI2SCK2SDI2

SDO2

RXTXSCL2SDA2

Analog Lines

Interrupt Lines

PWM lines

Digital I/O lines

Digital I/O lines

Package Contains

01 02

04 05

03

06

Damage resistant

protective box

mikromedia™ for PIC18FJ®

development system

mikromedia™ for PIC18FJ®

user’s guide

mikromedia™ for PIC18FJ®

schematics and pinout

Two 1x26 male headers

and one 1x5 header

USB cable

Page 6: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 6

Key Features

01

09

02

16

01

02

03

04

05

06

07

08

09

10

11

12

13

14

15

Connection Pads

TFT 320x240 display

USB MINI-B connector

CHARGE indication LED

LI-Polymer battery connector

3.5mm headphone connector

Power supply regulator

Serial Flash memory

RESET button

VS1053 Stereo mp3 coder/decoder

PIC18F87J50 microcontroller

Accelerometer

Crystal oscillator

Power indication LED

microSD Card Slot

ICD2/3 connector

mikroProg connector17

Page 7: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 7

03

06

07

08

11

10

12

13

14

15

16

04 05

17

System Specification

power supplyVia USB cable (5V DC)

board dimensions81.2 x 60.5 mm (3.19 x 2.38 inch)

weight~45.5g (0.10lbs)

power consumption52 mA with erased MCU (when back-light is ON)

CAUTION: Electrostatic Sensitive DevicePermanent damage may occur on devices subjected to high energy electrostatic discharges which readily accumulate on the human body or test equipment and can discharge without detection.

class B productProduct complies with the Class B limit of EN 55022 and can be used in the domestic, residential, commercial and industrial environments.

Page 8: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 8

1. Power supply

You can apply power supply to the board

using MINI-B USB cable provided with

the board. 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 Li-Polymer battery, via on-board battery connector. On-board

battery charger circuit MCP73832 enables you to

charge the battery over USB connection. LED diode (RED) will indicate when battery is charging. Charging

current is ~250mA 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

Page 9: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 9

VCC-1.8VREF-1.8

E1110uF

FP3

FERRITE

VCC-SYS VCC-3.3

E310uF

E410uF

R26

2K2

VCC-BAT

R443K9

Charging Current approx. 250mA

R394K7

VCC-3.3

E7 10uF C40

2.2uF

R344K7

R64K7

VCC-BAT

VSENSE

VCC-SYS

R37

10K

R3610K

VCC-3.3

STAT

R3810K

R451K

VCC-3.3

E510uF

R3510K

VCC-3.3

C29

2.2uF

VCC-3.3

R46100K

E10

10uF

R47220K

VCC-1.8

VCC-1.8

R500R

123

5

4

VinGNDEN ADJ

Vout

U3

MIC5250-ADJ

R494K7

3

12

GNDVin

Vout

REG1

LD29080DT33

VCC-BAT

LD1GREEN

LD2RED

12

CN1

BATT CONN

23

5

4

1STATVSSVBAT VDD

PROG

U5

MCP73832

Q4BC846

Q5BC846

D1PMEG3010ER

VCC-SYSVCC-BAT

VCC-USB

R43

10K

M1DMP2160UW

DAT

A BU

S1234567891011121314151617181920212223242526

HDR1

M1X26

HDR2

M1X26

VCC-3.3 VCC-3.3

VCC-SYSVCC-USB

C2810nF

FP2FERRITE

12345 GND

IDD+D-VBUS

CN3

USB MINIB

2728293031323334353637383940414243444546474849505152

Figure 1-3: Power supply schematics

Page 10: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 10

2. PIC18F87J50 microcontroller

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.

Key microcontroller features- Up to 12 MIPS Operation;

- 8-bit architecture;

- 128KB of program memory;

- 3.904 bytes of RAM;

- 65 I/O pins;

- Internal Oscillator 8 MHz, 32 kHz;

- 2-UART, 2-SPI, 2-I2C, USB 2.0;

- DAC, ADC, etc.

Data/Memory Bus

Data Bus

PIC18FJ

12 MIPS 8-bit Core- nanoWatt- 48MHz

31 LevelStack

ProgramCounter

Instruction Data

PMP Timers Comparators ADC10-Bit EUSART CCP MSSP

Flash(Up to 128KB)

RAM(Up to 3.9KB) VREG

DataAddress

AddresseDecode

USB

Page 11: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 11

The microcontroller can be programmed in three ways:

3. Programming the microcontroller

01

02

03

Via USB HID mikroBootloader

Using mikroProg™ external programmer

Using ICD2/3® external programmer

Figure 3-1:PIC18F87J50

microcontroller

Page 12: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 12

Programming with mikroBootloader

Figure 3-2: USB HID mikroBootloader window

step 1 – Connecting mikromedia

01

01 In order to start, connect the USB cable or (if already connected) press the Reset button on your mikromedia board. Click the Connect button within 5s to enter the bootloader mode, otherwise the existing microcontroller program will be executed.

Microcontroller is preprogrammed with USB HID Bootloader, which

can be used to upload new device firmware. To transfer firmware

.HEX file from a PC to MCU you need to use mikroBootloader USB

HID application, which can be downloaded from:

Upon download, unzip it to desired location and start the mikro-

Bootloader application:

http://www.mikroe.com/downloads/get/1682/mikrobootloader_pic18f87j50_v210.zip

Page 13: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 13

step 3 – Selecting .HEX file step 2 – Browsing for .HEX file

Figure 3-3: Browse for HEX Figure 3-4: Selecting HEX

01

02

0101

02

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.

Select .HEX file using open dialog window.

Click the Open button.

Page 14: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 14

step 4 – Uploading .HEX file

Figure 3-5: Begin uploading Figure 3-6: Progress bar

01

01

01 01In order to upload .HEX file click the Begin uploading button.

.HEX file uploading can be monitored via progress bar.

Page 15: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 15

step 5 – Finish upload

Figure 3-7: Restarting MCU Figure 3-8: mikroBootloader ready for next job

01

01

Click the OK button after uploading is finished. The board will be automatically reset and after 5 seconds your new program will be executed.

Page 16: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 16

The microcontroller can be programmed with mikroProg™ programmer and mikroProg Suite™ for PIC® software. The

mikroProg™ programmer is connected to the development

system via the CN6 connector, Figure 3-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.

Programing with mikroProg™

programmer

Figure 3-9: Connecting mikroProg™ to mikromedia™

Page 17: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

mikroProg Suite™ for PIC® Software

Figure 3-10: Main Window of mikroProg Suite™ for PIC® programming 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.

Page 17

Page 18: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 18

The microcontroller can be also

programmed with ICD2® or ICD3®

programmer. These programmers

connects with mikromedia board

via ICD2 CONNECTOR BOARD.

Programing with

ICD2® or ICD3® programmer

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. Then you should plug the ICD2® or ICD3® programmer into it, Figure 3-11.

Figure 3-11: Connecting ICD2®

or ICD3® programmer

Page 19: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 19

Figure 3-12: mikroProg™ and ICD2®/ICD3® programmer connection schematic

X1

8MH

z

C2 22pF

C1 22pF

E910uF

PGD1

PGC1MCLR#

CLKO

CLKI

RA

0/A

N0

30R

A1

29R

A2

28R

A3

27

RA

434

RA

533

RB058

RB157

RB256

RB355

RB454

RB553

RB652

RB747

RC

036

RC

135

RC243

RC344

RC445

RC546

RC

637

RC

738

MCLR9

OSC149

OSC250

GND11

VCCcore/Vcap12

VC

C32

RD

072

RD

169

RD

268

RD

367

RD

466

RD

565

RD

664

RD

763

RE04

RE13

RE

278

RE

377

EN

VR

EG

24V

US

B23

RF218

RF3/D-17

RF4/D+16

RF515

RF614

RF713

RG05

RG16

RG27

RG38

RG410

RH

079

RH

180

RH21

RH32

RH

422

RH

521

RH620

RH719

RJ0

62

RJ1

61

RJ260

RJ359

RJ4

39

RJ5

40

RJ641

RJ742

VCC48

VC

C71

GN

D31

GND51

GN

D70

AG

ND

26A

VC

C25

RE

476

RE

575

RE

674

RE

773

U1

PIC18F87J50

VCC-3.3

Vcap

Vcap

ICD

2/3

MCLR#

PGD1PGC1

VCC-3.3

MCLR#PGD1PGC1

R14 100

R15 100

RB6

RB7

mik

roP

rog1

2345

CN6

M1X5

123456

CN5

M1X6

VCC-3.3

Page 20: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 20

Board is equipped with reset button, which is located at

the top of the front side (Figure 4-2). If you want to

reset the circuit, press the reset button. It will generate

low voltage level on microcontroller reset pin (input). In

addition, a reset can be externally provided through pin 27 on side headers (Figure 4-3).

4. Reset Button

Figure 4-2: Frontal reset buttonFigure 4-1: Location of additional reset button

You can also solder additional reset button on the appropriate place at the back side of the board, Figure 4-1.

NOTE

Page 21: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 21

R810K

VCC-3.3

C3

100nF

T1

BU

TTO

N

R7 1K

T2

BU

TTO

N

RST

RST

RA

0/A

N0

30R

A1

29R

A2

28R

A3

27

RA

434

RA

533

RB058

RB157

RB2 56

RB355

RB454

RB553

RB652

RB747

RC

036

RC

135

RC243

RC344

RC445

RC546

RC

637

RC

738

MCLR9

OSC149

OSC250

GND11

VCCcore/Vcap12

VC

C32

RD

072

RD

169

RD

268

RD

367

RD

466

RD

565

RD

664

RD

763

RE04

RE13

RE

278

RE

377

EN

VR

EG

24V

US

B23

RF218

RF3/D-17

RF4/D+16

RF515

RF614 RF713

RG05

RG16

RG27

RG38

RG410

RH

079

RH

180

RH21

RH32

RH

422

RH

521

RH620

RH719

RJ0

62

RJ1

61

RJ260

RJ359

RJ4

39

RJ5

40

RJ641

RJ742

VCC48

VC

C71

GN

D31

GND51

GN

D70

AG

ND

26A

VC

C25

RE

476

RE

575

RE

674

RE

773

U1

PIC18F87J50

VCC-3.3

Vcap

2728293031323334353637383940414243444546474849505152

HDR2

M1X26

VCC-3.3

RST

E910uF

Figure 4-3: Reset circuit schematic

Page 22: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 22

Board is equipped with 8MHz crystal oscillator (X1) 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.

The use of crystal in all other schematics is implied even if it is purposely left out, because of the schematics clarity.

5. Crystal oscillator

Figure 5-1:Crystal oscillator

module

NOTE :

Page 23: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 23

X1

8MH

z

C2 22pF

C1 22pFCLKOCLKI

E910uF

RA

0/A

N0

30R

A1

29R

A2

28R

A3

27

RA

434

RA

533

RB058

RB157

RB2 56

RB355

RB454

RB553

RB652

RB747

RC

036

RC

135

RC243

RC344

RC445

RC546

RC

637

RC

738

MCLR9

OSC149

OSC250

GND11

VCCcore/Vcap12

VC

C32

RD

072

RD

169

RD

268

RD

367

RD

466

RD

565

RD

664

RD

763

RE04

RE13

RE

278

RE

377

EN

VR

EG

24V

US

B23

RF218

RF3/D-17

RF4/D+16

RF515

RF614 RF713

RG05

RG16

RG27

RG38

RG410

RH

079

RH

180

RH21

RH32

RH

422

RH

521

RH620

RH719

RJ0

62

RJ1

61

RJ260

RJ359

RJ4

39

RJ5

40

RJ641

RJ742

VCC48

VC

C71

GN

D31

GND51

GN

D70

AG

ND

26A

VC

C25

RE

476

RE

575

RE

674

RE

773

U1

PIC18F87J50

VCC-3.3

Vcap

Vcap

Figure 5-2: Crystal oscillator schematic

Page 24: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 24

6. microSD Card Slot

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-1: microSD card slot

Page 25: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 25

E910uF

MISO1-RC4

SD

-CS

#

SD

-CD

#

RA

0/A

N0

30R

A1

29R

A2

28R

A3

27

RA

434

RA

533

RB058

RB157

RB2 56

RB355

RB454

RB553

RB652

RB747

RC

036

RC

135

RC243

RC344

RC445

RC546

RC

637

RC

738

MCLR9

OSC149

OSC250

GND11

VCCcore/Vcap12

VC

C32

RD

072

RD

169

RD

268

RD

367

RD

466

RD

565

RD

664

RD

763

RE04

RE13

RE

278

RE

377

EN

VR

EG

24V

US

B23

RF218

RF3/D-17

RF4/D+16

RF515

RF614 RF713

RG05

RG16

RG27

RG38

RG410

RH

079

RH

180

RH21

RH32

RH

422

RH

521

RH620

RH719

RJ0

62

RJ1

61

RJ260

RJ359

RJ4

39

RJ5

40

RJ641

RJ742

VCC48

VC

C71

GN

D31

GND51

GN

D70

AG

ND

26A

VC

C25

RE

476

RE

575

RE

674

RE

773

U1

PIC18F87J50

VCC-3.3

Vcap

Vcap

R1110K

R1010K

VCC-MMC

R910K

MISO1-RC4SD-CS#

SD-CD#

SD-CS#

SD-CD#

SCK1-RC3SCK1-RC3

MISO1-RC4

MOSI1-RC5MOSI1-RC5

R16

56R5 56

CS1

Din2

+3.3V4

SCK5

GND6

Dout7

CD G

CN4 MMC CARD MICRO

VCC-3.3

E6 10uF

C38 100nF

FP1

FERRITE

VCC-MMC

R4 56

Figure 6-2: microSD Card Slot module connection schematic

Page 26: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 26

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

graphics in 262.144 diffe rent colors.

7. Touch Screen

Figure 7-1: Touch Screen

Page 27: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 27

R23

1K

VCC-SYS

LCD-RST

LCD-RSLCD-CS#

LCD-YULCD-XLLCD-YDLCD-XR

VCC-3.3

E13

10uF

R2510K

VCC-3.3

R2410K

LCD-RSTLCD-CS#

VCC-3.3

T-D6T-D7

LCD-BLED

R42300K

VCC-3.3

R41300K

LCD-YULCD-XL

VCC-3.3

Q1BC846

R4012

VCC-SYS

Q2BC846

Q3BC846

PMRDPMWR

C21

47nF

C22

47nF

T-D4-RJ4T-D3-RJ3T-D2-RJ2T-D1-RJ1T-D0-RJ0

T-D5-RJ5

D2

BAT43

2

15

12

35

11

36

3456

14

789

13

43

33

10

37383940

444546

34

1

47

1617181920212223242526272829303132

4142

VCC-3.3

E910uF

LCD

-RS

T

LCD-RS

LCD

-CS

#

LCD

-YU

LCD

-XL

LCD

-YD

LCD

-XR

T-D6T-D7

PM

RD

PMWR

LCD-BLED

T-D

4-R

J4

T-D3-RJ3T-D2-RJ2

T-D

1-R

J1T-

D0-

RJ0

T-D

5-R

J5

RA

0/A

N0

30R

A1

29R

A2

28R

A3

27

RA

434

RA

533

RB058

RB157

RB2 56

RB355

RB454

RB553

RB652

RB747

RC

036

RC

135

RC243

RC344

RC445

RC546

RC

637

RC

738

MCLR9

OSC149

OSC250

GND11

VCCcore/Vcap12

VC

C32

RD

072

RD

169

RD

268

RD

367

RD

466

RD

565

RD

664

RD

763

RE04

RE13

RE

278

RE

377

EN

VR

EG

24V

US

B23

RF218

RF3/D-17

RF4/D+16

RF515

RF614 RF713

RG05

RG16

RG27

RG38

RG410

RH

079

RH

180

RH21

RH32

RH

422

RH

521

RH620

RH719

RJ0

62

RJ1

61

RJ260

RJ359

RJ4

39

RJ5

40

RJ641

RJ742

VCC48

VC

C71

GN

D31

GND51

GN

D70

AG

ND

26A

VC

C25

RE

476

RE

575

RE

674

RE

773

U1

PIC18F87J50

VCC-3.3

Vcap

Vcap

X1

8MH

z C2 22pF

C1 22pFCLKOCLKI

TFT1

MI 0283QT-9A

LED- A1

DB17

HSYNC

RD

VSYNC

WR(D/C)

LED- A2LED- A3LED- A4IM0

DE

IM3IM2IM1

DOTCL K

GND

SDO

RESET

D/C(SCL)CSTEVDDI

X+(R)Y+(D)X- (L )

SDI

LED- K

Y- (U)

DB16DB15DB14DB13DB12DB11DB10DB9DB8DB7DB6DB5DB4DB3DB2DB1DB0

VCIVCI

Figure 7-2: Touch Screen connection schematic

Page 28: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 28

Figure 8-2: 3.5mm headphones jack

The mikromedia™ for PIC18FJ® features stereo audio codec 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).

8. Audio Module

Figure 8-1: On-board VS1053 MP3 codec

Page 29: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 29

Figure 8-3: Audio module connection schematic

MP3-BSYNC

MP3-CS#

MO

SI1

-RC

5S

CK

1-R

C3

MIS

O1-

RC

4

C20

22pF

C19

22pF

C11100nF

R1 1M

R2010K

R21

10K

MP

3-D

RE

Q

MP3-RST#

C10100nF

C4100nF

C12100nF

C9100nF

R210K

R1910K

C23100nF

VCC-3.3

C24100nF

VCC-3.3

C26100nF

VCC-3.3 VCC-3.3

C27100nF

X2

12.288MHz C131uF

VCC-3.3

GP

IO

VCC-3.3

LEFT

RIGHT

GBUF

VCC-1.8 VCC-1.8 VCC-1.8 VCC-1.8

VCC-3.3

E1

10uF

E2

10uF

CN2

PHONEJACK

LEFT

RIGHT

C16

10nF

C14

47nF

C15

10nF

R2710

R3020

R3120

R28 10

R29 10

R32

470C17

3.3nFR17100K

R33

470C18

3.3nFR18100K

L

R

C29

2.2uF

VCC-3.3

R46100K

E10

10uF

R47220K

VCC-1.8

VCC-1.8

R500R

R2227

MC

N2

XR

ES

ET

3D

GN

D0

4C

VD

D0

5IO

VD

D0

6C

VD

D1

7

GP

IO6

11G

PIO

712

XDCS/BSYNC13

IOVDD114

GP

IO5

25

CVDD224 XCS23 DGND422 DGND321

XTALI18 XTALO17 DGND116 VCO15

DR

EQ

8

MC

P/L

N1

1

IOVDD219

GP

IO2

9G

PIO

310

TX27

RX

26

DGND220

SC

LK28

SI

29

SO

30

CV

DD

331

XTE

ST

32

GP

IO0

33

GP

IO1

34

GN

D35

GP

IO4

36

AGND0 37AVDD0 38RIGHT 39AGND1 40AGND2 41GBUF 42AVDD1 43RCAP 44AVDD2 45LEFT 46AGND3 47LN2 48

U2

VS1053

VCC-1.8VCC-3.3

MP3-CS#

MP

3-R

ST#

Vin1

GND2

EN3

Vout 5

ADJ 4

U3

MIC5205-ADJ

E910uF

MISO1-RC4

MP

3-R

ST#

MP3-DREQ

MP3-CS#

RA

0/A

N0

30R

A1

29R

A2

28R

A3

27

RA

434

RA

533

RB058

RB157

RB256

RB355

RB454

RB553

RB652

RB747

RC

036

RC

135

RC243

RC344

RC445

RC546

RC

637

RC

738

MCLR9

OSC149

OSC250

GND11

VCCcore/Vcap12

VC

C32

RD

072

RD

169

RD

268

RD

367

RD

466

RD

565

RD

664

RD

763

RE04

RE13

RE

278

RE

377

EN

VR

EG

24V

US

B23

RF218

RF3/D-17

RF4/D+16

RF515

RF614

RF713

RG05

RG16

RG27

RG38

RG410

RH

079

RH

180

RH21

RH32

RH

422

RH

521

RH620

RH719

RJ0

62

RJ1

61

RJ260

RJ359

RJ4

39

RJ5

40

RJ641

RJ742

VCC48

VC

C71

GN

D31

GND51

GN

D70

AG

ND

26A

VC

C25

RE

476

RE

575

RE

674

RE

773

U1

PIC18F87J50

VCC-3.3

Vcap

Vcap

MP3-BSYNC

SCK1-RC3

MOSI1-RC5

R5 56

R4 56

Page 30: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 30

PIC18F87J50 microcontroller has integrated USB module, which enables you to implement

USB communication functionality to your mikromedia board. Connection with target USB host is

done over MINI-B USB connector which is positioned next to the battery connector.

9. USB connection

Figure 9-1: Connecting USB cable to MINI-B USB connector

Page 31: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 31

Figure 9-2: USB module connection schematic

X1

8MH

z

C2 22pF

C1 22pF

E910uF

USBDPUSBDM

RA

0/A

N0

30R

A1

29R

A2

28R

A3

27

RA

434

RA

533

RB058

RB157

RB2 56

RB355

RB454

RB553

RB652

RB747

RC

036

RC

135

RC243

RC344

RC445

RC546

RC

637

RC

738

MCLR9

OSC149

OSC250

GND11

VCCcore/Vcap12

VC

C32

RD

072

RD

169

RD

268

RD

367

RD

466

RD

565

RD

664

RD

763

RE04

RE13

RE

278

RE

377

EN

VR

EG

24V

US

B23

RF218

RF3/D-17

RF4/D+16

RF515

RF614 RF713

RG05

RG16

RG27

RG38

RG410

RH

079

RH

180

RH21

RH32

RH

422

RH

521

RH620

RH719

RJ0

62

RJ1

61

RJ260

RJ359

RJ4

39

RJ5

40

RJ641

RJ742

VCC48

VC

C71

GN

D31

GND51

GN

D70

AG

ND

26A

VC

C25

RE

476

RE

575

RE

674

RE

773

U1

PIC18F87J50

VCC-3.3

Vcap

Vcap

CLKOCLKI

USBDPUSBDM

VCC-USB

C2810nF

FP2

FERRITEVBUS

1D-

2D+

3ID

4GND

5

CN3

USB MINIB

Page 32: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 32

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 via the I2C interface.

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.

Page 33: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 33

Figure 10-2: Accelerometer connection schematic

C32100nF

C33100nF

SCL2-RD6

SDA2-RD5

R1210K

R1310K

VCC-3.3

1 2 3

J1SMD JUMPER

ACC ADDRESSVCCGNDResGNDGNDVCC

CS INT1

INT2NC

ResADDSDAS

CL

U9

ADXL345

VCC-3.3

VCC-3.3VCC-3.3

VCC-3.3

14

7

12

43

56

1312

1011

98

E910uF

SC

L2-R

D6

SD

A2-

RD

5

RA

0/A

N0

30R

A1

29R

A2

28R

A3

27

RA

434

RA

533

RB058

RB157

RB2 56

RB355

RB454

RB553

RB652

RB747

RC

036

RC

135

RC243

RC344

RC445

RC546

RC

637

RC

738

MCLR9

OSC149

OSC250

GND11

VCCcore/Vcap12

VC

C32

RD

072

RD

169

RD

268

RD

367

RD

466

RD

565

RD

664

RD

763

RE04

RE13

RE

278

RE

377

EN

VR

EG

24V

US

B23

RF218

RF3/D-17

RF4/D+16

RF515

RF614 RF713

RG05

RG16

RG27

RG38

RG410

RH

079

RH

180

RH21

RH32

RH

422

RH

521

RH620

RH719

RJ0

62

RJ1

61

RJ260

RJ359

RJ4

39

RJ5

40RJ6

41RJ7

42

VCC48

VC

C71

GN

D31

GND51

GN

D70

AG

ND

26A

VC

C25

RE

476

RE

575

RE

674

RE

773

U1

PIC18F87J50

VCC-3.3

Vcap

Vcap

Page 34: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 34

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).

Figure 11-1:Flash memory module

Page 35: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 35

E910uF

MISO1-RC4

FLASH-CS#

RA

0/A

N0

30R

A1

29R

A2

28R

A3

27

RA

434

RA

533

RB058

RB157

RB2 56

RB355

RB454

RB553

RB652

RB747

RC

036

RC

135

RC243

RC344

RC445

RC546

RC

637

RC

738

MCLR9

OSC149

OSC250

GND11

VCCcore/Vcap12

VC

C32

RD

072

RD

169

RD

268

RD

367

RD

466

RD

565

RD

664

RD

763

RE04

RE13

RE

278

RE

377

EN

VR

EG

24V

US

B23

RF218

RF3/D-17

RF4/D+16

RF515

RF614 RF713

RG05

RG16

RG27

RG38

RG410

RH

079

RH

180

RH21

RH32

RH

422

RH

521

RH620

RH719

RJ0

62

RJ1

61

RJ260

RJ359

RJ4

39

RJ5

40

RJ641

RJ742

VCC48

VC

C71

GN

D31

GND51

GN

D70

AG

ND

26A

VC

C25

RE

476

RE

575

RE

674

RE

773

U1

PIC18F87J50

VCC-3.3

Vcap

Vcap SCK1-RC3MISO1-RC4

MOSI1-RC5

FLASH-CS#

C37

100nF

R3 56

R4810K

VCC-3.3

CS1

SDO2

WP3

SDI5

GND4

SCK6

HOLD7VCC8

U10

M25P80

VCC-3.3

VCC-3.3

SCK1-RC3

MOSI1-RC5

X1

8MH

z

C2 22pF

C1 22pFCLKOCLKI

R5 56

R4 56

Figure 11-2: Flash memory module connection schematic

Page 36: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 36

MOSI1-RC5

SCK1-RC3MISO1-RC4

RA2

RH6RB0RB1RB2RB3

RA5RF2RF5RF6RH4

RC0RA4

T-D3-RJ3T-D2-RJ2T-D1-RJ1T-D0-RJ0

T-D4-RJ4T-D5-RJ5

1234567891011121314151617181920212223242526

HDR1

M1X26

VCC-3.3

VCC-SYS

E910uF

RG1RG0

RG2

RG4

RC

1R

C0

RX

1-R

C7

TX1-

RC

6

RE

3R

E2

RE

4R

E5

RE

7R

E6

R4 56

R5 56

RA

5R

A4

RA

2

RF2

RF5RF6

RH

4

SC

L2-R

D6

SD

A2-

RD

5

RH6

RE1

T-D

4-R

J4T-

D1-

RJ1

T-D

0-R

J0T-

D5-

RJ5

RG3

RA

3-V

RE

F-1.

8

RA

0/A

N0

30R

A1

29R

A2

28R

A3

27

RA

434

RA

533

RB058

RB157

RB2 56

RB355

RB454

RB553

RB652

RB747

RC

036

RC

135

RC243

RC344

RC445

RC546

RC

637

RC

738

MCLR9

OSC149

OSC250

GND11

VCCcore/Vcap12

VC

C32

RD

072

RD

169

RD

268

RD

367

RD

466

RD

565

RD

664

RD

763

RE04

RE13

RE

278

RE

377

EN

VR

EG

24V

US

B23

RF218

RF3/D-17

RF4/D+16

RF515

RF614 RF713

RG05

RG16

RG27

RG38

RG410

RH

079

RH

180

RH21

RH32

RH

422

RH

521

RH620

RH719

RJ0

62

RJ1

61

RJ260

RJ359

RJ4

39

RJ5

40

RJ641

RJ742

VCC48

VC

C71

GN

D31

GND51

GN

D70

AG

ND

26A

VC

C25

RE

476

RE

575

RE

674

RE

773

U1

PIC18F87J50

VCC-3.3

Vcap

Vcap

PGD1/RB7

PGC1/RB6

MISO1-RC4

RB0RB1RB2RB3

T-D3-RJ3T-D2-RJ2

RE2

RE5RE6

RC1

TX1-RC6RX1-RC7

SCL2-RD6SDA2-RD5

RST

RL

RE3RE4

RE7

RG1RG2

RA3RE1

RB6RB7

RG4

RG0RG3

2728293031323334353637383940414243444546474849505152

HDR2

M1X26

VCC-3.3

MOSI1-RC5

SCK1-RC3

R7 1KRST

12. Pads

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).

Pads HDR2 Pads HDR1Figure 12-1: Connecting pads schematic

Page 37: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 37

13. PinoutVSYS RSTGND GNDRA2 LRA5 RRF2 RC1RF5 RG0RF6 RG3RH4 RG4RH6 RA3RB0 RE1RB1 RE2RB2 RE3RB3 RE4RJ0 RE5RJ1 RE6RJ2 RE7RJ3 RB6RJ4 RB7RJ5 RG2

RC0 RG1RA4 RC7RC3 RC6RC4 RD6RC5 RD5

3.3V 3.3VGND GND

SPI LinesInterrupt LinesAnalog LinesDigital lines I2C Lines UART lines PWM lines

Reset pin5V power supplyReference GroundReference Groundleft ch.right ch.

3.3V power supply3.3V power supplyReference GroundReference Ground

Pin functions Pin functions

audio out

UART

I2CSPI2SCK2SDI2

SDO2

RXTXSCL2SDA2

Analog Lines

Interrupt Lines

PWM lines

Digital I/O lines

Digital I/O lines

Page 38: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 38 Page 39

73.66

81.15

63.5

2.672.54

36.5

8

55.8

8

60.4

5

1.6 63

2.03

3195

29004157

7276

2380

2200

50.2

19

76

2500

1440

105100

80

8.89

350

7.62

300

3.2126

57.62268

69.32728

43.2

17

00

Legend

14. Dimensions

Page 39: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 39

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

01 02 03

Gaming shield

Connect shield BatteryBoost shield PROTO shield

06 07Li-Polymer battery Wire Jumpers05 mikroBUS shield

Page 40: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 40

You still don’t have an appropriate compiler? Locate PIC® compiler that suits you best on our site:

Choose between mikroC™, mikroBasic™ and mikroPascal™ and download fully functional

demo version, so you can begin building your first applications.

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 our site:

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

Projects

http://www.mikroe.com/pic/compilers/

What’s next?

http://www.mikroe.com/visualtft/

Page 41: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 41

Notes:

Page 42: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 42

Notes:

Page 43: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

Page 43

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, the MikroElektronika logo, mikroC™, mikroBasic™, mikroPascal™, mikroProg™, EasyPIC™, EasyPIC PRO™, Visual TFT™, 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 © MikroElektronika, 2013, 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 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.

Page 44: mikromedia...Page 12 Programming with mikroBootloader Figure 3-2: USB HID mikroBootloader window step 1 – Connecting mikromedia 01 01 In order to start, connect the USB cable or

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/support

If you have any questions, comments or business proposals,

do not hesitate to contact us at [email protected] for PIC18FJ Manual

ver. 1.10c

0 100000 024461