PIC32 2008 Microchip Technology Inc. DS61146A_CN
Microchip Microchip Microchip Microchip Microchip Microchip Microchip Microchip Microchip Microchip Microchip Digital Millennium Copyright Act Microchip Microchip Microchip Accuron Microchip Technology Inc. dspic KEELOQ KEELOQ MPLAB PIC PICmicro PICSTART PRO MATE rfpic SmartShunt Microchip Technology Microchip Technology Inc. Inc. FilterLab Linear Active Thermistor MXDEV MXLAB SEEVAL SmartSensor The Embedded Control Solutions Microchip Company Microchip Technology Inc. Analog-for-the-Digital Age Application Maestro Microchip CodeGuard dspicdem dspicdem.net dspicworks Microchip dsspeak ECAN ECONOMONITOR FanSense / In-Circuit Serial Programming ICSP ICEPIC Mindi MiWi MPASM MPLAB Certified MPLIB MPLINK Microchip Microchip mtouch PICkit PICDEM PICDEM.net PICtail PIC 32 PowerCal PowerInfo PowerMate PowerTool REAL ICE rflab Select Mode Total Endurance UNI/O WiperLock ZENA Microchip Technology Inc. SQTP Microchip Technology Inc. 2008, Microchip Technology Inc. Microchip Chandler Tempe Gresham ISO/TS-16949:2002 PIC MCU dspic DSC KEELOQ EEPROM ISO/TS- 16949:2002 Microchip ISO 9001:2000 DS61146A_CN ii 2008 Microchip Technology Inc.
PIC32... 1 1 PIC32 1.1... 7 1.2... 7 2 PIC32 2.1... 9 3 PIC32 3.1... 11 4 PIC32 4.1... 15 4.2... 15 4.3 MPLAB IDE... 15 4.4 MPLAB C32 C... 16 4.5... 17 4.6... 19 4.7... 20 4.8... 20 5 5.1... 21 5.2... 21 5.3 MPLAB IDE... 21 5.4... 22 5.5... 23 5.6... 24 5.7... 25 5.8... 26 5.9... 27 5.10... 31 5.11... 32 5.12... 32 6 6.1... 37...39... 40 2008 Microchip Technology Inc. DS61146A_CN iii
PIC32 DS61146A_CN iv 2008 Microchip Technology Inc.
PIC32 Microchip / www.microchip.com DS DSXXXXXA XXXXX A MPLAB IDE Help Topics PIC32 PIC32 PIC32 PIC32 Microchip C PIC32 Microchip 2008 Microchip Technology Inc. DS61146A_CN 1
PIC32 6 1 4 PIC32 5 PIC32 6 1 PIC32 2 PIC32 3 PIC32 4 PIC32 5 6 DS61146A_CN 2 2008 Microchip Technology Inc.
Arial MPLAB IDE User s Guide...... Output Settings Enable Programmer Save project before build File>Save OK Power N Rnnnn verilog N 4 b0010, 2 hf1 R n < > <Enter> <F1> Courier New Courier New #define START autoexec.bat c:\mcc18\h _asm, _endasm, static -Opa+, -Opa- 0, 1 0xFF, A Courier New file.o [ ] mcc18 [options] file [options] { } errorlevel {0 1}... var_name [, var_name...] void main (void) {... } 2008 Microchip Technology Inc. DS61146A_CN 3
PIC32 MICROCHIP PIC32 Microchip PIC32MX Readme PIC32 PIC32.txt ASCII PIC32 CD PIC32MX Readmes Microchip www.microchip.com FAQ Microchip Microchip Microchip Microchip DS61146A_CN 4 2008 Microchip Technology Inc.
Microchip Microchip Microchip www.microchip.com Customer Change Notification Microchip C MPLAB C18 MPLAB C32 C MPLAB LIB30 Microchip MPLAB ICE 2000 MPLAB ICE 4000 Microchip MPLAB ICD 2 MPLAB IDE Windows Microchip MPLAB IDE MPLAB IDE MPLAB SIM MPLAB IDE Microchip MPLAB PM3 PRO MATE II PICSTAR Plus PICkit 1 PICkit 2 Microchip FAE FAE http://support.microchip.com A 2007 10 2008 Microchip Technology Inc. DS61146A_CN 5
PIC32 DS61146A_CN 6 2008 Microchip Technology Inc.
PIC32 1 PIC32 1.1 PIC32 Microchip Technology 32 80+ DMIPS MIPS Technologies, Inc M4K MIPS32 PIC32 Microchip PIC PIC32 16 PIC24FJ128GA 1.2 PIC32 5 72 MHz MIPS M4K 32 128 ROM 64 CRC DMA 2.5 3.6V DMA I/O 5 M4K CPU MIPS32 64 KB 512 KB 64/100 16 PIC24FJXXXGA 2008 Microchip Technology Inc. DS61146A_CN 7
PIC32 PIC MPLAB MPLAB IDE MPLAB C32 C MPLAB REAL ICE MPLAB ICD 2 Microchip 16 Microchip TCP/IP FAT16 DS61146A_CN 8 2008 Microchip Technology Inc.
2 PIC32 PIC32 2.1 PIC32 32 KB 512 KB 16 10 A/D SPI I 2 C UART PIC32MX Family Data Sheet DS61143A 2-1 PIC32 MCU 4-W JTAG Debug Boundary Scan 5-W Trace 2-W MCHP Debug Ext INTs (5) Change Notice (21) VREG RTCC Vectored Interrupts CPU Bus Matrix C a c h e RAM 128-bit Flash WDT, BOR. CVRef DMAC + CRC OD /GPIO (85) ADC (16ch, 10b) Enh. PMP SPI (2) I2C (2) EUART (2) TMR (5) IC (5) OCOMP /PWM (5) Analog Comp. (2) 2008 Microchip Technology Inc. DS61146A_CN 9
PIC32 DS61146A_CN 10 2008 Microchip Technology Inc.
PIC32 3 PIC32 3.1 PIC32 MCU MIPS M4K RAM 3-1 PIC32 OSC2/CLKO OSC1/CLKI OSC/SOSC FRC/LPRC PLL ENVREG SYSCLK PBCLK VDDCORE/VCAP (2) (3) VDD, VSS MCLR SYSCLK CN1-22 (1) PORTA (1)(4) PORTB PORTC (1) PORTD (1) 32 JTAG BSCAN EJTAG MIPS M4K CPU IS INT DS 32 32 DMAC (2) ICD 32 32 32 PBCLK PWM OC 1,5 IC 1,5 SPI 1,2 (1) 32 32 32 I2C 1,2 PORTE (1) (2) RAM 32 PMP (1) PORTF (1) PORTG (1) 128 128 UART 1,2 PBCLK Timer1 Timer2 Timer3 Timer4 Timer5 RTCC 10 ADC 1 2 3 BOR 4 PORTA 64 2008 Microchip Technology Inc. DS61146A_CN 11
PIC32 5 MIPS M4K MIPS32 2 MIPS16e 40% GPR - 32 x 16-32 x 32 0 MHz 2.5 3.6 V 4 GB Fixed Memory Mapping Translation FMT 16 128 SW 95 IRQ DMA 4 IRQ CRC 8 16 16 GPIO 2 2 IrDA UART 2 SPI 2 I 2 C 10/7 DS61146A_CN 12 2008 Microchip Technology Inc.
PIC32 16 10 ADC 400000 400 ksps 16 CPU 5 16 32 CPU CPU 32 RTCC 260 ppm 6 2 2 4 EJTAG 2 Microchip 2 Microchip - 6 - CPU RAM SFR - 5 - GPIO 5 V 2008 Microchip Technology Inc. DS61146A_CN 13
PIC32 DS61146A_CN 14 2008 Microchip Technology Inc.
PIC32 4 PIC32 4.1 4.2 PIC32 MPLAB MPLAB IDE MPLAB C32 C 4.3 MPLAB IDE Microchip MPLAB IDE Microsoft Windows - - - - MPLAB IDE MPLAB ICD 2 MPLAB REAL ICE FS2 JTAG First Silicon Solutions 4 EJTAG PIC32 MPLAB PM3 Microchip MPLAB SIM32 PIC32 CPU 2008 Microchip Technology Inc. DS61146A_CN 15
PIC32 4.4 MPLAB C32 C MPLAB C32 C 4-1 PIC32-gcc ANSI C MPLAB IDE PIC32-gpp PIC32-as PIC32-ld PIC32-ar PIC32-conv ELF ASCII PROM 4-1 MPLAB IDE MPLAB IDE MPLAB IDE PIC32-gcc MPLAB IDE PIC32-cpp MPLAB IDE MPLAB IDE MPLAB IDE PIC32-ar PIC32-ld PIC32-as MPLAB IDE PIC32-conv MPLAB IDE MPLAB IDE MPLAB ICD 2 MPLAB REAL ICE DS61146A_CN 16 2008 Microchip Technology Inc.
PIC32 4.5 PIC32 MCU PIC32 MPLAB C32 16 Microchip MCU API MPLAB C32 MPLAB C32 C:\Program Files \Microchip\MPLAB C32\pic32mx \include\peripheral C:\Program Files\Microchip\MPLAB C32\pic32-libs\peripheral 2008 Microchip Technology Inc. DS61146A_CN 17
PIC32 4-1 ADC adc10.h bmx.h cmp.h cvref.h DMA dma.h DMA CRC nvm.h I 2 C i2c.h I 2 C incap.h int.h lock.h outcompare.h osc.h pcache.h power.h pmp.h GPIO ports.h I/O I/O reset.h RTCC rtcc.h SYSTEM system.h SPI spi.h timer.h 16 32 UART uart.h UART wdt.h DS61146A_CN 18 2008 Microchip Technology Inc.
PIC32 4.6 Microchip Microchip 4.6.1 Microchip SD FAT16 Microsoft MS-DOS TCP/IP 1 Microchip TCP/IP Microchip 8 16 2 Microchip BSD TCP/IP Berkeley API TCP/IP - FTP PIC32 - SNMP SNMP PIC32 - Web HTTP 4.6.2 PIC32 www.microchip.com/pic32 2008 Microchip Technology Inc. DS61146A_CN 19
PIC32 4.7 4.8 PIC32 MCU LED RS-232 LCD 1. PIC32MX 2. PIC32 Explorer 16 PIC32 MCU - AN833 Microchip TCP/IP DS00833B_CN - AN1107 HTTP Server for the Microchip BSD TCP/IP StackDS01107A - AN1108 Microchip TCP/IP Stack with BSD Socket APIDS01108A - AN1109 An SNMP Agent for the Microchip TCP/IP Stack DS01109A - AN1111 The Microchip FTP Server Using BSD Socket API DS01111A - DS61143A PIC32MX Family Data Sheet - DS61132A PIC32MX Family Reference Manual - PIC32 DS61146A_CN 20 2008 Microchip Technology Inc.
PIC32 5 5.1 5.2 MPLAB MPLAB IDE MPLAB IDE MPLAB IDE www.microchip.com/ide MPLAB IDE 5.3 MPLAB IDE 5.3.1 MPLAB IDE MPLAB Microchip MPLAB IDE - CD-ROM Windows CD-ROM menu.exe - MPLAB IDE Microchip MPLAB 5.3.2 MPLAB IDE - > > - MPLAB IDE - MPLAB 2008 Microchip Technology Inc. DS61146A_CN 21
PIC32 5.3.3 MPLAB IDE MPLAB IDE > >Microchip> MPLAB IDE vx.xx>mplab IDE MPLAB MPLAB IDE 5-1 MPLAB IDE 5.4 PIC32 MCU MPLAB IDE - MPLAB IDE - MPLAB IDE Project Wizard - Project Wizard PIC32 Microchip - - DS61146A_CN 22 2008 Microchip Technology Inc.
5.5 Hello World Microchip UART - PIC32 MCU - MPLAB IDE IDE Configure>Select Device Select Device PIC32 5-2 MPLAB IDE SELECT DEVICE MPLAB IDE - - MPLAB IDE - 2008 Microchip Technology Inc. DS61146A_CN 23
PIC32 5.6 Project Wizard C Project>Project Wizard Welcome Next> Step One PIC32 PIC32 Next> 5-3 MPLAB IDE DS61146A_CN 24 2008 Microchip Technology Inc.
5.7 Project Wizard Show all installed toolsuites Active Toolsuite Microchip PIC32 C Compiler Toolsuite Microchip PIC32 C Toolsuite Contents MPLAB PIC32 Assembler (PIC32-as.exe) MPLAB PIC32 C Compiler (PIC32-gcc.exe) MPLAB PIC32 Object Linker (PIC32-ld.exe)MPLAB PIC32 Archiver (PIC32-ar.exe) MPLAB IDE MPLAB PIC32 - C:\Program Files\Microchip\MPLAB IDE\ MPLAB C32\bin \PIC32-as.exe MPLAB PIC32 - C:\Program Files\Microchip\MPLAB IDE\ MPLAB C32\bin\ PIC32-gcc.exe MPLAB PIC32 - C:\Program Files\Microchip\MPLAB IDE\ MPLAB C32\bin \PIC32-ld.exe MPLAB PIC32 - C:\Program Files\Microchip\MPLAB IDE\ MPLAB C32\bin \PIC32-ar.exe Browse MPLAB IDE Next> 5-4 MPLAB IDE 2008 Microchip Technology Inc. DS61146A_CN 25
PIC32 5.8 MyTestProject Browse Projects32 Next> 5-5 MPLAB IDE DS61146A_CN 26 2008 Microchip Technology Inc.
5.9 Project Wizard Next> Summary 5-6 MPLAB IDE SUMMARY Finish 5-7 MPLAB IDE 2008 Microchip Technology Inc. DS61146A_CN 27
PIC32 Projects32 MyTestProject Save 5-8 MPLAB IDE C MPLAB IDE File->New New File Hello World Projects32 main.c Microchip UART DS61146A_CN 28 2008 Microchip Technology Inc.
5-9 MPLAB IDE MAIN.C main.c MPLAB IDE MyTestProject.mcp Source Files Add File Projects32 main.c IDE View->Project MPLAB IDE 2008 Microchip Technology Inc. DS61146A_CN 29
PIC32 MyTestProject.mcp Save MyTestProject.mcp 5-10 MPLAB IDE DS61146A_CN 30 2008 Microchip Technology Inc.
5.10 PIC32 PIC32MX DS61144B_CN Explorer 16 DM240001 MPLAB REAL ICE DV244005 PIC32MX360F512L PIM MA320001 9V USB REAL ICE 5-11 EXPLORER 16 MPLAB REAL ICE PIC32MX360F512L PIM REAL ICE Explorer 16 1. USB MPLAB REAL ICE PC 2. RJ-11 MPLAB REAL ICE Explorer 16 3. Explorer 16 4. MPLAB IDE Debugger Select Tool > MPLAB REAL ICE MPLAB REAL ICE 5. Debugger Connect MPLAB IDE Output PIC32MX360F512L MPLAB REAL ICE PIC32 MPLAB IDE MPLAB IDE MPLAB IDE Debugger->Select Tool MPLAB REAL ICE Debug MPLAB IDE Build Configuration MPLAB IDE Debug 2008 Microchip Technology Inc. DS61146A_CN 31
PIC32 5.11 Project - Project>Build All - Build All - Project Build All Output 5-12 MPLAB IDE 5.12 Debugger Debugger->Program Debug hex PC RS-232 PC COM PC -> -> -> OK COM DS61146A_CN 32 2008 Microchip Technology Inc.
5-13 OK 57600 8 1 OK MPLAB IDE return nc; MPLAB IDE main.c strlen() Debugger->Run Debug Run MPLAB IDE 2008 Microchip Technology Inc. DS61146A_CN 33
PIC32 5-14 MPLAB IDE 4 6 3 5 8 1 2 7 1. 2. 3. Debugger 4. Debug 5. Source 6. Disassembly 7. Output 8. Program Memory PC 5-15 DS61146A_CN 34 2008 Microchip Technology Inc.
Explorer 16 LED D9 PIC32 Explorer16 MPLAB IDE PIC32 Hello World MPLAB IDE nc putsuart2() MPLAB IDE Watch SFR Watch step into step over C disassembly listing MPLAB IDE PIC32 PIC32 MPLAB IDE PIC32 MPLAB IDE www.microchip.com MPLAB IDE DS51281G_CN 2008 Microchip Technology Inc. DS61146A_CN 35
PIC32 DS61146A_CN 36 2008 Microchip Technology Inc.
6 PIC32 6.1 Support.microchip.com 2008 Microchip Technology Inc. DS61146A_CN 37
PIC32 DS61146A_CN 38 2008 Microchip Technology Inc.
PIC32 A MPLAB... 21 B I Internet K L... 5... 4... 5 MPLAB REAL ICE... 31 M... 4 Microchip MPLAB C32 C PIC32-ar PIC32-as PIC32-conv PIC32-gcc PIC32-gpp PIC32-ld... 16... 16 ELF... 16... 16... 16... 16 MPLAB IDE First Silicon Solutions... 15 MPLAB IDE MyTestProject.mcp... 29 MPLAB IDE... 21 P MPLAB IDE... 21 MPLAB IDE... 21 MPLAB IDE... 22 PIC32 MPLAB PIC32 MPLAB C32 C T... 8... 16 MPLAB ICD 2... 15 MPLAB PM3... 15 MPLAB REAL ICE... 15 MPLAB SIM32 MPLAB W WWW Z... 15... 15... 4... 4... 2... 3... 22... 4 2008 Microchip Technology Inc. DS61146A_CN 39
Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 1-480-792-7200 Fax: 1-480-792-7277 http://support.microchip.com www.microchip.com Atlanta Duluth, GA Tel: 678-957-9614 Fax: 678-957-1455 Boston Westborough, MA Tel: 1-774-760-0087 Fax: 1-774-760-0088 Chicago Itasca, IL Tel: 1-630-285-0071 Fax: 1-630-285-0075 Dallas Addison, TX Tel: 1-972-818-7423 Fax: 1-972-818-2924 Detroit Farmington Hills, MI Tel: 1-248-538-2250 Fax: 1-248-538-2260 Kokomo Kokomo, IN Tel: 1-765-864-8360 Fax: 1-765-864-8387 Los Angeles Mission Viejo, CA Tel: 1-949-462-9523 Fax: 1-949-462-9608 Santa Clara Santa Clara, CA Tel: 408-961-6444 Fax: 408-961-6445 Toronto Mississauga, Ontario, Canada Tel: 1-905-673-0699 Fax: 1-905-673-6509 Asia Pacific Office Australia - Sydney Suites 3707-14, 37th Floor Tel: 61-2-9868-6733 Tower 6, The Gateway Fax: 61-2-9868-6755 Harbour City, Kowloon India - Bangalore Hong Kong Tel: 91-80-4182-8400 Tel: 852-2401-1200 Fax: 91-80-4182-8422 Fax: 852-2401-3431 India - New Delhi - Tel: 91-11-4160-8631 Tel: 86-10-8528-2100 Fax: 91-11-4160-8632 Fax: 86-10-8528-2104 India - Pune - Tel: 91-20-2566-1512 Tel: 86-28-8665-5511 Fax: 91-20-2566-1513 Fax: 86-28-8665-7889 Japan - Yokohama - Tel: 81-45-471-6166 Tel: 852-2401-1200 Fax: 81-45-471-6122 Fax: 852-2401-3431 - Tel: 86-25-8473-2460 Fax: 86-25-8473-2470 - Tel: 86-532-8502-7355 Fax: 86-532-8502-7205 - Tel: 86-21-5407-5533 Fax: 86-21-5407-5066 - Tel: 86-24-2334-2829 Fax: 86-24-2334-2393 - Tel: 86-755-8203-2660 Fax: 86-755-8203-1760 - Tel: 86-27-5980-5300 Fax: 86-27-5980-5118 - Tel: 86-592-238-8138 Fax: 86-592-238-8130 - Tel: 86-29-8833-7252 Fax: 86-29-8833-7256 - Tel: 86-756-321-0040 Fax: 86-756-321-0049 - Tel: 886-7-536-4818 Fax: 886-7-536-4803 - Tel: 886-2-2500-6610 Fax: 886-2-2508-0102 - Tel: 886-3-572-9526 Fax: 886-3-572-6459 Korea - Daegu Tel: 82-53-744-4301 Fax: 82-53-744-4302 Korea - Seoul Tel: 82-2-554-7200 Fax: 82-2-558-5932 82-2-558-5934 Malaysia - Kuala Lumpur Tel: 60-3-6201-9857 Fax: 60-3-6201-9859 Malaysia - Penang Tel: 60-4-227-8870 Fax: 60-4-227-4068 Philippines - Manila Tel: 63-2-634-9065 Fax: 63-2-634-9069 Singapore Tel: 65-6334-8870 Fax: 65-6334-8850 Thailand - Bangkok Tel: 66-2-694-1351 Fax: 66-2-694-1350 Austria - Wels Tel: 43-7242-2244-39 Fax: 43-7242-2244-393 Denmark-Copenhagen Tel: 45-4450-2828 Fax: 45-4485-2829 France - Paris Tel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79 Germany - Munich Tel: 49-89-627-144-0 Fax: 49-89-627-144-44 Italy - Milan Tel: 39-0331-742611 Fax: 39-0331-466781 Netherlands - Drunen Tel: 31-416-690399 Fax: 31-416-690340 Spain - Madrid Tel: 34-91-708-08-90 Fax: 34-91-708-08-91 UK - Wokingham Tel: 44-118-921-5869 Fax: 44-118-921-5820 01/02/08 DS61146A_CN 40 2008 Microchip Technology Inc.