View previous topic :: View next topic |
Author |
Message |
Nevillestone
Joined: 05 Aug 2014 Posts: 24
|
#DEVICE ICD=TRUE vs IDC =False |
Posted: Thu Aug 15, 2024 12:53 pm |
|
|
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
|
|
Posted: Fri Aug 16, 2024 1:06 am |
|
|
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
|
#DEVICE ICD=TRUE vs ICD =False |
Posted: Fri Aug 16, 2024 4:23 am |
|
|
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
|
|
Posted: Fri Aug 16, 2024 5:28 am |
|
|
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
|
|
Posted: Sun Aug 18, 2024 2:13 am |
|
|
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); |
|
|
|