kcress
Reged: Feb 22 2005
Posts: 42
|
|
Hello!
I've been struggling with an issue for tooo long. I thouhgt someone might be able to shed some light or give me a direction to chase down.
I'm running a PIC18F4520 developing with MPLAB's IDE.
When I'm in the development environment the 4x20 LCD display works flawlessly.
Then after: 1) I tell the IDE to not compile the ICD code. 2) Cancel the MPLAB ICD2 emulator. 3) Reconfigure to the MPLAB ICD2 programmer. 4) Recompile. 5) Program the PIC. 6) Release the PIC from RESET.
The display still works but has occasional flipping characters, misplaced characters, lost characters, and if left alone the display will eventually crash with various issues like lost lines or lines with blocks only, etc, etc, ad nauseum...
I suspect it's timing related but since I have no clear understanding of what the executional differences are between emulating and not, I'm having a hard time figuring out where to look.(and I have been looking....)
I thought there was zero speed difference between emulation and not emulating when just straight running. Am I mistaken?
|
swanny
enthusiast
Reged: Sep 12 2008
Posts: 247
Loc: New Zealand
|
|
Sounds like the delays.
Can you check your delays with a scope (to compare)?
Edited by swanny (Fri Jul 03 2009 06:58 AM)
|
jtemples
Guru
  
Reged: Oct 16 2003
Posts: 1605
Loc: Southern California
|
|
There isn't any speed difference. The only thing that changes is that in debug mode, the linker must reserve certain regions of RAM (and possibly ROM) for the debugger, which could cause some of your RAM objects to be at different addresses in the two different compilations. Thus one compilation might mask or change the behavior of a bug in your code that shows up in the other compilation.
|
kcress
Reged: Feb 22 2005
Posts: 42
|
|
swanny; Thanks for the suggestion. I did scope everything. I eventually even attacked it with a logic analyzer.
After many hours of trying everything. I built three more identical boards. None of them showed the same LCD misbehavior. Not a hint. So I'm chocking it up to a bad display... Probably the most expensive display I will ever touch.(now)
jtemples; I believe that was happening because the issue did eventually manifest in debugger mode too.
Thanks.
|
swanny
enthusiast
Reged: Sep 12 2008
Posts: 247
Loc: New Zealand
|
|
Good that you got it resolved.
It still sounds like something might be out of spec - voltage, timing etc. It could be that your display is at the edge of (or past) in a certain tolerance.
Or it's just a dud 
Either way, if the failure rate is low enough it wont matter.
|