Hi, does anyone have a sample code to interface 2x16 LCD to the PIC microcontroller using PICC compiler (PCW compiler) which is using C language to program? I just need to display character to the LCD.
I found this code from the internet:
/*setup PIC Ports and Interrupts */
set_bit( STATUS, RP0 );
OPTION_REG = TxMode; // Set Option register.
set_tris_a( PortAConfig); // Setup ports
set_tris_b( PortBConfig );
clear_bit( STATUS, RP0 );
output_low_port_a( LCD_SEL ); // Disable LCD
disable_interrupt( GIE ); // Enable Global Interrupts
/* End of Setup */
When i compile it with PICC, there is an error which stated undefined STATUS.
Do you have any idea how to setup the PIC in PICC?
Thank YOU
I found this code from the internet:
/*setup PIC Ports and Interrupts */
set_bit( STATUS, RP0 );
OPTION_REG = TxMode; // Set Option register.
set_tris_a( PortAConfig); // Setup ports
set_tris_b( PortBConfig );
clear_bit( STATUS, RP0 );
output_low_port_a( LCD_SEL ); // Disable LCD
disable_interrupt( GIE ); // Enable Global Interrupts
/* End of Setup */
When i compile it with PICC, there is an error which stated undefined STATUS.
Do you have any idea how to setup the PIC in PICC?
Thank YOU
Last edited: