打印

PIC新手请教

[复制链接]
4374|12
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
cb0035071|  楼主 | 2010-11-29 13:04 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
各位高手:
刚接触PIC,有一点不明白,我用的DISPIC30F系列单片机,.h和.gld文件是怎么把特殊功能寄存器映射到相应的地址的,比如我在.h文件中只看到PORTB=0x02c8,他是怎么知道这个就是地址呢?
沙发
yewuyi| | 2010-11-29 17:03 | 只看该作者
PORTB=0x02c8
--------------------------

这是向PORTB赋值0x02c8,而不是对PORTB寻址,一般对PORTB进行绝对地址定义会使用取地址符号@,你可以在H文件中去找。

使用特权

评论回复
板凳
cb0035071|  楼主 | 2010-11-29 22:12 | 只看该作者
找了,没找到啊.所以迷惑啊

使用特权

评论回复
地板
yewuyi| | 2010-11-29 22:32 | 只看该作者
看看include目录下有没有对应型号MCU的H文件,打开这个文件应该可以找到。

使用特权

评论回复
5
cb0035071|  楼主 | 2010-11-30 15:30 | 只看该作者
只找到PORTB=0x02c8,没有找到怎么把它定义为地址的

使用特权

评论回复
6
cb0035071|  楼主 | 2010-11-30 15:31 | 只看该作者
值找到PORTB=0x02c8这条语句,没找到怎么把它定义成地址的

使用特权

评论回复
7
cb0035071|  楼主 | 2010-11-30 15:34 | 只看该作者
没看到怎么把PORTB=0x02c8,定义成地址的啊?哪位知道那句是呢?

使用特权

评论回复
8
XIEYUANBIN| | 2010-12-1 09:24 | 只看该作者
不知道你用什么编译器?一般情况下,中低档的用PICC,HI_TECH 公司的。
你到C:\PROGRAMFILES\HI_TECH\PICC\9.x\INCLUDE 文件夹下找找你对应芯片型号的PIC*****.H文件,可以找到类似于这样的语句:
volatile unsigned char        PORTE        @ 0x09;
这个就是定义PORTE的地址为 0x09的意思

使用特权

评论回复
9
cb0035071|  楼主 | 2010-12-1 13:55 | 只看该作者
我用的C30编译器

使用特权

评论回复
10
XIEYUANBIN| | 2010-12-1 14:15 | 只看该作者
那你到C30的安装目录,support文件夹里面去找。弄这么久还没找到吗?自学能力够差的。

使用特权

评论回复
11
cb0035071|  楼主 | 2010-12-1 14:32 | 只看该作者
没找到

使用特权

评论回复
12
cb0035071|  楼主 | 2010-12-1 14:32 | 只看该作者
没有类似的语句啊

使用特权

评论回复
13
cb0035071|  楼主 | 2010-12-1 14:41 | 只看该作者
/*=========================================================================
**       Register Definitions
** (Core and Peripheral Registers in Data Space)
**==========================================================================
**
**==========================================================================
**
**       dsPIC Core Register Definitions
**
**=========================================================================*/
WREG0 = 0x0000;
_WREG0 = 0x0000;
WREG1 = 0x0002;
_WREG1 = 0x0002;
WREG2 = 0x0004;
_WREG2 = 0x0004;
WREG3 = 0x0006;
_WREG3 = 0x0006;
WREG4 = 0x0008;
_WREG4 = 0x0008;
WREG5 = 0x000A;
_WREG5 = 0x000A;
WREG6 = 0x000C;
_WREG6 = 0x000C;
WREG7 = 0x000E;
_WREG7 = 0x000E;
WREG8 = 0x0010;
_WREG8 = 0x0010;
WREG9 = 0x0012;
_WREG9 = 0x0012;
WREG10 = 0x0014;
_WREG10 = 0x0014;
WREG11 = 0x0016;
_WREG11 = 0x0016;
WREG12 = 0x0018;
_WREG12 = 0x0018;
WREG13 = 0x001A;
_WREG13 = 0x001A;
WREG14 = 0x001C;
_WREG14 = 0x001C;
WREG15 = 0x001E;
_WREG15 = 0x001E;
SPLIM = 0x0020;
_SPLIM = 0x0020;
ACCAL = 0x0022;
_ACCAL = 0x0022;
ACCAH = 0x0024;
_ACCAH = 0x0024;
ACCAU = 0x0026;
_ACCAU = 0x0026;
ACCBL = 0x0028;
_ACCBL = 0x0028;
ACCBH = 0x002A;
_ACCBH = 0x002A;
ACCBU = 0x002C;
_ACCBU = 0x002C;
PCL = 0x002E;
_PCL = 0x002E;
PCH = 0x0030;
_PCH = 0x0030;
TBLPAG = 0x0032;
_TBLPAG = 0x0032;
PSVPAG = 0x0034;
_PSVPAG = 0x0034;
RCOUNT = 0x0036;
_RCOUNT = 0x0036;
DCOUNT = 0x0038;
_DCOUNT = 0x0038;
DOSTARTL = 0x003A;
_DOSTARTL = 0x003A;
DOSTARTH = 0x003C;
_DOSTARTH = 0x003C;
DOENDL = 0x003E;
_DOENDL = 0x003E;
DOENDH = 0x0040;
_DOENDH = 0x0040;
SR = 0x0042;
_SR = 0x0042;
CORCON = 0x0044;
_CORCON = 0x0044;
MODCON = 0x0046;
_MODCON = 0x0046;
XMODSRT = 0x0048;
_XMODSRT = 0x0048;
XMODEND = 0x004A;
_XMODEND = 0x004A;
YMODSRT = 0x004C;
_YMODSRT = 0x004C;
YMODEND = 0x004E;
_YMODEND = 0x004E;
XBREV = 0x0050;
_XBREV = 0x0050;
DISICNT = 0x0052;
_DISICNT = 0x0052;

