Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 4th April 2007, 04:56 AM   (permalink)
Experienced Member
 
williB is on a distinguished road
Default Debugging 877A with MPLAB

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.
williB is offline   Reply With Quote
Old 4th April 2007, 05:08 AM   (permalink)
Experienced Member
Pommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to behold
Default

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.
Pommie is offline   Reply With Quote
Old 4th April 2007, 05:55 AM   (permalink)
Experienced Member
Pommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to behold
Default

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 by Pommie; Today at 04:13 PM.
Pommie is offline   Reply With Quote
Old 4th April 2007, 01:17 PM   (permalink)
Experienced Member
 
evandude is just really niceevandude is just really niceevandude is just really nice
Default

Quote:
Originally Posted by williB
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...
__________________
EEgeek.net
evandude is offline   Reply With Quote
Old 4th April 2007, 01:31 PM   (permalink)
Experienced Member
 
williB is on a distinguished road
Default

Quote:
Originally Posted by evandude
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 !
williB is offline   Reply With Quote
Old 4th April 2007, 02:20 PM   (permalink)
Experienced Member
 
Blog Entries: 4
blueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to behold
Send a message via Skype™ to blueroomelectronics
Default

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.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is online now   Reply With Quote
Old 5th April 2007, 12:46 AM   (permalink)
Experienced Member
 
williB is on a distinguished road
Default

Thanks bill , i'll try that..

I got the debugger working BTW.
williB is offline   Reply With Quote
Old 6th May 2007, 08:50 PM   (permalink)
New Member
albertodg2 is on a distinguished road
Default

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
albertodg2 is offline   Reply With Quote
Old 7th May 2007, 04:53 AM   (permalink)
Experienced Member
 
Blog Entries: 4
blueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to behold
Send a message via Skype™ to blueroomelectronics
Default

Quote:
Originally Posted by williB
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.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is online now   Reply With Quote
Old 7th May 2007, 11:44 AM   (permalink)
Experienced Member
 
Blog Entries: 2
gramo is just really nicegramo is just really nicegramo is just really nicegramo is just really nice
Default

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


PIC's that it supports for debugging:

Quote:
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.
__________________
Spency.

PIC Micro's - Your mind is the limit

PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net
gramo is offline   Reply With Quote
Old 7th May 2007, 03:53 PM   (permalink)
Experienced Member
bbarney is on a distinguished road
Default

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
bbarney is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Inchworm components gregmcc Micro Controllers 43 18th March 2007 01:37 PM
Need help badly on Inchworm and MPLAB thushy Micro Controllers 14 11th March 2007 06:05 PM
Some Question About Inchworm Ayne Micro Controllers 29 7th March 2007 03:07 AM
Inchworm project started williB Micro Controllers 69 5th March 2007 06:55 PM



All times are GMT. The time now is 11:36 PM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.