View previous topic :: View next topic |
Author |
Message |
o-milo
Joined: 20 Sep 2006 Posts: 4
|
MPLAB Debugger Error with PIC12F675 |
Posted: Mon Sep 25, 2006 8:31 pm |
|
|
Hi,
I tried to do in-circuit debugging with PIC12F675 using MPLAB IDE in debugger mode connected to ICD2. I'm using MPLAB IDE v7.42 and the compiler is PCWH v4.010.
I can program in programmer mode without any error and have checked that it functions correctly. But when I switch to debugger mode and tried to program or do single stepping/run/animate, I get the following outputs:
Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to target
Target Device PIC12F675 found, revision = Rev 0x10
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 Ready
Programming Target...
...Validating configuration fields
Connecting to debug executive
Entering Debug Mode
...Programming GOTO 0x00 command
ICD0083: Debug: Unable to enter debug mode. Please double click this message for more information.
MPLAB ICD 2 Ready
The following is my code (very simple just to blink the LED):
#include <12F675.h>
#FUSES NOWDT //No Watch Dog Timer
#FUSES INTRC_IO //Internal RC Osc, no CLKOUT
#FUSES NOCPD //No EE protection
#FUSES NOPROTECT //Code not protected from reading
#FUSES MCLR //Master Clear pin enabled
#FUSES NOPUT //No Power Up Timer
#FUSES BROWNOUT //Reset when brownout detected
#use delay(clock=4000000)
void main()
{
int i=0;
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_comparator(NC_NC);
setup_vref(FALSE);
while(1)
{
i ^= 0x20;
output_a(i);
delay_ms(1000);
}
}
Can anyone see anything wrong? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
o-milo
Joined: 20 Sep 2006 Posts: 4
|
|
Posted: Mon Sep 25, 2006 9:08 pm |
|
|
Hi PCM, thanks for the link. So does it mean that, PIC12F675 won't support debugging and I have to get the PIC12F675-ICD. Is that still the only way of doing it? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Sep 25, 2006 9:22 pm |
|
|
MPLAB ® ICD 2 Header Specification:
http://ww1.microchip.com/downloads/en/DeviceDoc/ICD2_Header_51292L.pdf
From page 2:
Quote: |
Some devices have no built-in debug circuitry. Therefore, special ICD
versions of these devices are required for MPLAB ICD 2 operation.
Other devices have built-in debug circuitry and do not require a header
to use MPLAB ICD 2. However, some pins and memory must be used to
support the ICD function. Therefore, for some of these devices, special
ICD versions offering additional pins (and sometimes memory) are
available to provide more transparent debugging capabilities. |
Quote: | Is that still the only way of doing it? |
Develop the code on a larger PIC that has built-in ICD2 support,
such as a 16F877. Move it to the 12F675 later. Watch the size
of the code during development, to make sure it doesn't exceed
the ROM size of the 12F675. |
|
|
|