This error appears to be Microchips fault. Not MeLabs. DEBUG is a library command in the PBP 18F library, BUT, it's also defined as a register in the P18F4620.INC file Microchip provides with MPLAB.
The error is because you can't *re-define* DEBUG.
Open your P18F4620.INC file in your MPLAB directory.
Comment this line out --> DEBUG EQU H'0FD4'. Save, exit, you should be in business.
For some odd reason Microchip thinks this 18F series has a DEBUG register at location 0FD4h tucked away between OSCCON & T0CON.
Unless I'm missing something, my 4620 datasheet shows this particular register address as "unused".
I found the same deal in the 2525/2620/4525/4620 .INC files shipped with MPLAB. Go figure..!




Bookmarks