below is the output from MPLAB
my question is how should the Target pic be hooked up physically , to get the debug feature to work?
see below
Code:
Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to MPLAB ICD 2
Target Device PIC16F877A found, revision = b4
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 Ready
Resetting Target
Resetting Target
MPLAB ICD 2 Ready
MPLAB ICD 2 Ready
Programming Target...
...Validating configuration fields
...Erasing Part
...Programming Program Memory (0x0 - 0x6F)
...Loading DebugExecutive
...Programming DebugExecutive
...Programming Debug Vector
Verifying...
...Program Memory
...Debug Executive
...Debug Vector
...Verify Succeeded
Programming Configuration Bits
.. Config Memory
Verifying configuration memory...
...Verify Succeeded
Connecting to debug executive
ICD0083: Debug: Unable to enter debug mode. Please double click this message for more information.
MPLAB ICD 2 Ready
below is a pascal pgm to output the adc to ports B & D on a 877A.
Nigel will like this..
the problem is when i compile it and get the Hex output file Imported into MPLAB , i get the IDC 00083 Debug error .
i have the config bits selected to use the built in RC oscillator
Code:
program adconthe877A;
var temp_res : word;
begin
ADCON1 := $80; // Configure analog inputs and Vref
TRISA := $FF; // PORTA is input
TRISB := $3F; // Pins RB7 and RB6 are output
TRISD := $0; // PORTD is output
while TRUE do
begin
temp_res := Adc_Read(0);
PORTD := temp_res; // Send lower 8 bits to PORTD
PORTB := word(temp_res shr 2); // Send 2 most significant bits to PORTB
end;
end.
Have you got debug enabled in the config?
Do you leave SFR location 0x70 unused?
Have you left programming area 0x1f00 - 0x1fff free?
The above is required by the debug executive.
I have also come across some Microchip code that places a NOP at location zero and has a comment that it is required by ICD2. However, I have not found any reference to this in the help files.
What built in RC oscillator? the 877A doesn't have one... It allows you to use an external RC oscillator (though I don't see why you'd want to), but it doesn't have an internal one like many of the other PICs do...
What built in RC oscillator? the 877A doesn't have one... It allows you to use an external RC oscillator (though I don't see why you'd want to), but it doesn't have an internal one like many of the other PICs do...
I've got the schematic for the 16F877A in my Quick Project document and some code for it on my site... And yes it runs in debug mode. I guess it's too hard to find, I'll make a link to projects on the main page. **broken link removed**
It's a little of topic, but still there; I was just reading up further on the PICKit 2 today, and found out that it too supports debugging **broken link removed**
$34.95 From the company that makes the PIC's (Microchip), and it ships fully assembled, guaranteed to work for around ~US$12 to anywhere in the world. Another handy feature is that it is cased, uses USB, and looks nothing like a cheap gimmick.
Oh, and the package includes all the software and;
PICKit 2 programming tutorials and a series of twelve lessons are provided that cover I/O, interrupts, A/D converters, data tables and timers, with an additional lesson covering debugging features. All source code for the lessons is furnished.
I do like your website Gramo it should be high on the must see list for anybody who use's basic very helpful and so is Bill's Blueroom at least their at the top of my list,thank you for the good sites