Integrated Development Environment Using MPLAB REAL ICE In-Circuit...

1
Reserved Resources See the MPLAB REAL ICE in-circuit emulator online help for information on reserved resources used by the emulator. DS50001997B www.microchip.com Native Trace Connections Native trace is built-in for many devices and is available once the Standard or High-Speed target connections are made. For more on device support for this and other forms of trace, see the MPLAB REAL ICE in-circuit emulator online help file, “Device and Feature Support.” The Microchip name and logo, the Microchip logo, MPLAB, and PIC are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. The MPLAB Certified logo and REAL ICE are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. © 2011-2014 Microchip Technology Incorporated. Printed in the U.S.A. All Rights Reserved. 9/14 Connect to Target Device 4 Create, Build and Run Project 1. Select and install the language tools (compiler, assembler, etc.) for developing your code. See the www.microchip.com web site for more choices. 2. Use the New Project wizard (File>New Project) to create a project, or open an existing project (File>Open Project). 3. Configure the emulator by right clicking on the main project and selecting “Properties.” Click on “Real ICE” for options. 4. Configure your language tools in the Properties dialog by clicking the language tool name for options. Click OK when done. 5. Check that the configuration bits in your code match the Recommended Settings listed below. 6. To execute your code in Debug mode, perform a debug run (Debug>Debug Project). A debug run will build the project, program the target with the image and debug executive, and start a debug session. OR To execute your code in Non-Debug (release) mode, perform a run (Run>Run Project). A run will build the project, program the target with the image and run the device. To hold a device in Reset after programming, use the Hold in Reset icon in the toolbar instead of using Run Project. 5 Note: If switching to high-speed/LVDS communications, remove USB power first. 1. Attach the emulator to the target as shown on the right. 2. Connect power to the target board. Circuitry and Connector Pinouts Target Connector Pinouts Modular Connector Pin Microcontroller Pin 1 MCLR/VPP 2 VDD 3 Ground 4 PGD (ICSPDAT) 5 PGC (ICSPCLK) 6 Do not connect* 2 1 5 4 3 Target VDD (tVDD) 50 kΩ Typical Target Application PC Board VDD VPP /MCLR PGC PGD VSS AVDD ** AVSS ** XTAL* tVDD 4.7 kΩ tVDD tVDD 4.7 kΩ tVDD tVDD MPLAB REAL ICE Internal Circuitry (simplified) VPP Standard Connection at Target Bottom View of Target Board 2 4 6 1 3 5 Top View of Target Board *Used for optional SPI/UART trace capability. 1 2 3 4 5 6 7 - DAT* 8 - CLK* J1 High-Speed Connection at Target Correct *Target device must be running with an oscillator for the emulator to function as a debugger. **If the device has AVDD and AVSS lines, they must be connected for the emulator to operate. • Do not use capacitors on MCLR: they will prevent fast transitions of VPP. Do not use pull-ups on PGC/PGD: they will divide the voltage levels since these lines have 4.7 kpull-down resistors in MPLAB REAL ICE. Do not use multiplexing on PGC/PGD: they are dedicated for communications to MPLAB REAL ICE. Do not use capacitors on PGC/PGD: they will prevent fast transitions on data and clock lines during programming and debug communications. Do not use diodes on PGC/PGD: they will prevent bidirectional communication between MPLAB REAL ICE and the target PIC®MCU. Do not exceed recommended cable lengths: refer to the Hardware Specification section of the MPLAB REAL ICE online help or user’s guide for acceptable cable lengths. Target Circuit Design Precautions 2 1 5 4 3 Target VDD (tVDD) VDD VPP /MCLR PGC PGD VSS AVDD ** AVSS ** XTAL* Incorrect Target Application PC Board Target VDD (tVDD) is used to power the Input/Output drivers in the MPLAB REAL ICE in-circuit emulator Target Application Device Target Application Device Configure USB Communications Use the supplied loopback test board to verify that the emulator is functioning properly: 1. Disconnect the emulator from the computer . 2. Plug the standard driver board into the emulator pod. 3. Plug the loopback test board into the pod’s logic probe connector. 4. Connect the loopback test board to the standard driver board using the modular cable. Reconnect the emulator to the computer . 5. Launch MPLAB X IDE. Ensure that all existing projects are closed. 6. Select Debug>Run Debugger/Programmer Self Test, then, select the specific “REAL ICE” you want to test and click OK. 7 Ensure the loopback test board and cable are connected and click Yes to continue. 8. View the self test results in the emulator’s Output window. 9. After the emulator passes the self test, disconnect the loopback test board from the emulator. Use the Loopback Test Board 1 2 3 Driver Board Slot Install the Latest Software When you install MPLAB X IDE on a Mac or Linux computer, the installer will automatically load the USB drivers. When you install MPLAB X IDE on a Windows®computer, you must follow the instructions on the Start Page, “MPLAB IDE v8 Users - Important,” to correctly install the USB drivers. Install the MPLAB®X IDE software on your computer by downloading it from www.microchip.com/mplabx. Launch the application. Standard Driver Board Modular Cable Loopback Test Board Logic Probe Connector Emulator Pod ADDITIONAL INFORMATION Optional Trace Connections Application PC Board Device SPI SDO (serial data output) SCK (serial clock) 1-6 7 DAT 8 CLK High Speed/ LVDS Connector SPI Trace ACTIVE STATUS REAL ICE I n - C i r c u i t MPLAB ® FUNCTION RESET 5 Logic Probes (use EXT0:7) I/O Port Trace ACTIVE STATUS REAL ICE I n - C i r c u i t MPLAB ® FUNCTION RESET 7 Device PORTx Application PC Board 10kΩ 7 6:0 PIC32MX Instruction Trace Trace Adapter ACTIVE STATUS REAL ICE I n - C i r c u i t MPLAB ® FUNCTION RESET Trace Cable Application PC Board 5 5 TRD3:0 TRCLK Device PIM *Reserved for future use. Using MPLAB REAL ICE In-Circuit Emulator Integrated Development Environment Recommended Settings COMPONENT SETTING Note: See MPLAB REAL ICE in-circuit emulator online help for more information. Oscillator • OSC bits set properly • Running Power Supplied by target WDT Disabled (device dependent) Code-Protect Disabled Table Read Protect Disabled LVP Disabled BOD VDD>BOD VDD min JTAG Disabled AVDD and AVSS Must be connected PGCx/PGDx Proper channel selected, if applicable Programming VDD voltage levels meet programming spec Standard Emulator System – Device with Target Board Target Device or PIM USB Standard Driver Board ACTIVE STATUS REAL ICE In-Circuit r MPLAB ® FUNCTION RESET Power On-Board ICE Circuitry High-Speed Emulator System – Device with On-Board ICE Circuitry USB High-Speed Driver Board High-Speed Receiver Board ACTIVE STATUS REAL ICE In-Circuit r MPLAB ® FUNCTION RESET Power J2 J3 Performance Pak Target Board Target Device or PIM J3 J2 Standard Emulator System – ICE Device USB Standard Driver Board Standard Adapter ACTIVE STATUS REAL ICE In-Circuit r MPLAB ® FUNCTION RESET Device-ICE Header Processor Pak Target Board Transition Socket Power High-Speed Emulator System – ICE Device High-Speed Header/Receiver Board USB High-Speed Driver Board ACTIVE STATUS REAL ICE In-Circuit r MPLAB ® FUNCTION RESET J3 J2 J2 J3 Device-ICE Target Board Transition Socket Power