/*==========================================================================
**
**           Change Notification Register Definitions
**
==========================================================================*/

CNEN1 = 0x0060;
_CNEN1 = 0x0060;
CNPU1 = 0x0068;
_CNPU1 = 0x0068;

/*==========================================================================
**
**           Interrupt Controller Register Definitions
**
==========================================================================*/
INTCON1 = 0x0080;
_INTCON1 = 0x0080;
INTCON2 = 0x0082;
_INTCON2 = 0x0082;
IFS0 = 0x0084;
_IFS0 = 0x0084;
IFS1 = 0x0086;
_IFS1 = 0x0086;
IFS2 = 0x0088;
_IFS2 = 0x0088;
IEC0 = 0x0094;
_IEC0 = 0x0094;
IEC1 = 0x0096;
_IEC1 = 0x0096;
IEC2 = 0x0098;
_IEC2 = 0x0098;
IPC0 = 0x00A4;
_IPC0 = 0x00A4;
IPC1 = 0x00A6;
_IPC1 = 0x00A6;
IPC2 = 0x00A8;
_IPC2 = 0x00A8;
IPC3 = 0x00AA;
_IPC3 = 0x00AA;
IPC4 = 0x00AC;
_IPC4 = 0x00AC;
IPC5 = 0x00AE;
_IPC5 = 0x00AE;
IPC6 = 0x00B0;
_IPC6 = 0x00B0;
IPC7 = 0x00B2;
_IPC7 = 0x00B2;
IPC8 = 0x00B4;
_IPC8 = 0x00B4;
IPC9 = 0x00B6;
_IPC9 = 0x00B6;
IPC10 = 0x00B8;
_IPC10 = 0x00B8;
INTTREG = 0x00E0;
_INTTREG = 0x00E0;

/*=========================================================================
**
**       Timer  Module Register Definitions
**
===========================================================================*/
/*--------------Timer 1 Module---------------------------------------------*/
TMR1 = 0x0100;
_TMR1 = 0x0100;
PR1 = 0x0102;
_PR1 = 0x0102;
T1CON = 0x0104;
_T1CON = 0x0104;

/*--------------Timer2/3 Module--------------------------------------------*/
TMR2 = 0x0106;
_TMR2 = 0x0106;
TMR3HLD = 0x0108;
_TMR3HLD = 0x0108;
TMR3 = 0x010A;
_TMR3 = 0x010A;
PR2 = 0x010C;
_PR2 = 0x010C;
PR3 = 0x010E;
_PR3 = 0x010E;
T2CON = 0x0110;
_T2CON = 0x0110;
T3CON = 0x0112;
_T3CON = 0x0112;


/*=========================================================================
**
**       Input Capture Module Register Definitions
**
=========================================================================*/
IC1BUF = 0x0140;
_IC1BUF = 0x0140;
IC1CON = 0x0142;
_IC1CON = 0x0142;


