21.07.2013 Views

Introduction to Microcontrollers Lab Manual - Microchip

Introduction to Microcontrollers Lab Manual - Microchip

Introduction to Microcontrollers Lab Manual - Microchip

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2.2.3 IDE Concepts Watch Window<br />

It is often necessary <strong>to</strong> be able <strong>to</strong> determine exactly what is happening <strong>to</strong> debug a problem<br />

in the program flow. MPLAB IDE provides a Watch window for this purpose.<br />

There are a large number of registers in the File Register window and Special Function<br />

Register (SFR) windows. However, <strong>to</strong> debug any function, only a small subset of these<br />

are required in order <strong>to</strong> determine the exact program function. To set up a specific list<br />

of registers <strong>to</strong> view, you can use the Watch window. To open the Watch window select<br />

View>Watch.<br />

To add an item <strong>to</strong> the Watch window:<br />

• Choose an SFR or Symbol from the drop-down list and then click the corresponding<br />

Add but<strong>to</strong>n<br />

• Drag an item from the SFR, File Register or File window<br />

• Click directly in the window under symbol name and type in the item<br />

The file register address of the symbols is listed first, followed by the symbol name and<br />

finally the value of the symbol.<br />

For this particular lab, the following registers may be of interest:<br />

• WREG15 (Software Stack Pointer)<br />

• WREG0 (Working Register)<br />

• PORTC (LED1 is bit 2)<br />

• T1CON (Timer1 Control Register if you are using Timer1)<br />

• PR1 (Timer1 Preload Register)<br />

• IEC0 (Interrupt Enable Bits)<br />

• IFS0 (Interrupt Flag Status Bits)<br />

FIGURE 2-3: LAB 2 REGISTERS OF INTEREST<br />

2011 <strong>Microchip</strong> Technology Inc. DS51963A-page 23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!