Datasheet

Page 4
Page 5
Let’s make a simple “Hello worldexample for the selected
microcontroller. First thing embedded programmers
usually write is a simple LED blinking program. So, let’s
do that in a few simple lines of C code.
LED blinking is just turning ON and OFF LEDs that are
connected to desired PORT pins. In order to see the
example in action, it is necessary to connect the target
microcontroller according to schematics shown on Figure
2-1. In the project we are about to write, we will use only
PORTB, so you should connect the LEDs to PORTB only.
Eight LEDs are more then enough for demonstration. You
don’t have to connect all 16 PORTB pins.
Priortocreatinganewproject,itisnecessarytodothefollowing:
Step 1: Install the compiler
Install the mikroC PRO for PIC32® compiler from the Product DVD or
downloaditfromtheMikroElektronikawebsite:
http://www.mikroe.com/eng/products/view/623/mikroc-pro-for-pic32/
Step 2: Start up the compiler
Double click on the compiler icon in the Start menu, or on your desktop
to Start up the mikroC PRO for PIC32® compiler. The mikroC PRO for
PIC32® IDE (Integrated Development Environment) will appear on
the screen. Now you are ready to start creating a new project.
2. Hardware Connection
MCLR#
RB7
RB6
RB0
RB1
RB2
RB3
RB4
RB5
VCC-3.3
Vcap
E9 10uF
VDD
16
RE6
4
RE5
3
RB0
25
RB1
24
RB2
23
RB3
22
RB4
21
RB5
20
RE7
5
RG6/SCK2
10
RG7/SDI2
11
VSS
15
RG9
14
RG8/SDO2
12
MCLR
13
RG15
1
VDD
2
RC1
6
RC2
7
RC3
8
RC4/SDI1
9
RA0/TMS
17
RE8/INT1
18
RE9/INT2
19
RB11
35
AVDD
30
RB9
33
RB8
32
RB13
42
RB12
41
RB15
44
RB14
43
RF4
49
RF5
50
VSS
36
RB6
26
AVSS
31
RB10
34
RB7
27
VDD
37
RA9
28
RA10/VREF+
29
RA1
38
RF13
39
RF12
40
RD14
47
RD15
48
VSS
45
VDD
46
RC14
74
RC13
73
RD0
72
RD11
71
RD10
70
VDD
62
VSS
65
D+/RG2
57
RF3
51
U1RX/RF2
52
VUSB
55
D-/RG3
56
OSC2
64
RD8
68
OSC1
63
RD9
69
VSS
75
RA14
66
RA15
67
RA4
60
RA5
61
SCL2/RA2
58
SDA2/RA3
59
U1TX/RF8
53
VBUS
54
RD2
77
RF0
87
RD7
84
RD6
83
RD5
82
RD4
81
RE4
100
ENVREG
86
Vcap/VDDcore
85
RD1
76
RE0
93
RD3
78
RF1
88
RE1
94
RE2
98
RE3
99
RG13
97
RG12
96
RG14
95
RA7
92
RA6
91
RG0
90
RG1
89
RD13
80
RD12
79
U1
PIC32MX460F512L
RB7
RB6
RB5
RB4
RB2
RB1
RB0
RB3
R1
4K7
R5
4K7
R2
4K7
R6
4K7
R3
4K7
R7
4K7
R4
4K7
R8
4K7
LD0
LED
LD4
LED
LD1
LED
LD5
LED
LD2
LED
LD6
LED
LD3
LED
LD7
LED
Figure 2-1:
Hardware connection schematics