build failed
main.c:49: error: undefined identifier "RA7"
main.c:50: error: undefined identifier "RA5"
main.c:54: error: undefined identifier "RA6"
main.c:64: error: undefined identifier "RA7"
main.c:65: error: undefined identifier "RA5"
what is the problem?
#include
#include
#include
#define _XTAL_FREQ 4000000
#define delay_ms(x) __delay_ms(x)
/*Configuration fuses, start*/
#pragma config IESO=OFF, FOSC=XT, PRICLKEN=OFF,FCMEN=OFF,PLLCFG=OFF
#pragma config BOREN=OFF, BORV=285, PWRTEN=ON
#pragma config WDTEN=OFF,MCLRE=INTMCLR
#pragma config P2BMX=PORTC0, CCP2MX=PORTC1,PBADEN=OFF,
#pragma config CCP3MX=PORTE0,MCLRE=INTMCLR,HFOFST=OFF,T3CMX=PORTB5
#pragma config DEBUG=OFF,STVREN=ON,XINST=OFF,LVP=OFF
//define derivative
#define DS RA7
#define ST_CP RA6
#define SH_CP RA5
#define LED PORTB
//Global Scope
unsigned char col[ 8 ] = {1, 0, 1, 0, 1, 0, 1, 0};
//function prototype
void pic_init();
void main() {
pic_init();
LED = 0xff; //just to indicate
while(1)
{
for(int i = 0 ; i < 8 ; i++)
{
DS = col[ i ];
SH_CP = 1;
SH_CP = 0;
}
ST_CP = 1;
ST_CP = 0;
delay_ms(250);
delay_ms(250);
for(int i = 0 ; i < 8 ; i++)
{
DS = 0;
SH_CP = 1;
SH_CP = 0;
}
ST_CP = 1;
ST_CP = 0;
delay_ms(250);
delay_ms(250);
}
}
void pic_init() {
//OSCCON=0B11110000; //sets the IRCF selecting the 16MHz INTOSC and SCS=primary clock
//OSCCON2=0B00000000; //sets MFIOSEL=0 and PRISD=0 turn off external osc drive circuit
//OSCTUNE=0B01000000; //enable PLL TODO
PLLEN = 0; //TODO
SLRCON = 0; //select standard slew rate
TRISA = 0; //for digital output
ANSELA = 0x00; //disable analog input
TRISB = 0xFF; //for push buttons
ANSELB = 0x00; //disable analog input
RBPU = 0; //weak pull up enable on all PORTB pins
TRISC = 0xFF; //this is needed because we don't know if the LCD will set the data line is output or input.
//the TRISC will only be initialized in the LCDinit() function.
ANSELC = 0X00; //disable analog input
TRISD = 0xFF; //all set to input first
ANSELD = 0; //turn off analog input
TRISE = 0xFF;
ANSELE = 0;
//timer setting
//T0CON=0b11000111; //on timer,8bit,instruction clock,1/16prescale to make 1ms at 16MHz
//set interrupt priority, also not needed for this design
GIEH = 0; //DISABLE ALL INTERRUPTS
}
main.c:49: error: undefined identifier "RA7"
main.c:50: error: undefined identifier "RA5"
main.c:54: error: undefined identifier "RA6"
main.c:64: error: undefined identifier "RA7"
main.c:65: error: undefined identifier "RA5"
what is the problem?
#include
#include
#include
#define _XTAL_FREQ 4000000
#define delay_ms(x) __delay_ms(x)
/*Configuration fuses, start*/
#pragma config IESO=OFF, FOSC=XT, PRICLKEN=OFF,FCMEN=OFF,PLLCFG=OFF
#pragma config BOREN=OFF, BORV=285, PWRTEN=ON
#pragma config WDTEN=OFF,MCLRE=INTMCLR
#pragma config P2BMX=PORTC0, CCP2MX=PORTC1,PBADEN=OFF,
#pragma config CCP3MX=PORTE0,MCLRE=INTMCLR,HFOFST=OFF,T3CMX=PORTB5
#pragma config DEBUG=OFF,STVREN=ON,XINST=OFF,LVP=OFF
//define derivative
#define DS RA7
#define ST_CP RA6
#define SH_CP RA5
#define LED PORTB
//Global Scope
unsigned char col[ 8 ] = {1, 0, 1, 0, 1, 0, 1, 0};
//function prototype
void pic_init();
void main() {
pic_init();
LED = 0xff; //just to indicate
while(1)
{
for(int i = 0 ; i < 8 ; i++)
{
DS = col[ i ];
SH_CP = 1;
SH_CP = 0;
}
ST_CP = 1;
ST_CP = 0;
delay_ms(250);
delay_ms(250);
for(int i = 0 ; i < 8 ; i++)
{
DS = 0;
SH_CP = 1;
SH_CP = 0;
}
ST_CP = 1;
ST_CP = 0;
delay_ms(250);
delay_ms(250);
}
}
void pic_init() {
//OSCCON=0B11110000; //sets the IRCF selecting the 16MHz INTOSC and SCS=primary clock
//OSCCON2=0B00000000; //sets MFIOSEL=0 and PRISD=0 turn off external osc drive circuit
//OSCTUNE=0B01000000; //enable PLL TODO
PLLEN = 0; //TODO
SLRCON = 0; //select standard slew rate
TRISA = 0; //for digital output
ANSELA = 0x00; //disable analog input
TRISB = 0xFF; //for push buttons
ANSELB = 0x00; //disable analog input
RBPU = 0; //weak pull up enable on all PORTB pins
TRISC = 0xFF; //this is needed because we don't know if the LCD will set the data line is output or input.
//the TRISC will only be initialized in the LCDinit() function.
ANSELC = 0X00; //disable analog input
TRISD = 0xFF; //all set to input first
ANSELD = 0; //turn off analog input
TRISE = 0xFF;
ANSELE = 0;
//timer setting
//T0CON=0b11000111; //on timer,8bit,instruction clock,1/16prescale to make 1ms at 16MHz
//set interrupt priority, also not needed for this design
GIEH = 0; //DISABLE ALL INTERRUPTS
}