

If it was broken it would not work for MikroC version. Is your oscillator 8MHz (and not broken)? #pragma config EBTRB = OFF // Boot Block Table Read Protection bit (Boot Block (000000-0001FFh) not protected from Table Reads executed in other blocks)Ĭonfig bits seen by PICkit2 from hex files compiled my MPLAB and MikroC are #pragma config EBTR3 = OFF // Table Read Protection bit (Block 3 (006000-007FFFh) not protected from Table Reads executed in other blocks) #pragma config EBTR2 = OFF // Table Read Protection bit (Block 2 (004000-005FFFh) not protected from Table Reads executed in other blocks) #pragma config EBTR1 = OFF // Table Read Protection bit (Block 1 (002000-003FFFh) not protected from Table Reads executed in other blocks) #pragma config EBTR0 = OFF // Table Read Protection bit (Block 0 (000200-001FFFh) not protected from Table Reads executed in other blocks)

#pragma config WRTD = OFF // Data EEPROM Write Protection bit (Data EEPROM not write protected) #pragma config WRTB = OFF // Boot Block Write Protection bit (Boot Block (000000-0001FFh) not write protected) #pragma config WRTC = OFF // Configuration Register Write Protection bit (Configuration registers (300000-3000FFh) not write protected) #pragma config WRT3 = OFF // Write Protection bit (Block 3 (006000-007FFFh) not write protected) #pragma config WRT2 = OFF // Write Protection bit (Block 2 (004000-005FFFh) not write protected) #pragma config WRT1 = OFF // Write Protection bit (Block 1 (002000-003FFFh) not write protected) #pragma config WRT0 = OFF // Write Protection bit (Block 0 (000200-001FFFh) not write protected)
Mplab xc8 lcd library code#
#pragma config CPD = OFF // Data EEPROM Code Protection bit (Data EEPROM not code protected) #pragma config CPB = OFF // Boot Block Code Protection bit (Boot Block (000000-0001FFh) not code protected) #pragma config CP3 = OFF // Code Protection bit (Block 3 (006000-007FFFh) not code protected) #pragma config CP2 = OFF // Code Protection bit (Block 2 (004000-005FFFh) not code protected) #pragma config CP1 = OFF // Code Protection bit (Block 1 (002000-003FFFh) not code protected) #pragma config CP0 = OFF // Code Protection bit (Block 0 (000200-001FFFh) not code protected) #pragma config LVP = ON // Low Voltage ICSP Enable bit (Low Voltage ICSP enabled) #pragma config STVR = ON // Stack Full/Underflow Reset Enable bit (Stack Full/Underflow will cause RESET) #pragma config CCP2MUX = ON // CCP2 Mux bit (CCP2 input/output is multiplexed with RC1) #pragma config WDTPS = 128 // Watchdog Timer Postscale Select bits (1:128) #pragma config WDT = OFF // Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit)) #pragma config BORV = 20 // Brown-out Reset Voltage bits (VBOR set to 2.0V) #pragma config BOR = ON // Brown-out Reset Enable bit (Brown-out Reset enabled) #pragma config PWRT = OFF // Power-up Timer Enable bit (PWRT disabled) #pragma config OSCS = OFF // Oscillator System Clock Switch Enable bit (Oscillator system clock switch option is disabled (main oscillator is source)) #pragma config OSC = HS // Oscillator Selection bits (HS oscillator) Where does the difference lay? I suspect it has something to do with delay speed or so.Ĭode for main is as follows because its the thing that i change #include I am confused that configuration bits are as same for both MPLAB and MikroC. To my surprise, the Proteus as well as hardware worked as a charm. Then I ported the same code in MikroC - only made a slight change of replacing _delay_us and _delay_ms with available delay routines in MikroC. However, when I burned the program, the controller hardware refused to display anything. I tested it in ISIS and it showed perfect output. I found a library and worked on it and MPLAB XC8 compiled it successfully.

I have been trying to write a program for LCD on PIC18f452.