Transcript of Integrated Development Environment Using MPLAB REAL ICE In-Circuit...

Page 1: Integrated Development Environment Using MPLAB REAL ICE In-Circuit Emulatorww1.microchip.com/downloads/en/DeviceDoc/50001997B.pdf · 2014-09-18 · Reserved Resources See the MPLAB

Reserved ResourcesSee the MPLAB REAL ICE in-circuit emulator online help for information on

reserved resources used by the emulator.

DS50001997Bwww.microchip.com

Native Trace ConnectionsNative trace is built-in for many devices and is availableonce the Standard or High-Speed target connectionsare made. For more on device support for this andother forms of trace, see the MPLAB REAL ICE in-circuitemulator online help file, “Device and Feature Support.”

The Microchip name and logo, the Microchip logo, MPLAB, and PIC are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. The MPLAB Certified logo and REAL ICE are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.© 2011-2014 Microchip Technology Incorporated. Printed in the U.S.A. All Rights Reserved. 9/14

Connect to Target Device4

Create, Build and Run Project1. Select and install the language tools (compiler, assembler, etc.) for developing your code. See the www.microchip.com web site for more choices.2. Use the New Project wizard (File>New Project) to create a project, or open an existing project (File>Open Project).3. Configure the emulator by right clicking on the main project and selecting “Properties.” Click on “Real ICE” for options.4. Configure your language tools in the Properties dialog by clicking the language tool name for options. Click OK when done.5. Check that the configuration bits in your code match the Recommended Settings listed below.6. To execute your code in Debug mode, perform a debug run (Debug>Debug Project). A debug run will build the project, program the target with the image and debug executive, and start a debug session. OR To execute your code in Non-Debug (release) mode, perform a run (Run>Run Project). A run will build the project, program the target with the image and run the device. To hold a device in Reset after programming, use the Hold in Reset icon in the toolbar instead of using Run Project.

