Explorer 16 Development Board User’s Guide
DS51589A-page 19
©
2005 Microchip Technology Inc.
2.6
PROGRAMMING THE DEVICE
The MPLAB ICD 2 In-Circuit Debugger is used to program and debug the
microcontroller in-circuit on the Explorer 16 Development Board.
2.6.1
Set Up the Device Configuration
The device configuration for the target microcontroller can be set by two methods:
using configuration macros in the source code, or using the Configuration Bits window
in MPLAB IDE.
The PIC24 Explorer 16 tutorial code already includes configuration macros in the
source code itself. It is only necessary to confirm that the following macros are in place
near the top of the
PIC24ExplDemo.c
file:
_CONFIG1(JTAGEN_OFF & GSS0_OFF & GWRP_OFF & BKBUG_OFF & COE_OFF
& FWDTEN_OFF & FNOSC_PRI)
_CONFIG2(FCKSM_CSDCMD & OSCIOFNC_ON & POSCMOD_HS)
For the dsPIC33F tutorial code, confirm that the following macros are in place near the
top of the
main_rtc.c
file:
_FGS(CODE_WRITE_PROT_OFF);
_FOSCSEL(FRC_PLL);
_FOSC(CSW_FSCM_OFF & OSC2_IO & XT);
_FWDT(WDT_OFF);
If configuration macros are not used in the source code, it is also possible to set device
configuration with the Configuration Bits window. For the PIC24 code, the process is as
follows:
1.
From the main window’s menu bar, select
Configure > Configuration Bits to
display the configuration settings (Figure 2-10).
2.
Set the Configuration bits by clicking on a particular line item and selecting an
option from the drop-down menu that appears. The Configuration bits should be
set as shown in Figure 2-10.
The settings that will most likely need to change are:
a) Primary Oscillator Select: HS Oscillator Enabled
b) Oscillator Select: Primary Oscillator (XT, HS, ES)
c)
Clock Switching and Monitor: SW Disabled, Mon Disabled
d) Watchdog Timer Enable: Disable
Note:
Before proceeding, make sure that the USB driver for the MPLAB ICD 2 has
been installed on the PC (see the
MPLAB
®
ICD 2 In-Circuit Debugger
User’s Guide (DS51331) for more details regarding the installation of the
MPLAB ICD 2).
Содержание Explorer 16
Страница 1: ...2005 Microchip Technology Inc DS51589A Explorer 16 Development Board User s Guide...
Страница 4: ...Explorer 16 Development Board User s Guide DS51589A page iv 2005 Microchip Technology Inc NOTES...
Страница 10: ...Preface 2005 Microchip Technology Inc DS51589A page 6 NOTES...
Страница 26: ...Explorer 16 Programming Tutorial 2005 Microchip Technology Inc DS51589A page 22 NOTES...
Страница 36: ...Explorer 16 Development Hardware 2005 Microchip Technology Inc DS51589A page 32 NOTES...
Страница 46: ...Explorer 16 Development Board Schematics 2005 Microchip Technology Inc DS51589A page 42 NOTES...
Страница 51: ...Click below to find more Mipaper at www lcis com tw Mipaper at www lcis com tw...