View previous topic :: View next topic |
Author |
Message |
kaz
Joined: 15 May 2009 Posts: 12
|
Chip runs with ICD=TRUE, but code only compiles without it. |
Posted: Wed Jul 01, 2009 1:47 pm |
|
|
Chip: PIC16F886
Compiler Version: 4.095
IDE: MPLAB 8.33
I'm very curious as to the details of what "#fuses ICD=TRUE" does exactly.
When programming with an ICD2, I need "ICD=TRUE" in there or else the chip won't start itself after a power reset. But "ICD=TRUE" also kills me today, because my program that suddenly fit with 8% ROM left, no longer fits when "ICD=TRUE". The routine sizes seem atrociously larger once I put that in.
I believe it's the debugging overhead added to the program, I'd like to take this out because I don't need to step through my program at this point. I've tried "#fuses NODEBUG", but to no avail.
What exactly is going on here? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jul 01, 2009 1:58 pm |
|
|
You want to make it work in Standalone mode.
1. Remove the #device ICD=TRUE statement.
2. Go into the MPLAB Project Build Options menu, and "untick" the
box for "Compile for use with ICD Debugger".
3. Remove the DEBUG fuse from your #fuses statement.
4. Re-compile.
5. Go to the MPLAB Programmer menu (not the Debugger menu)
and connect to the device.
6. Program it from within the Programmer menu (not the Debugger menu).
Quote: | Compiler Version: 4.095 | Also, I'm curious about vs. 4.095. The CCS versions page shows
the latest version is 4.093. Also the Updates page shows vs. 4.093.
Do you really have 4.095 ? If so, where have you looked to see the
version number ? |
|
|
kaz
Joined: 15 May 2009 Posts: 12
|
|
Posted: Wed Jul 01, 2009 2:12 pm |
|
|
PCM programmer wrote: | You want to make it work in Standalone mode.
2. Go into the MPLAB Project Build Options menu, and "untick" the
box for "Compile for use with ICD Debugger".
Quote: | Compiler Version: 4.095 | Also, I'm curious about vs. 4.095. The CCS versions page shows
the latest version is 4.093. Also the Updates page shows vs. 4.093.
Do you really have 4.095 ? If so, where have you looked to see the
version number ? |
I may be forgetful. I thought the latest version was 4.096, but remember not having that one. It's actually 4.093 (confirmed with ccsc.exe /v).
I removed ICD=TRUE, that check-box for "Compile for use with ICD Debugger" was already unchecked (which is weird, because I know I've debugged before), and I've put in "#fuses NODEBUG" to ensure that debugging doesn't make it in.
I'm currently using these flags.
Code: | #fuses NODEBUG,INTRC_IO,NOWDT,BROWNOUT,NOFCMEN,NOIESO,MCLR
#device ADC=10
#device ANSI
#use delay(internal=8M)
#use fast_io(B) |
Edit: The verification method I'm using is lazy. I'll put in a line or two to blink an LED to make sure it's not a problem with my code. But I'm so very certain it's an odd behavior with debug and ICD. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jul 01, 2009 2:20 pm |
|
|
Post a small but complete "Hello World" program. Confirm that it fails
in your environment.
I'm downloading MPLAB 8.33 now and will duplicate your environment.
But I need a small test program from you. (That compiles without errors). |
|
|
kaz
Joined: 15 May 2009 Posts: 12
|
|
Posted: Wed Jul 01, 2009 2:47 pm |
|
|
Bah. Test program worked in stand-alone mode. I guess it really is a problem with the large program. Thanks for your time.
Edit: Suddenly it works? You fixed it! Or more distressingly, the break is still lurking around somewhere. |
|
|
|