5

Note: If switching to high-speed/LVDS communications, remove USB power first.1. Attach the emulator to the target as shown on the right.2. Connect power to the target board.

Circuitry and Connector Pinouts Target Connector PinoutsModular Connector Pin Microcontroller Pin

1 MCLR/VPP

2 VDD

3 Ground4 PGD (ICSPDAT)5 PGC (ICSPCLK)6 Do not connect*

21543

Target VDD (tVDD)

50 kΩTypical

Target Application PC Board

VDD

VPP/MCLR

PGCPGD

VSS

AVDD **

AVSS**

XTAL*tVDD

4.7 kΩ

tVDD

tVDD

4.7 kΩ

tVDD

tVDD

MPLAB REAL ICEInternal Circuitry (simplified)

VPP

Standard Connectionat Target

Bottom Viewof Target Board

2 4 6

1 3 5

Top Viewof TargetBoard

*Used for optional SPI/UARTtrace capability.

1234567 - DAT*8 - CLK*

J1

High-Speed Connectionat Target

Correct

*Target device must be running with an oscillator for the emulator to function as a debugger.**If the device has AVDD and AVSS lines, they must be connected for the emulator to operate.

• Do not use capacitors on MCLR: they will prevent fast transitions of VPP.

• Do not use pull-ups on PGC/PGD: they will divide the voltage levels since these lines have 4.7 kΩ pull-down resistors in MPLAB REAL ICE.

• Do not use multiplexing on PGC/PGD: they are dedicated for communications to MPLAB REAL ICE.

• Do not use capacitors on PGC/PGD: they will prevent fast transitions on data and clock lines during programming and debug communications.

• Do not use diodes on PGC/PGD: they will prevent bidirectional communication between MPLAB REAL ICE and the target PIC®MCU.

• Do not exceed recommended cable lengths:refer to the Hardware Specification section of the MPLAB REAL ICE online help or user’s guide for acceptable cable lengths.

Target Circuit Design Precautions

21543

Target VDD (tVDD)

VDD

VPP/MCLR

PGCPGD

VSS

AVDD **

AVSS**

XTAL*

Incorrect

Target Application PC Board

Target VDD

(tVDD) is usedto power theInput/Outputdrivers inthe MPLABREAL ICEin-circuitemulator

Targ

etA

pplic

atio

nD

evic

e

Targ

etA

pplic

atio

nD

evic

e

Configure USB Communications