/*==========================================================================
**
**       Output Compare Module Register Definitions
**
===========================================================================*/
OC1RS = 0x0180;
_OC1RS = 0x0180;
OC1R = 0x0182;
_OC1R = 0x0182;
OC1CON = 0x0184;
_OC1CON = 0x0184;
OC2RS = 0x0186;
_OC2RS = 0x0186;
OC2R = 0x0188;
_OC2R = 0x0188;
OC2CON = 0x018A;
_OC2CON = 0x018A;


/*=========================================================================
**
**       Inter-Integrated Circuit(I2C) Module Register Definitions
**
==========================================================================*/
I2CRCV = 0x0200;
_I2CRCV = 0x0200;
I2CTRN = 0x0202;
_I2CTRN = 0x0202;
I2CBRG = 0x0204;
_I2CBRG = 0x0204;
I2CCON = 0x0206;
_I2CCON = 0x0206;
I2CSTAT = 0x0208;
_I2CSTAT = 0x0208;
I2CADD = 0x020A;
_I2CADD = 0x020A;


/*==========================================================================
**
**          Universal Asynchronous Receiver TransmitterUART Module
**                           Register Definitions
**
==========================================================================*/
/*------------------UART 1 Module-----------------------------------------*/
U1MODE = 0x0220;
_U1MODE = 0x0220;
U1STA = 0x0222;
_U1STA = 0x0222;
U1TXREG = 0x0224;
_U1TXREG = 0x0224;
U1RXREG = 0x0226;
_U1RXREG = 0x0226;
U1BRG = 0x0228;
_U1BRG = 0x0228;


/*==========================================================================
**
**       Serial Peripheral Interface(SPI) Module Register Definitions
**
==========================================================================*/
/*-----------------SPI 1 Module-------------------------------------------*/
SPI1STAT = 0x0240;
_SPI1STAT = 0x0240;
SPI1CON1 = 0x0242;
_SPI1CON1 = 0x0242;
SPI1CON2 = 0x0244;
_SPI1CON2 = 0x0244;
SPI1BUF = 0x0246;
_SPI1BUF = 0x0246;


/*==========================================================================
**
**    General Purpose I/O Port Register Definitions
**
==========================================================================*/
TRISA = 0x02C0;
_TRISA = 0x02C0;
PORTA = 0x02C2;
_PORTA = 0x02C2;
LATA = 0x02C4;
_LATA = 0x02C4;

TRISB = 0x02C6;
_TRISB = 0x02C6;
PORTB = 0x02C8;
_PORTB = 0x02C8;
LATB = 0x02CA;
_LATB = 0x02CA;

TRISD = 0x02D2;
_TRISD = 0x02D2;
PORTD = 0x02D4;
_PORTD = 0x02D4;
LATD = 0x02D6;
_LATD = 0x02D6;

TRISE = 0x02D8;
_TRISE = 0x02D8;
PORTE = 0x02DA;
_PORTE = 0x02DA;
LATE = 0x02DC;
_LATE = 0x02DC;

TRISF = 0x02DE;
_TRISF = 0x02DE;
PORTF = 0x02E0;
_PORTF = 0x02E0;
LATF = 0x02E2;
_LATF = 0x02E2;




/*==========================================================================
**
**    A/D converter registers
**
==========================================================================*/
ADCON = 0x0300;
_ADCON = 0x0300;
ADPCFG = 0x0302;
_ADPCFG = 0x0302;
ADSTAT = 0x0306;
_ADSTAT = 0x0306;
ADBASE = 0x0308;
_ADBASE = 0x0308;
ADCPC0 = 0x030A;
_ADCPC0 = 0x030A;
ADCPC1 = 0x030C;
_ADCPC1 = 0x030C;

ADCBUF0 = 0x0320;
_ADCBUF0 = 0x0320;
ADCBUF1 = 0x0322;
_ADCBUF1 = 0x0322;
ADCBUF2 = 0x0324;
_ADCBUF2 = 0x0324;
ADCBUF3 = 0x0326;
_ADCBUF3 = 0x0326;
ADCBUF4 = 0x0328;
_ADCBUF4 = 0x0328;
ADCBUF5 = 0x032A;
_ADCBUF5 = 0x032A;
ADCBUF6 = 0x032C;
_ADCBUF6 = 0x032C;
ADCBUF7 = 0x032E;
_ADCBUF7 = 0x032E;



/*==========================================================================
**
**    PWM Registers
**
==========================================================================*/
PTCON = 0x0400;
_PTCON = 0x0400;
PTPER = 0x0402;
_PTPER = 0x0402;
MDC = 0x0404;
_MDC = 0x0404;
SEVTCMP = 0x0406;
_SEVTCMP = 0x0406;

PWMCON1 =         0x0408;
_PWMCON1 =         0x0408;
IOCON1 =         0x040A;
_IOCON1 =         0x040A;
FCLCON1 =         0x040C;
_FCLCON1 =         0x040C;
PDC1 =         0x040E;
_PDC1 =         0x040E;
PHASE1 =         0x0410;
_PHASE1 =         0x0410;
DTR1 =         0x0412;
_DTR1 =         0x0412;
ALTDTR1 =         0x0414;
_ALTDTR1 =         0x0414;
TRIG1 =         0x0416;
_TRIG1 =         0x0416;
TRGCON1 =         0x0418;
_TRGCON1 =         0x0418;
LEBCON1 =         0x041A;
_LEBCON1 =         0x041A;

PWMCON2 =         0x041C;
_PWMCON2 =         0x041C;
IOCON2 =         0x041E;
_IOCON2 =         0x041E;
FCLCON2 =         0x0420;
_FCLCON2 =         0x0420;
PDC2 =         0x0422;
_PDC2 =         0x0422;
PHASE2 =         0x0424;
_PHASE2 =         0x0424;
DTR2 =         0x0426;
_DTR2 =         0x0426;
ALTDTR2 =         0x0428;
_ALTDTR2 =         0x0428;
TRIG2 =         0x042A;
_TRIG2 =         0x042A;
TRGCON2 =         0x042C;
_TRGCON2 =         0x042C;
LEBCON2 =         0x042E;
_LEBCON2 =         0x042E;



PWMCON3 =         0x0430;
_PWMCON3 =         0x0430;
IOCON3 =         0x0432;
_IOCON3 =         0x0432;
FCLCON3 =         0x0434;
_FCLCON3 =         0x0434;
PDC3 =         0x0436;
_PDC3 =         0x0436;
PHASE3 =         0x0438;
_PHASE3 =         0x0438;
DTR3 =         0x043A;
_DTR3 =         0x043A;
ALTDTR3 =         0x043C;
_ALTDTR3 =         0x043C;
TRIG3 =         0x043E;
_TRIG3 =         0x043E;
TRGCON3 =         0x0440;
_TRGCON3 =         0x0440;
LEBCON3 =         0x0442;
_LEBCON3 =         0x0442;

PWMCON4 =         0x0444;
_PWMCON4 =         0x0444;
IOCON4 =         0x0446;
_IOCON4 =         0x0446;
FCLCON4 =         0x0448;
_FCLCON4 =         0x0448;
PDC4 =         0x044A;
_PDC4 =         0x044A;
PHASE4 =         0x044C;
_PHASE4 =         0x044C;
DTR4 =         0x044E;
_DTR4 =         0x044E;
ALTDTR4 =         0x0450;
_ALTDTR4 =         0x0450;
TRIG4 =         0x0452;
_TRIG4 =         0x0452;
TRGCON4 =         0x0454;
_TRGCON4 =         0x0454;
LEBCON4 =  0x0456;
_LEBCON4 =         0x0456;

/*==========================================================================
**
** Analog Comparator Definitions
**
==========================================================================*/
CMPCON1 = 0x04C0;
_CMPCON1 = 0x04C0;
CMPDAC1 = 0x04C2;
_CMPDAC1 = 0x04C2;
CMPCON2 = 0x04C4;
_CMPCON2 = 0x04C4;
CMPDAC2 = 0x04C6;
_CMPDAC2 = 0x04C6;
CMPCON3 = 0x04C8;
_CMPCON3 = 0x04C8;
CMPDAC3 = 0x04CA;
_CMPDAC3 = 0x04CA;
CMPCON4 = 0x04CC;
_CMPCON4 = 0x04CC;
CMPDAC4 = 0x04CE;
_CMPDAC4 = 0x04CE;


/*==========================================================================
**
**    System Integration Block Registers
**
==========================================================================*/
RCON = 0x0740;
_RCON = 0x0740;
OSCCON = 0x0742;
_OSCCON = 0x0742;
CLKDIV = 0x0744;
_CLKDIV = 0x0744;
OSCTUN = 0x0748;
_OSCTUN = 0x0748;
OSCTUN2 = 0x074A;
_OSCTUN2 = 0x074A;
LFSR = 0x074C;
_LFSR = 0x074C;
OSCCONL = OSCCON;
_OSCCONL = OSCCON;
OSCCONH = OSCCON + 1;
_OSCCONH = OSCCON + 1;


