piyushpandey
Member level 4
Hi guys
I have accessed the bits of corresponding registers by the syntax REGISTERbits.bitno and through this syntax I get by default that particular bit to be showed in the MPLABX IDE but when I try to access the VCFG bit of the ADCON0 register I did not get that sort of automatic pop up window showing the list of bits defined in the structure, Instead I get the list of few bits and not all.
I am trying to access the VCFG bit from the ADCON0 register structure defined in the pic16f688 header file in the HiTECH compiler of version 9.83.
The structure code of the particular ADCON0 register is this:
Please help me that how can I access the VCFG bit from the ADCON0 register. I am using the MPLAB X IDE in which when I access the bit as ADCON0bits.VCFG than it shows the error.
So please tell me that what this structure is all about and how can I access all the bits define inside it.
Thanks
I have accessed the bits of corresponding registers by the syntax REGISTERbits.bitno and through this syntax I get by default that particular bit to be showed in the MPLABX IDE but when I try to access the VCFG bit of the ADCON0 register I did not get that sort of automatic pop up window showing the list of bits defined in the structure, Instead I get the list of few bits and not all.
I am trying to access the VCFG bit from the ADCON0 register structure defined in the pic16f688 header file in the HiTECH compiler of version 9.83.
The structure code of the particular ADCON0 register is this:
Code:
// Register: ADCON0
volatile unsigned char ADCON0 @ 0x01F;
// bit and bitfield definitions
volatile bit ADON @ ((unsigned)&ADCON0*8)+0;
volatile bit GO_nDONE @ ((unsigned)&ADCON0*8)+1;
volatile bit VCFG @ ((unsigned)&ADCON0*8)+6;
volatile bit ADFM @ ((unsigned)&ADCON0*8)+7;
volatile bit GO @ ((unsigned)&ADCON0*8)+1;
volatile bit CHS0 @ ((unsigned)&ADCON0*8)+2;
volatile bit CHS1 @ ((unsigned)&ADCON0*8)+3;
volatile bit CHS2 @ ((unsigned)&ADCON0*8)+4;
volatile bit nDONE @ ((unsigned)&ADCON0*8)+1;
volatile bit GO_DONE @ ((unsigned)&ADCON0*8)+1;
#ifndef _LIB_BUILD
volatile union {
struct {
unsigned ADON : 1;
unsigned GO_nDONE : 1;
unsigned CHS : 3;
unsigned : 1;
unsigned VCFG : 1;
unsigned ADFM : 1;
};
struct {
unsigned : 1;
unsigned : 1;
unsigned : 3;
unsigned : 1;
unsigned : 1;
unsigned : 1;
};
struct {
unsigned : 1;
unsigned GO : 1;
unsigned CHS0 : 1;
unsigned CHS1 : 1;
unsigned CHS2 : 1;
};
struct {
unsigned : 1;
unsigned nDONE : 1;
};
struct {
unsigned : 1;
unsigned GO_DONE : 1;
};
} ADCON0bits @ 0x01F;
Please help me that how can I access the VCFG bit from the ADCON0 register. I am using the MPLAB X IDE in which when I access the bit as ADCON0bits.VCFG than it shows the error.
So please tell me that what this structure is all about and how can I access all the bits define inside it.
Thanks