I can't run this code on my PIC18F4550 with 20.00 MHz crystal oscillator. I use XC8 compiler. Where is the problem? How to write a configuration in XC8 compiler? By the way I am a beginner in the microcontroller world. Can someone tell me what is wrong with my configuration?
#pragma config OSC = HS,OSCS = OFF
#pragma config PWRT = OFF,BOR = ON,BOVR = 45
#pragma config WDT = OFF,LVP = OFF
#pragma config DEBUG = OFF,STVR = OFF
#include<p18f4550.h>
void msdelay(unsigned int ms)
{
unsingned int x;
unsigned char z;
for(x = 0; x < ms ; x++)
for(z = 0; z < 165;z++);
}
void main(void)
{
TRISB = 0;
while(1)
{
PORTB = 0x55;
msdelay(500);
PORTB = 0xAA;
msdelay(500);
}
}