haastores.blogg.se

Delay in mplab xc8
Delay in mplab xc8







#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)

delay in mplab xc8

#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.

delay in mplab xc8 delay in mplab xc8

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.









Delay in mplab xc8