Powered by Invision Power Board


Forum Rules Forum Rules (Please read before posting)
  Reply to this topicStart new topicStart Poll

> 16f877 Programming Error
heuron
Posted: August 21, 2008 04:09 am
Reply to this postQuote Post


Forum Addict
******

Group: Trusted Members
Posts: 549
Member No.: 8,708
Joined: March 20, 2007




hey guys, when i try to load a totally simple program onto my 16f877 pic i get this really wierd error:

rom programming error at 0x000
good 0x2804
bad 0x3FFF

by the way 2804 is the first smidgen of the hex i want to put in it. any ideas as to what i am doing wrong? the settings are on all the right spots, its in the programmer correctly and all...

help appreciated.
PMEmail Poster
Top
mankku
Posted: August 21, 2008 05:04 am
Reply to this postQuote Post


Forum Addict ++
*******

Group: Spamminator Taskforce
Posts: 3,615
Member No.: 9,683
Joined: June 05, 2007




Could the PIC be write protected?

Mankku
PMEmail PosterUsers Website
Top
Abdullah M.A.
Posted: August 21, 2008 06:25 am
Reply to this postQuote Post


Forum Addict ++
*******

Group: Spamminator Taskforce
Posts: 4,289
Member No.: 10,604
Joined: August 16, 2007




You are sure from your PIC work properly???
Did you check the read instruction (just to check) before you programming
your PIC??

Abdulla


--------------------
"A scientist can discover a new star, but he cannot make one. He would have to ask an engineer to do that."
"For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."
PMEmail PosterUsers Website
Top
heuron
Posted: August 21, 2008 03:36 pm
Reply to this postQuote Post


Forum Addict
******

Group: Trusted Members
Posts: 549
Member No.: 8,708
Joined: March 20, 2007




how do i check the read instruction? i just usually press f9, do the fuses and it goes. this pic i got off of jameco i think, now its new out of the box, so i dont think its actually write protected. thanks
PMEmail Poster
Top
Abdullah M.A.
Posted: August 21, 2008 05:20 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Spamminator Taskforce
Posts: 4,289
Member No.: 10,604
Joined: August 16, 2007




QUOTE (heuron @ August 21, 2008 06:36 pm)
how do i check the read instruction?

There are many selects for many instructions within them you will find Read, Erase
,............,&programming.
What is the name of your program??

Abdulla


--------------------
"A scientist can discover a new star, but he cannot make one. He would have to ask an engineer to do that."
"For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."
PMEmail PosterUsers Website
Top
heuron
Posted: August 21, 2008 09:21 pm
Reply to this postQuote Post


Forum Addict
******

Group: Trusted Members
Posts: 549
Member No.: 8,708
Joined: March 20, 2007




i am doing it with assembly, but the hex programmer is called 'Micropro', it was the cheapest one i could find...

thanks
PMEmail Poster
Top
kl27x
Posted: August 22, 2008 02:14 am
Reply to this postQuote Post


Forum Addict ++
*******

Group: Spamminator Taskforce
Posts: 4,269
Member No.: 4,223
Joined: February 06, 2006




Are you using LVP or HVP? You might wanna try to hold down the LVP pin, just in case. There is an issue with some chips from the factory that causes a problem, even if you are using HVP. I don't know that it's your problem, but it would be easy enough to check.
PMEmail Poster
Top
heuron
Posted: August 22, 2008 02:20 am
Reply to this postQuote Post


Forum Addict
******

Group: Trusted Members
Posts: 549
Member No.: 8,708
Joined: March 20, 2007




what exactly are lvp and hvp? is that one of the things in the fuses? i tried writing a program for this already in pbasic, which takes care of the fuses for you, so i dont think its that, but i will try screwing around with the hvp and lvp words...
thanks
PMEmail Poster
Top
kl27x
Posted: August 22, 2008 02:51 am
Reply to this postQuote Post


Forum Addict ++
*******

Group: Spamminator Taskforce
Posts: 4,269
Member No.: 4,223
Joined: February 06, 2006




They aren't part of the configuration or program. They are the type of programming hardware you are using: Low/High Voltage Programming. This is dependent on the type of programmer you use. IIRC, some of those older 16F PICS have a LVP enable pin which must be held to ground during LVP, but some of them have a problem where you need to hold it down for HVP, too... at least for the first burn.

I've never actually seen a low voltage programmer, DIY or otherwise, for sale anywhere. I wonder who, exactly, uses them. smile.gif
PMEmail Poster
Top
heuron
Posted: August 22, 2008 03:44 am
Reply to this postQuote Post


Forum Addict
******

Group: Trusted Members
Posts: 549
Member No.: 8,708
Joined: March 20, 2007




im pretty sure this is a hvp programmer or whatever the normal is, it works fine with 16f627a, i was a little shocked when i couldnt get this thing to work at all. nothing i do seems to get it to be able to program. someone mentioned something about a factory setting?
PMEmail Poster
Top
heuron
Posted: August 22, 2008 03:59 am
Reply to this postQuote Post


Forum Addict
******

Group: Trusted Members
Posts: 549
Member No.: 8,708
Joined: March 20, 2007




awww man i got it to work for just one time when i did something random with the fuses, but now it does not work again, just gives me the same error. i think it had something to do with the lvp fuse being 'enabled'...?

thx
PMEmail Poster
Top
Shocker
Posted: August 23, 2008 05:41 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,634
Member No.: 3,558
Joined: November 06, 2005




QUOTE (kl27x @ August 22, 2008 02:51 am)
I've never actually seen a low voltage programmer, DIY or otherwise, for sale anywhere.  I wonder who, exactly, uses them. smile.gif

A picstart plus is a low voltage programmer. We have a few at work. I'm lead to believe that they are used to program pics that cant handle high voltages. I assume a high voltage is over 5V to a pic.
When a normal pic (one that ain't a low voltage pic) gets programed the reset pin has 13V applied to it. This allows the pic to be programed. If the reset pin is isn't held at this within a few microseconds/milliseconds (cant remember exactly how long) it will try to run and you wont be able to burn to it.


Are you sure the pic can be programed by the programmer? I know the cheaper programmers can only programme certain chips. I bought a microchip icd 2, you can program most of the pics manufactured.

Are you sure its a 16F877? Have you tried another pic? Microchip have a failure rate of 1 in every million. You might be the unlucky one.

Have you selected the correct pic in the development software? Pics have different programing pins. Your software needs to know which pins to use to program the pic.

Is the pic placed in the programmer correctly? Is it in the correct position and polarity. I know a picstart plus has a 40 zif socket that you can use to program 8 pin pic's.

Are the wires okay from the programmer to the socket/pic/programming attachment? Your development software will give random memory location errors if a wire is snapped or if its partly snapped.

Have you plugged the programmer in to your computer correctly?What does the development software say when you try to program the pic when the programmer is removed from the computer? Are you using the correct drivers for the programmer.

Are you programming in circuit? Some programmers aren't powerful enough to program a pic in circuit? Sometimes you need an additional power supply if your programing in circuit. Sometimes the circuit is a bad design to have in circuit programing. Any programing pin shouldn't have anything that draws any current, even something small like an LED.

Is your pic software correct? Find an example 16F877 software on the internet and try and load that in to the pic. You might be trying to program a memory location that you don't have access to or is none existent.


I think that pretty much covers any faults when trying to program a pic.
PMEmail Poster
Top
heuron
Posted: August 24, 2008 11:31 pm
Reply to this postQuote Post


Forum Addict
******

Group: Trusted Members
Posts: 549
Member No.: 8,708
Joined: March 20, 2007




thanks so much this is a big help, ill be sure to give that all a try.
PMEmail Poster
Top
kl27x
Posted: August 24, 2008 11:45 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Spamminator Taskforce
Posts: 4,269
Member No.: 4,223
Joined: February 06, 2006




Re: Shocker
I believe all 8 bit PICs can be programmed with HVP. But only certain ones can be programmed with LVP in addition to HVP.

Anyhoo, knowing what I do now, I'd try not to lose too many hairs over this and just buy a PICKIT2 from Microchip.
PMEmail Poster
Top
Shocker
Posted: August 24, 2008 11:50 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,634
Member No.: 3,558
Joined: November 06, 2005




QUOTE (kl27x @ August 24, 2008 11:45 pm)
Re: Shocker
I believe all 8 bit PICs can be programmed with HVP. But only certain ones can be programmed with LVP in addition to HVP.

Anyhoo, knowing what I do now, I'd try not to lose too many hairs over this and just buy a PICKIT2 from Microchip.

I was trying to get across that you can have large sockets and program small pics with it. So the location of the pic in the socket is crucial for a successful burn.
PMEmail Poster
Top
heuron
Posted: August 25, 2008 04:30 am
Reply to this postQuote Post


Forum Addict
******

Group: Trusted Members
Posts: 549
Member No.: 8,708
Joined: March 20, 2007




okay so i tried it with another pic, that worked, but it gives me the same error no matter how i align the 16f877. im guessing that something is just broken in my programmer, its a horrible programmer by the way, the software is total crap as well. it just closes sometimes when i am loading a new file on it... the only reason i need to do a bigger one the the 16f627a since i need to use usart and an lcd screen at the same time, and the only port that can actually do an lcd on a pic is portb, which also has the usart pins on it...
PMEmail Poster
Top
Shocker
Posted: August 26, 2008 10:42 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,634
Member No.: 3,558
Joined: November 06, 2005




QUOTE (heuron @ August 25, 2008 04:30 am)
the only port that can actually do an lcd on a pic is portb,

How did you work that one out? You can control your LCD with any of the I/O's
PMEmail Poster
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 


:: support us ::




ElectronicsSkin by DutchDork & The-Force