The fuses are what set the configuration of the PIC, for example the oscillator setting, and the watch dog timer.
The watchdog timer will reset your chip if the watchdog flag is not cleared before the timeout, kind of like a failsafe keepalive, if the PIC doesnt respond, something has gone wrong, so reset the controller.
Your code natively flashed will put the PIC into a constant reset loop, much like leaving MCLR floating. (This should be pulled high with a resistor, 10k should do it, btw), it has the same effect.
So, what we do is turn this off, or put code to make the doggy happy. Easiest to turn it off.
Likewise with the OSC setting, we need to tell it what kind of clock we are using, in your case i'm guessing external so XT would be selected.
The settings for this can be done within MPLAB IDE, or in code, I find it easier to select it in code, to do this you need to define some configuration options within the code itself.
Fuses are also known as Configuration Bits.
I have also in the code below defined the crystal clock frequency. Set to 4MHz to suit your application.
Code:
#include "p18f452.h"
#include <usart.h>
#include <stdio.h>
#pragma config WDT = OFF
#pragma config OSC = XT
#define GetSystemClock() 4000000
#define GetPeripheralClock() GetSystemClock()
#define GetInstructionClock() (GetSystemClock() / 2)
void read_scanner (void)
{
RCSTA=0x90;
RCSTA I have converted from Binary just as I find it easier to read as Hex, there is no impact on changing this.
The FOR loop you are using has CloseUSART within the loop, so wouldn't this after receiving 1 character shut off the port?
Wilksey