|
|
View previous topic :: View next topic |
Author |
Message |
Steove
Joined: 24 Aug 2009 Posts: 2 Location: Australia
|
Problem using Debug with MPLAB + CCS + PICKIT 2 on 18F2550 |
Posted: Mon Aug 24, 2009 4:23 pm |
|
|
Hi all,
New to much of this, but I've searched all the forums and cannot find an answer.
I am working on a little project using a PIC 18F2550. The tools are below
MPLAB IDE v8.15a
CCS ver 4.088
PICKIT 2 (red button)
I'm coding within MPLAB using the CCS plugin and dropping the code into the micro using "Debugger - Program" with the PICKIT 2
When testing a simple program such as blinking a couple of LED's or counting everything works well. I can debug with no problem and everything is stable. Viewing variables works fine and stopping and starting is no problem.
However, if I attempt to debug a more complex program such as writing to an LCD display the program won't work, and the debugger seems to get lost, All control of program flow won't respond. I know the code works fine as if I download the HEX file directly (not in debug mode) it runs with no problem.
I have seen somewhere that a special linker file must be used with MPLAB but I can't find were to get them, or how to use them with CCS. Could this be the problem or am I completely off track??
Any help would be appreciated.
Cheers.... |
|
|
Steove
Joined: 24 Aug 2009 Posts: 2 Location: Australia
|
|
Posted: Wed Aug 26, 2009 6:48 am |
|
|
Fixed!!!
I am now able to debug within the MPLAB IDE using CCS.
It turned out to be a hardware issue, I was using the two pins 27 (PGC) and 28(PGD) for driving the LCD display, these are also used by the PICKIT while debuging.
This was fine when only programing and then running, they were not interacting, however, once in debug mode they confused each other.
This may be of help to someone in the future.
Steve. |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Mon Dec 13, 2010 9:50 pm |
|
|
Well, thanks Steve for putting me on to the solution to my problem. Pickit2, MPLAB and CCS compiler. Program ran fine in stand alone, but when in debug mode, my LCD was blank but the debug worked fine and I could see it step through the LCD init sequence. I had cleverly (?) used the pot on the PicKit2 LPC (Low Pin Count) board with a 18F14k22 processor for adjusting the contrast of the LCD. If you look at the schematic, the 10k pot is across +5 and ground with the wiper going through a 1k resistor to RA0 which is also part of the ISP and debug circuit. Under normal conditions, that pin was being left in the input mode so the pot was setting the contrast level on the LCD. In debug mode, they drive that pin in the output mode. Solution is to lift the 1k resistor, breaking the path from the pin to the pot. Now the pot just sets the contrast voltage on the LCD. Hope this helps someone else who wanders down this path and decides that pot would make a great way of setting the contrast voltage :-)
That is the little board that comes with the PicKit2 - normally has a 16F690, but the 18F14K22 drops right in with only a few software changes and no changes to the hardware :-)
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
|
|
|
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
|