User manual

Table Of Contents
PICDEM
TM
Lab Development Board User’s Guide
DS41369A-page 20 © 2009 Microchip Technology Inc.
Figure 3-2 shows the software control loop that will be implemented in this lab. At
device power-up, the first functional block called from the main() is Initialize().
This function will initialize the PORTC peripheral as follows:
Clear the PORTC register data
Configure the ANSEL and ANSELH bits so that all associated PORTC pins are
digital
Configure the associated PORTC pins as all output using the TRISC register
The next function called from main() is Do_Outputs(). This function will assign
values to the PORTC register that will drive the associated pins high or low to light the
LEDs connected.
3.3.4.3 PROCEDURE
The following steps will demonstrate how to create a new project in MPLAB
®
IDE. A
more in-depth tutorial is provided in the document “Introduction to MPLAB
®
IDE and
HI-TECH C
®
PRO for the PIC10/12/16 MCU Family Lite Mode Compiler Tutorial”
(DS41322) included on the accompanying CD-ROM.
1. Open MPLAB IDE by selecting Start>Microchip>MPLAB IDE vX.XX>MPLAB
IDE.
2. In the MPLAB IDE toolbar, select Project>Project Wizard....
3. The Welcome dialog box should now be open. Select Next> to proceed.
4. In the Step One: window, select the PIC16F690 from the Device: drop-down
menu and select Next>
to continue. (See Figure 3-3.)
FIGURE 3-3: STEP ONE
5. In the Step Two: window, select the HI TECH Universal ToolSuite from the Active
Toolsuite drop down menu. The window should now resemble Figure 3-4.
Note: The PORT register should always be initialized to a known value before
configuring the associated TRIS bit. This avoids unexpected voltage levels
on the associated pins since at start-up port bit values are unknown.