Not defining ICD_DEBUG works well in some cases, but it is absolutely required for correct operation by your code. This is what the ICD_DEBUG define does: o Reserves the last 256 code-words for the ICD o Reserves a few RAM locations for the ICD o Reserves a stack-level for the ICD o Inserts a 'nop' in address zero o Sets the reset vector to address 1 All this is required by the ICD module. The reason for this is that the ICD inserts a bit of code at the end of the code-space. This is the code that communicates with the ICD. When downloading your code with ICD enabled, a 'call' (I think it was) will be inserted at address zero, branching to the ICD code. This action does not care if you already have code in address zero or at the end of the code-space, or if you're using the specified RAM. If your code works without the define, you've been lucky. Dag S DA> Hi, Alan, DA> I have been using the ICD for a long time and I never put this DA> definition in my code, actually I never knew that I should do it. DA> The only thing I do is set the ICD development mode and it always worked DA> well DA> So I assume that it's correct. DA> Thanks DA> Dinho DA> -----Mensagem original----- DA> De: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU] DA> Em nome de Alan Gorham DA> Enviada em: sexta-feira, 1 de fevereiro de 2002 13:05 DA> Para: PICLIST@MITVMA.MIT.EDU DA> Assunto: [PIC]: An ICD with CC5x question DA> Hi to all CC5x users. DA> I have a small question for you concerning the Microchip ICD debugger: DA> In the CC5x manual section 1.6 'defining the PICmicro device' there is a DA> note that says "ICD debugging requires defining a symbol first" DA> And the manual also says that one way of doing this is '#define DA> ICD_DEBUG' DA> Now, I've never done this in my program listing, but the ICD seems to DA> work OK. Does the fact that I have already set the Development Mode in DA> MPLAB to 16f877-ICD avoid the need for the above definition, or am I DA> storing up trouble for myself? DA> Thanks DA> Alan DA> -- DA> http://www.piclist.com hint: PICList Posts must start with ONE topic: DA> [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads DA> -- DA> http://www.piclist.com hint: PICList Posts must start with ONE topic: DA> [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads