I have this PIC16F877A development board with a 16x2 alphanumeric LCD display where the tracks connect the data pins of the LCD to PORT D and the control pins: RS, R/W, and E to PORT E.
I use C language to program(MikroC)
my purpose is to take an analog i/p from RA0 and give the o/p to the LCD (through ports B and E ).
for initialising ports, i do this:
void init_ports()
{
ADCON0.ADCS1=1;
ADCON0.ADCS0=1;
ADCON0.CHS2=0;
ADCON0.CHS1=0;
ADCON0.CHS0=0;
ADCON0.f2=0; //for ADGO
ADCON0.ADON=0;
ADCON1.ADFM=0;
ADCON1.PCFG3=0;
ADCON1.PCFG2=0;
ADCON1.PCFG1=1;
ADCON1.PCFG0=0;
}
and for configuring the output to the LCD, i have to use the Lcd_custom_config(&dataport,....,&controlport,...)
so i use this:
main()
{
init_ports();
TRISE=0;
TRISB=0 ;
LCD_Custom_Config(&PORTB,3,2,1,0,&PORTE,2,1,0);
.
.
.
}
but when i implement it, it doesn work at all... and when i try it in Proteus ISIS, it doesn work and i get a thousand warnings shown in the attached picture.
i've tried a lot but then in the end i jus gave up and used:
LCD_init(&PORTB)
and used three jumper wires to connect the control pins now configured to be in port B to the three pins in port E
can some one please help me?
sad[:'(]
I use C language to program(MikroC)
my purpose is to take an analog i/p from RA0 and give the o/p to the LCD (through ports B and E ).
for initialising ports, i do this:
void init_ports()
{
ADCON0.ADCS1=1;
ADCON0.ADCS0=1;
ADCON0.CHS2=0;
ADCON0.CHS1=0;
ADCON0.CHS0=0;
ADCON0.f2=0; //for ADGO
ADCON0.ADON=0;
ADCON1.ADFM=0;
ADCON1.PCFG3=0;
ADCON1.PCFG2=0;
ADCON1.PCFG1=1;
ADCON1.PCFG0=0;
}
and for configuring the output to the LCD, i have to use the Lcd_custom_config(&dataport,....,&controlport,...)
so i use this:
main()
{
init_ports();
TRISE=0;
TRISB=0 ;
LCD_Custom_Config(&PORTB,3,2,1,0,&PORTE,2,1,0);
.
.
.
}
but when i implement it, it doesn work at all... and when i try it in Proteus ISIS, it doesn work and i get a thousand warnings shown in the attached picture.
i've tried a lot but then in the end i jus gave up and used:
LCD_init(&PORTB)
and used three jumper wires to connect the control pins now configured to be in port B to the three pins in port E
can some one please help me?
sad[:'(]