CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

What's the trick to get a program to run standalone?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Joel777



Joined: 01 Oct 2006
Posts: 4

View user's profile Send private message

What's the trick to get a program to run standalone?
PostPosted: Sun Oct 01, 2006 12:40 am     Reply with quote

I recently received my ICD-U40, PIC16F877A Rev 1 development board, and v. 3.249 CCS PCW IDE. Great stuff! However, although it works fine in debug mode with PC & ICD connected, I cannot get it to work in standalone mode. I've found some good tips in other posts about the NODEBUG fuse, being sure to disconnect dev board from ICD, downloading the COF file from the ICD utility, and also from one gentleman who got an email from CCS saying he had a bad h/w rev. Are any of you aware of any known issues with these versions of hardware & software? Or any suggestions about something I may be overlooking? This doesn't seem like it should be a difficult thing to accomplish.
Thanks in advance,
Joel
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Oct 01, 2006 1:17 am     Reply with quote

Two solutions:

1. Use the ICD.EXE program:
http://www.ccsinfo.com/forum/viewtopic.php?t=20686

2. Change a setting in the Options menu within the IDE:
http://www.ccsinfo.com/forum/viewtopic.php?t=27744&start=2
Joel777



Joined: 01 Oct 2006
Posts: 4

View user's profile Send private message

Thanks, but those don't work for me...
PostPosted: Sun Oct 01, 2006 2:48 pm     Reply with quote

Hmmm, thanks, but neither of those works for me. I did get it working, though. For posterity and future forum readers wandering this same pilgrimage:

1) Been using the ICD application to transfer COF files already. Turns out that is a necessary piece of the puzzle, but there is more to it.

2) There is no such option in my version of the IDE. The previous post even alluded to that: "...there is no different [Options/Debugger-Programmer menu item] setting..."

After trying different things, here is what finally works for me:

a) Keep all settings & includes same as used for debugging. Don't add NODEBUG fuse and don't delete #device ICD=TRUE.

b) Compile from within IDE, then close IDE.

c) Launch the ICD.EXE utility mentioned and download to target the COF file just created or updated by the IDE compiler.

d) Now it works standalone!

This approach works, but seems kind of weird, so I will contact CCS for help and will post any new details.

Thanks again,
Joel
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Sun Oct 01, 2006 7:17 pm     Reply with quote

You dont have to close the IDE just go to tools and run the ICD from there.
Here's what you might want to try.
For ICDU40
Remove or comment out the ICD=TRUE and close the Debugger. Recompile
then with tools >ICD download to your target. There are a couple of message boxes that are alerts and a final message box saying your target should be running. It will run with the 6 wire telco cable attached.

If you engage the debugger without the ICD=true it will recompile and patch in the debug code for you. You don't need to mess with the DEBUG fuse either.
Joel777



Joined: 01 Oct 2006
Posts: 4

View user's profile Send private message

PostPosted: Sun Oct 01, 2006 8:38 pm     Reply with quote

Quote:
You dont have to close the IDE just go to tools and run the ICD from there.

That works great, thanks! Had tried that originally as it is recommended in CCS' Exercise Book, but quit trying it thinking it was buggy.
Quote:
Remove or comment out the ICD=TRUE and close the Debugger. Recompile
then with tools >ICD download to your target.

I promise that does not work for me. That's what I tried first since it's what CCS' book recommends. If I follow your procedure (and theirs) except leave the #device ICD=TRUE, it works fine.

Thanks again,
Joel
Joel777



Joined: 01 Oct 2006
Posts: 4

View user's profile Send private message

The Last Chapter in This Story
PostPosted: Tue Oct 03, 2006 8:08 pm     Reply with quote

Okay, for those who may follow this post later, here is what happened:

1) My development board has a +3.3 V regulator on it, not a +5 V regulator (an anomaly, I'm told).
2) That was causing the PIC not to run standalone unless the NOBROWNOUT fuse was set.
3) I was not setting it explicitly.
4) With ICD=TRUE, the compiler was setting that fuse for me, explaining this behavior.

CCS Tech Support was very helpful and offered some great advice. Let me share that with you folks here:

"The [ICD] utility [which can be run from the menu within the IDE] can use the HEX file, COD file or COF file. The results are the same. Removing the ICD=TRUE will get you extra RAM/ROM and is recommended. If your code does not RUN without the ICD=TRUE it might be because of certain fuses forced when ICD=TRUE is used. Compare the bottom of your LST file with and without ICD=TRUE to determine what fuses your program might depend on."

Again, in my case the culprit was the NOBROWNOUT fuse. You will experience this situation if your target board is running +3.3 V and you have not tweaked the brownout threshold parameter.

End of line.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group