/*==========================================================================
**
**    Non Volatile Memory Registers
**
==========================================================================*/
NVMCON = 0x0760;
_NVMCON = 0x0760;
NVMADR = 0x0762;
_NVMADR = 0x0762;
NVMADRU = 0x0764;
_NVMADRU = 0x0764;
NVMKEY = 0x0766;
_NVMKEY = 0x0766;

/*==========================================================================
**
**   Peripheral Module Disable Registers
**
==========================================================================*/
PMD1 = 0x0770;
_PMD1 = 0x0770;
PMD2 = 0x0772;
_PMD2 = 0x0772;
PMD3 = 0x0774;
_PMD3 = 0x0774;

/*
**End of SFR Definitions required for both C and Assembly files
*/


/*=========================================================================
**
**Start of Additional SFR Definitions that are required specifically
**for the C header file.
**
==========================================================================*/
ACCA = 0x0022;
_ACCA = 0x0022;
ACCB = 0x0028;
_ACCB = 0x0028;
SRbits = 0x0042;
_SRbits = 0x0042;
CORCONbits = 0x0044;
_CORCONbits = 0x0044;
MODCONbits = 0x0046;
_MODCONbits = 0x0046;
XBREVbits = 0x0050;
_XBREVbits = 0x0050;
_CNEN1bits = 0x0060;
CNEN1bits = 0x0060;
_CNPU1bits = 0x0064;
CNPU1bits = 0x0064;
INTCON1bits = 0x0080;
_INTCON1bits = 0x0080;
INTCON2bits = 0x0082;
_INTCON2bits = 0x0082;
IFS0bits = 0x0084;
_IFS0bits = 0x0084;
IFS1bits = 0x0086;
_IFS1bits = 0x0086;
IFS2bits = 0x0088;
_IFS2bits = 0x0088;
IEC0bits = 0x0094;
_IEC0bits = 0x0094;
IEC1bits = 0x0096;
_IEC1bits = 0x0096;
IEC2bits = 0x0098;
_IEC2bits = 0x0098;
IPC0bits = 0x00A4;
_IPC0bits = 0x00A4;
IPC1bits = 0x00A6;
_IPC1bits = 0x00A6;
IPC2bits = 0x00A8;
_IPC2bits = 0x00A8;
IPC3bits = 0x00AA;
_IPC3bits = 0x00AA;
IPC4bits = 0x00AC;
_IPC4bits = 0x00AC;
IPC5bits = 0x00AE;
_IPC5bits = 0x00AE;
IPC6bits = 0x00B0;
_IPC6bits = 0x00B0;
IPC7bits = 0x00B2;
_IPC7bits = 0x00B2;
IPC8bits = 0x00B4;
_IPC8bits = 0x00B4;
IPC9bits = 0x00B6;
_IPC9bits = 0x00B6;
IPC10bits = 0x00B8;
_IPC10bits = 0x00B8;
T1CONbits = 0x0104;
_T1CONbits = 0x0104;
T2CONbits = 0x0110;
_T2CONbits = 0x0110;
T3CONbits = 0x0112;
_T3CONbits = 0x0112;
IC1CONbits = 0x0142;
_IC1CONbits = 0x0142;
OC1CONbits = 0x0184;
_OC1CONbits = 0x0184;
OC2CONbits = 0x018A;
_OC2CONbits = 0x018A;
I2CCONbits = 0x0206;
_I2CCONbits = 0x0206;
I2CSTATbits = 0x0208;
_I2CSTATbits = 0x0208;
U1MODEbits = 0x0220;
_U1MODEbits = 0x0220;
U1STAbits = 0x0222;
_U1STAbits = 0x0222;
SPI1STATbits = 0x0240;
_SPI1STATbits = 0x0240;
SPI1CON1bits = 0x0242;
_SPI1CON1bits = 0x0242;
SPI1CON2bits = 0x0244;
_SPI1CON2bits = 0x0244;
TRISAbits = 0x02C0;
_TRISAbits = 0x02C0;
PORTAbits = 0x02C2;
_PORTAbits = 0x02C2;
LATAbits = 0x02C4;
_LATAbits = 0x02C4;
TRISBbits = 0x02C6;
_TRISBbits = 0x02C6;
PORTBbits = 0x02C8;
_PORTBbits = 0x02C8;
LATBbits = 0x02CA;
_LATBbits = 0x02CA;
TRISDbits = 0x02D2;
_TRISDbits = 0x02D2;
PORTDbits = 0x02D4;
_PORTDbits = 0x02D4;
LATDbits = 0x02D6;
_LATDbits = 0x02D6;
TRISEbits = 0x02D8;
_TRISEbits = 0x02D8;
PORTEbits = 0x02DA;
_PORTEbits = 0x02DA;
LATEbits = 0x02DC;
_LATEbits = 0x02DC;
TRISFbits = 0x02DE;
_TRISFbits = 0x02DE;
PORTFbits = 0x02E0;
_PORTFbits = 0x02E0;
LATFbits = 0x02E2;
_LATFbits = 0x02E2;

