|
|
View previous topic :: View next topic |
Author |
Message |
ronald Guest
|
Problem with program address 0x1 |
Posted: Thu Oct 21, 2004 7:46 pm |
|
|
Hi!
everytime i try to debug/program my PIC16f877 using mplab environment, i get a error, reading
"Verify failed. Mem type: Program. Address: 0x1 Expected value: 0x3000, Val read: 0x0"
even if my code is just
#device PIC16f877 CICD=TRUE
void main()
{ int x; x=2}
does anyone know what resides in adress 0x1 and how can i solve this problem? help is greatly aprreciated! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Oct 22, 2004 2:40 pm |
|
|
This is really and MPLAB and ICD2 problem.
In the following thread on the Microchip forum, check some of the
things that HH says. (About 3/4 of the way down the thread).
http://forum.microchip.com/tm.asp?m=47704&mpage=1&key=verify+failed&anchor#48374
In other words, get the basics going first. Don't try to debug.
Just get it to "Connect". (There is a "Connect" command in the
MPLAB Programmer menu. Try it.)
Then do "Blank check", etc. Get that working first.
Also download the ICD2 poster if you don't have it.
http://ww1.microchip.com/downloads/en/DeviceDoc/51265c.pdf
You probably got this poster in your ICD2 box. Check that you
are doing everything it says, correctly. |
|
|
ronald Guest
|
How do i do a blank check? |
Posted: Tue Oct 26, 2004 8:57 pm |
|
|
Hi,
thanks, got the connect up and working.
how do i do the blank check you mentioned?
also, the problem arise when i click debugger->program
it programs alright, but the problem crops up in the verify stage.
any advice? |
|
|
ronald Guest
|
Would really appreciate any help!!! |
Posted: Wed Oct 27, 2004 9:48 am |
|
|
Hi, If anyone can give me any help at all, i would greatly appreciate it! Been stuck here for 2 weeks already...
A detailed description of my problem and situation is as follows:
I seem to have a problem programming my microchip PIC16F877 for the first time. I'm using MPLAB 6.60 with an ICD2, in a PICC compiler.
Degguer->Connect works, Build is also successful. The problem arises when i use Debugger->Program. The message that appears is:
Programming Target...
...Erasing part
...Programming Program Memory (0x0 - 0x1EFF)
...Loading DebugExecutive
...Programming DebugExecutive
...Programming Debug Vector
Verifying...
...Program Memory
ICD0161: Verify failed (MemType = Program, Address = 0x1. Expected Val = 0x3000, Val Read = 0x0)
ICD0275 Programming failed
My code is extremely simple, just a test:
#device PIC16f877 ICD=TRUE
#fuses XT
void main()
{ int x;
x=3; }
Does anyone know how i can solve this adress 0x1 problem? I read about doing a blank check by the moderator, how do i go about doing that? also is that the way to solve my problem?
Really really appreciate help on this issue, been stuck here for the last 2 weeks!!!
Thank you so much in advance.
ronald
Additional details are:
Configure-> Configuration Bits are:
Oscillator XT (i'm using a 4.00Mhz crystal, one of those 4 legged rectangular box things)
Watchdog Timer Off
Power Up Timer On
Brown out Detect Off
Low Voltage Program Disabled
Flash Program Write Enabled
Data EE Read Protect Off
Code Protect Off
Debbuger->Settings->Power read:
Target Vdd: 5.04
Target Vpp: 13.42
MPLABICD2 Vpp: 13.50
i'm pretty sure i got the cicuit set up properly as showed in the poster that came with the ICD2. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Oct 27, 2004 10:51 am |
|
|
Where did you get the board? If you made it, then look there. Make sure that you are not using the programming data and clock lines for anything else. Also make sure that you have all the power and gnds connected. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Oct 27, 2004 1:02 pm |
|
|
In addition to what Mark said, I would say that your program is
a little too simple.
At a minimum, you need to add NOWDT and NOLVP to your #fuses
statement. That probably has nothing to do with your current
problem, but it should be fixed.
In fact, I would suggest that you use the program below as
your "first program", instead of what you're using.
This program toggles Pin B0 every 1/2 second. You don't even
need an oscilloscope to see that this program is running. You
can put a logic probe or a volt-meter on the pin and see it changing
state every 500 ms.
You asked how to do a "Blank Check". Instead of clicking on
the "Debugger" menu in MPLAB, click on the "Programmer" menu.
Then click on "Select Programmer" and pick "MPLAB ICD 2".
Then click "Connect". If everything is wired correctly, and powered-up
properly, it should connect OK. Then click on "Erase Part" in the same
drop-down menu. Then click "Blank Check" in the same menu.
Don't even try to use the Debugger, or set ICD=TRUE, etc., in your
program initially. Just get it going while using ICD2 as a programmer.
The following program assumes you're using a 4 MHz crystal.
If not, then carefully edit the clock frequency to match your crystal
frequency. If your crystal frequency is above 4 MHz, then change
the XT fuse to HS. And as Mark says, it would be helpful to know
where your board came from. That info could lead us to ask questions
about the crystal oscillator circuit, if necessary.
Code: | #include <16F877.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 4000000)
//==================================
void main()
{
while(1)
{
output_high(PIN_B0);
delay_ms(500);
output_low(PIN_B0);
delay_ms(500);
}
} |
|
|
|
ronald Guest
|
Thanks! Worked Beautifully |
Posted: Mon Nov 01, 2004 1:10 am |
|
|
Thanks for all the help!
The code works beautifully!!!
ronald |
|
|
|
|
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
|