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

#DEVICE ICD=TRUE vs IDC =False

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



Joined: 05 Aug 2014
Posts: 24

View user's profile Send private message

#DEVICE ICD=TRUE vs IDC =False
PostPosted: Thu Aug 15, 2024 12:53 pm     Reply with quote

HI Guys
Need some help
I have redesigned a amplifier and remote with RS485 comms, I have it working correctly, both devices use a PIC16F18854. It is based on a previous design and I need the remote to work on the older amps which it does if I Compile with ICD=True set.
As soon as I compile with ICD= False or comment it out the Remote start to have comms issues with the older amps, Still works but not 100%, the new design all is working fine.
The Check sum is the same in both compiled versions.
Im compiling from with in MPLAB X IDE V5.35
My compiler Version is 5.074
I have found some posts about similar problems on the site but no definite fixes.
can anybody point me in the area where to look for differences?
Thanks
_________________
Neville
Ttelmah



Joined: 11 Mar 2010
Posts: 19518

View user's profile Send private message

PostPosted: Fri Aug 16, 2024 1:06 am     Reply with quote

Try compiling with:

#device ICD=

I remember back around your compiler version, with another chip close to
yours in family, that ICD=FALSE for some weird setup reason gave a
problem. Using the above fixed it.
Nevillestone



Joined: 05 Aug 2014
Posts: 24

View user's profile Send private message

#DEVICE ICD=TRUE vs ICD =False
PostPosted: Fri Aug 16, 2024 4:23 am     Reply with quote

Thanks will try
Did some futher testing and comms on startup is corrupted until a do a serial port reset.
but will try your solution.
_________________
Neville
temtronic



Joined: 01 Jul 2010
Posts: 9229
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Aug 16, 2024 5:28 am     Reply with quote

hmm, do you use the 'zero-ram' option ??
I remember having 'quirky' serial problems long ago ( V2.5ish...,yes, THAT long ago...)
After several days of this ,found out that during power on,power off,power on there was usually, enough energy in the PIC to keep some 'data' in RAM .
Since then I use the 'zero-ram' option before assigning any data to RAM variables.

I don't know if modern PICs 'zero-ram' or if it's 'Undefined' on powerup.
probably not your quirk, but thought you should know.
Ttelmah



Joined: 11 Mar 2010
Posts: 19518

View user's profile Send private message

PostPosted: Sun Aug 18, 2024 2:13 am     Reply with quote

I suspect what is happening here is that both results are actually right!....

Point is with the ICD=TRUE setting enabled, the boot will be a tiny bit
slower. The chip actually jumps into the debugger executive on boot 
before starting to run the actual program. This does quite a bit of setting
up 'ready' for the debugging.
Now without the ICD, one of the first things the compiler does, is setup and
initialise the UART.
If your hardware has the UART line not quite stable when the chip actually
starts, you can get a number of garbage characters being seen.
So what is happening is that when ICD is turned off, these are being seen....

Now two things.
Have you go PUT enabled?????.
This is needed especially when using the UART. Ensures the clock is stable
before the code starts. The internal code in the debug executive does test
the clock is stable before proceeding.

Then if you have, you could simply delay the UART boot. Add 'NOINIT'
to your #use RS232 declaration, and a few mSec into your code just
initialise the UART:

setup_uart(TRUE, YOUR_STREAM_NAME);
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