ADCONbits = 0x0300;
_ADCONbits = 0x0300;
ADPCFGbits = 0x0302;
_ADPCFGbits = 0x0302;
ADSTATbits = 0x0306;
_ADSTATbits = 0x0306;
ADCPC0bits = 0x030A;
_ADCPC0bits = 0x030A;
ADCPC1bits = 0x030C;
_ADCPC1bits = 0x030C;
PTCONbits = 0x0400;
_PTCONbits = 0x0400;

PWMCON1bits = 0x0408;
_PWMCON1bits = 0x0408;
IOCON1bits = 0x040A;
_IOCON1bits = 0x040A;
FCLCON1bits = 0x040C;
_FCLCON1bits = 0x040C;
TRIG1bits = 0x0416;
_TRIG1bits = 0x0416;
TRGCON1bits = 0x0418;
_TRGCON1bits = 0x0418;
LEBCON1bits = 0x041A;
_LEBCON1bits = 0x041A;

PWMCON2bits = 0x041C;
_PWMCON2bits = 0x041C;
IOCON2bits = 0x041E;
_IOCON2bits = 0x041E;
FCLCON2bits = 0x0420;
_FCLCON2bits = 0x0420;
TRGCON2bits = 0x042C;
_TRGCON2bits = 0x042C;
LEBCON2bits = 0x042E;
_LEBCON2bits = 0x042E;

PWMCON3bits = 0x0430;
_PWMCON3bits = 0x0430;
IOCON3bits = 0x0432;
_IOCON3bits = 0x0432;
FCLCON3bits = 0x0434;
_FCLCON3bits = 0x0434;
TRGCON3bits = 0x0440;
_TRGCON3bits = 0x0440;
LEBCON3bits = 0x0442;
_LEBCON3bits = 0x0442;

PWMCON4bits = 0x0444;
_PWMCON4bits = 0x0444;
IOCON4bits = 0x0446;
_IOCON4bits = 0x0446;
FCLCON4bits = 0x0448;
_FCLCON4bits = 0x0448;
TRGCON4bits = 0x0454;
_TRGCON4bits = 0x0454;
LEBCON4bits = 0x0456;
_LEBCON4bits = 0x0456;

CMPCON1bits = 0x04C0;
_CMPCON1bits = 0x04C0;
CMPDAC1bits = 0x04C2;
_CMPDAC1bits = 0x04C2;
CMPCON2bits = 0x04C4;
_CMPCON2bits = 0x04C4;
CMPDAC2bits = 0x04C6;
_CMPDAC2bits = 0x04C6;
CMPCON3bits = 0x04C8;
_CMPCON3bits = 0x04C8;
CMPDAC3bits = 0x04CA;
_CMPDAC3bits = 0x04CA;
CMPCON4bits = 0x04CC;
_CMPCON4bits = 0x04CC;
CMPDAC4bits = 0x04CE;
_CMPDAC4bits = 0x04CE;

RCONbits = 0x0740;
_RCONbits = 0x0740;
OSCCONbits = 0x0742;
_OSCCONbits = 0x0742;
OSCTUNbits = 0x0748;
_OSCTUNbits = 0x0748;
OSCTUN2bits = 0x074A;
_OSCTUN2bits = 0x074A;
NVMCONbits = 0x0760;
_NVMCONbits = 0x0760;
PMD1bits = 0x0770;
_PMD1bits = 0x0770;
PMD2bits = 0x0772;
_PMD2bits = 0x0772;
PMD3bits = 0x0774;
_PMD3bits = 0x0774;
/*
**end of SFR definitions required for C header
*/

/* SFR base address definitions for various peripherals */

OC1 = 0x0180;
_OC1 = 0x0180;
OC2 = 0x0186;
_OC2 = 0x0186;

UART1 = 0x0220;
_UART1 = 0x0220;

SPI1 = 0x0240;
_SPI1 = 0x0240;

/*=========================================================================
**end of SFR definitions required in Data Space
*========================================================================*/

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

5

主题

192

帖子

0

粉丝