Hi Ed,
OK, several things here,
First the oscillator.
When you DEFINE OSC xx you are simply informing the compiler at which speed YOU intend to run the PIC so that it (the compiler) can figure out how many cycles it takes to PAUSE 100 or generare PWM with a certain frequency etc etc. It does not SET the frequency of the PIC in any way shape or form and it does not set any CONFIG fuses/bits either. That's up to you to do - either thru the compiler or manually in the programmers software. For a 20MHz crystal or resonator you want it set to HS.
Second, DEFINE LOADER_USED 1
This tells the compiler that you've already programmed the PIC with a small program (called a bootloader) and that it (the compiler) needs to stay away from certain areas of the program memory (or it will overwrite the bootloader). The bootloader allows the PIC to reprogram itself via a serial connection (no need for a programmer except for getting the bootloader into the PIC to begin with). It's generally used with the MicroCode Loader (but there others). So, if you're not using a bootloader don't tell the compiler that you are. (I don't think it matters in this particular case though).
Third, the MicroCode Studio ICD
To use this the PIC must have its USART pins wired thru a RS232 level converter like the MAX232 and you must specifically compile the program for use with the debugger. This is done with the ICD compile button in MicroCode Studio, THEN you program the PIC with the generated .hex file and THEN you can use the "play button" etc to run the program, set breakpoint etc. There's guide available at Rentron - read it!
/Henrik.
Bookmarks