Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Debugging 877A with MPLAB

Status
Not open for further replies.

williB

New Member
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.

HTH

Mike.
 
Here's a picture showing how I connected a 16F876 to the debugger.

The other things you can see are a a 20MHz crystal and a 38k clock crystal + rs232 level shifter.

Mike.
 
Last edited:
williB said:
i have the config bits selected to use the built in RC oscillator
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...
 
evandude said:
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...
Oops that could be it then :)

Pommie , nice layout , i've got mine on a breadboard also , but it doesnt look half as neat as that.

i'll get a clock hooked up and let you know how it comes out ..

Thanks Evandude !
 
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**
 
POMMIE
You CAN raise the schematic one and which are the connections of the cables that tune in with RB6 RB7, MLCR, VPP TO WHERE THEY GO
 
williB said:
Thanks bill , i'll try that..

I got the debugger working BTW.

Glad to hear it :)

Pretty soon the 16F887 will be the chip of choice over the 16F877A. But then again people still use the 16F84.
 
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**

PIC's that it supports for debugging:

PIC12F683
PIC16F684, 685, 687, 688, 689, 690
PIC16F883, 884, 886, 887
PIC16F913, 914, 916, 917, 946

$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
 
Status
Not open for further replies.

Latest threads

Back
Top