chrischris
Member
Hi, I have managed to get the GLCD working with PIC 16F877A and now trying to migrate the code on 18F45k80, but the LCD just lights up, I can adjust the contrast but nothing else happens. All I have changed is data port to PORTB from PORTD on 16F and Control Port from PORTB on 16F to PORTD on 18F. The library I am using is from https://en.radzio.dxp.pl/ks0108/
Everything works smoothly on PIC16F but 18F is just blank screen. Compiler is XC8 using MPLABx.
PIC16 circuit is on vero board but the PIC18 circuit is on a PCB, so the crude circuit works but not the PCB one !!. I have attached the schematic and also the C file for LCD driver. I am using the same file for both PICs except for the changes described above and the config. The config in the attached file is for PIC18F.
I also tried initializing the PORTS at the beginning of the main() function as
TRISD = 0x00;
TRISB = 0x00;
PORTD = 0X00;
LATD = 0x00;
PORTB = 0x00;
LATB = 0x00;
PSPCONbits.PSPMODE = 0;
INTCON2bits.RBPU =1;
PADCFG1bits.RDPU =0;
INTCONbits.RBIE =0 ;
ADCON0 = 0;
ADCON1 = 0;
I think it has to be something simple as not setting the PORTS correctly but I can't figure it out. Can anybody please help me on this ?
P.S. I tried setting all the PORTs HIGH to see if they function as I/O and it all seems to be ok.
Thanks,
Chris
Everything works smoothly on PIC16F but 18F is just blank screen. Compiler is XC8 using MPLABx.
PIC16 circuit is on vero board but the PIC18 circuit is on a PCB, so the crude circuit works but not the PCB one !!. I have attached the schematic and also the C file for LCD driver. I am using the same file for both PICs except for the changes described above and the config. The config in the attached file is for PIC18F.
I also tried initializing the PORTS at the beginning of the main() function as
TRISD = 0x00;
TRISB = 0x00;
PORTD = 0X00;
LATD = 0x00;
PORTB = 0x00;
LATB = 0x00;
PSPCONbits.PSPMODE = 0;
INTCON2bits.RBPU =1;
PADCFG1bits.RDPU =0;
INTCONbits.RBIE =0 ;
ADCON0 = 0;
ADCON1 = 0;
I think it has to be something simple as not setting the PORTS correctly but I can't figure it out. Can anybody please help me on this ?
P.S. I tried setting all the PORTs HIGH to see if they function as I/O and it all seems to be ok.
Thanks,
Chris