microcontroller - PIC18F2455 MPLab compile undefined identifier ANSEL and ANSELH -



microcontroller - PIC18F2455 MPLab compile undefined identifier ANSEL and ANSELH -

i meet error when compiling code microchip microcontroller pic18f2455:

#define hardware_setled(value) latbbits.latb5 = value ..... // disable analog pin functions, set led pin output ansel = 0; anselh = 0; trisbbits.trisb5 = 0; hardware_setled(0); ....

the output said:

error [192] c:\....\main.c; 320.1 undefined identifier "ansel" errpr [192] c:\....\main.c; 321.1 undefined indentifer "anselh"

i guess, in pic18f2455 these registers not called "ansel" & "anselh"?

actually, compile , not meet error on labtop. meet when compiling @ company.

you said :

i guess, in pic18f2455 these registers not called "ansel" & "anselh"?

you're right, pic18f2455 doesn't have registers ansel , anselh. registers used configure analog or digital function pin adcon1. see page 266 of datasheet finish info of configuration. (http://ww1.microchip.com/downloads/en/devicedoc/39632e.pdf)

but don't know why code compiles succesfully on laptop... maybe don't utilize same microcontroller...

maybe help you.

microcontroller pic mplab

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -