SW006012 Microchip Technology, SW006012 Datasheet - Page 91

C COMPILER FOR DSPIC30F FAMILY

SW006012

Manufacturer Part Number
SW006012
Description
C COMPILER FOR DSPIC30F FAMILY
Manufacturer
Microchip Technology
Type
MPLAB® C30 Compilerr
Series
PIC24 & DsPICr
Datasheets

Specifications of SW006012

Supported Families
PIC24, DsPIC30F And DsPIC33F
Core Architecture
PIC, DsPIC
Kit Contents
Software And Docs
Mcu Supported Families
PIC24 MCUs And DsPIC DSCs
Tool Type
Compiler
Processor Series
PIC24, dsPIC
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
dsPIC30F
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
6.5
© 2007 Microchip Technology Inc.
USING SFRS
There are three steps to follow when using SFR’s in an application.
1. Include the processor header file for the appropriate device. This provides the
2. Access SFR’s like any other C variables. The source code can write to and/or
3. Link with the register definition file or linker script for the appropriate device. The
See “MPLAB
more information on using linker scripts.
The following example is a sample real time clock. It uses several SFR’s. Descriptions
for these SFR’s are found in the p30f6014.h file. This file would be linked with the
device specific linker script which is p30f6014.gld.
source code with the SFR’s that are available for that device. For instance, the
following statement includes the header files for the PIC30F6014 part:
#include <p30f6014.h>
read from the SFR’s.
For example, the following statement clears all the bits to zero in the special
function register for Timer1.
TMR1 = 0;
This next statement represents the 15th bit in the T1CON register which is the
“timer on” bit. It sets the bit named TON to 1 which starts the timer.
T1CONbits.TON = 1;
linker provides the addresses of the SFR’s. (Remember the bit structure will have
the same address as the SFR at link time.) Example 6.1 would use:
p30f6014.gld
®
ASM30, MPLAB
®
LINK30 and Utilities User's Guide” (DS51317) for
Device Support Files
DS51284F-page 85

Related parts for SW006012