SW006010 Microchip Technology, SW006010 Datasheet - Page 70

no-image

SW006010

Manufacturer Part Number
SW006010
Description
MPLAB 17C SOFTWARE
Manufacturer
Microchip Technology
Datasheets

Specifications of SW006010

Tool Function
Compiler
Tool Type
Compiler
Processor Series
PIC17C
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
MPLAB®
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
MPLAB
7.5
apRNOVM^-page 64
USING SFRS
C17 C Compiler User’s Guide
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 MPASM™ User's Guide with MPLINK™ and MPLIB™ (DS33014) for more
information on using linker scripts.
source code with the SFR's that are available for that device. For instance, the
following statement includes the header files for the PIC17C756A part:
#include <p17c756a.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 0 bit in the TCON2 register which is the
1 on' bit. It sets the bit named
TCON2bits.TMR1ON = 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 7.1 would use:
p17c756a.lkr
TMR1ON
to
1
which starts the timer.
 2002 Microchip Technology Inc.
Timer

Related parts for SW006010