CMCON identifier problem

General discussion on mikroC.
Post Reply
Author
Message
dberreondo
Posts: 1
Joined: 10 Aug 2011 08:18

CMCON identifier problem

#1 Post by dberreondo » 10 Aug 2011 08:34

I am working on MikroC PRO for PIC and Visual GLCD. The PIC that I'm using is PIC18F4431. When I build and program my project, a message appears and says "undeclared identifier 'CMCON' in expression". I don't know how to fix it. Someone could help me please?

unsigned int Xcoord, Ycoord;
char PenDown;
void *PressedObject;
static void InitializeTouchPanel() {
ADCON1 = 0x0C;
TRISA = 7;
CMCON = 0x07;
ADC_Init();
Glcd_Init(); // Initialize GLCD
Glcd_Fill(0); // Clear GLCD

TP_Init(128, 64, 0, 1); // Initialize touch panel
TP_Set_ADC_Threshold(900); // Set touch panel ADC threshold

PenDown = 0;
PressedObject = 0;
}

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: CMCON identifier problem

#2 Post by janko.kaljevic » 11 Aug 2011 14:11

Hello,

When you select chip you want to use You will see few lines of code for Initialization of MCU.
The generated code is for default chips, and if you want to use some other chip, please refer to device documentation for appropriate initialization.

The chip you are using PIC18F4431 doesn't have CMCON register, and that is why you have this error message.

Regards.

Post Reply

Return to “mikroC General”