Use the supplied loopback test board to verify that the emulator is functioning properly: 1. Disconnect the emulator from the computer. 2. Plug the standard driver board into the emulator pod. 3. Plug the loopback test board into the pod’s logic probe connector. 4. Connect the loopback test board to the standard driver board using the modular cable. Reconnect the emulator to the computer. 5. Launch MPLAB X IDE. Ensure that all existing projects are closed. 6. Select Debug>Run Debugger/Programmer Self Test, then, select the specific “REAL ICE” you want to test and click OK. 7 Ensure the loopback test board and cable are connected and click Yes to continue. 8. View the self test results in the emulator’s Output window. 9. After the emulator passes the self test, disconnect the loopback test board from the emulator.

Use the Loopback Test Board

1

2

3Driver Board Slot

Install the Latest Software

When you install MPLAB X IDE on a Mac or Linux computer, the installer will automatically load the USB drivers. When you install MPLAB X IDE on a Windows®computer, you must follow the instructions on the Start Page, “MPLAB IDE v8 Users - Important,” to correctly install the USB drivers.

Install the MPLAB®X IDE software on your computer by downloading it from www.microchip.com/mplabx. Launch the application.

Standard Driver BoardModular Cable

Loopback Test BoardLogic Probe Connector

Emulator Pod

ADDITIONAL INFORMATION Optional Trace ConnectionsApplication PC Board

DeviceSPI

SDO (serial data output)SCK (serial clock)

1-6

7 DAT8 CLK

High Speed/LVDSConnector

SPI Trace

AC

TIV

E

STA

TU

S

RE

AL

ICE

In- C

ir cu i

t

MP

LA

B® F

UN

CT

ION

RE

SE

T

5

LogicProbes(use EXT0:7)

I/O Port Trace

AC

TIV

E

STA

TU

S

RE

AL

ICE

In- C

i r cu i

t

MP

LA

B® F

UN

CT

ION

RE

SE

T

7

Device

PORTx

Application PC Board

10kΩ

76:0

PIC32MX Instruction Trace

TraceAdapter

AC

TIV

E

STA

TU

S

RE

AL

ICE

In- C

ir cu i

t

MP

LA

B® F

UN

CT

ION

RE

SE

T

Trace Cable

Application PC Board

5

5 TRD3:0TRCLK

Device

PIM

*Reserved for future use.

Using MPLAB REAL ICE In-Circuit Emulator™

Integrated Development Environment

Recommended SettingsCOMPONENT SETTING

Note: See MPLAB REAL ICE in-circuit emulator online help for more information.

Oscillator • OSC bits set properly • RunningPower Supplied by targetWDT Disabled (device dependent)Code-Protect DisabledTable Read Protect DisabledLVP DisabledBOD VDD>BOD VDD minJTAG DisabledAVDD and AVSS Must be connectedPGCx/PGDx Proper channel selected, if applicableProgramming VDD voltage levels meet programming spec

Standard Emulator System – Device with

Target Board

Target Deviceor PIM

USB

Standard DriverBoard

ACTIVE

STATUS

REAL ICE ™

In-Circuit

r

MPLAB®

FUNCTION RESET

Power

On-Board ICE CircuitryHigh-Speed Emulator System – Device with

On-Board ICE Circuitry

USB

High-SpeedDriver Board

High-SpeedReceiver Board

ACTIVE

STATUS

REAL ICE ™

In-Circuit

r

MPLAB®

FUNCTION RESET

Power

J2 J3

Performance Pak

Target Board

Target Deviceor PIM

J3J2

Standard Emulator System – ICE Device

USB

Standard DriverBoard

StandardAdapter

ACTIVE

STATUS

REAL ICE ™

In-Circuit

r

MPLAB®

FUNCTION RESET

Device-ICE

Header

Processor Pak

Target Board

Transition Socket

Power

High-Speed Emulator System – ICE Device

High-SpeedHeader/Receiver Board

USB

High-SpeedDriver Board

ACTIVE

STATUS

REAL ICE ™

In-Circuit

r

MPLAB®

FUNCTION RESET

J3J2

J2 J3

Device-ICE

Target Board

Transition Socket

Power