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.

PIC16F877 can anyone help me with these programming issues?

Status
Not open for further replies.
Well, for those of you who've read my other threads, my main project that I'm working on right now is an animatronic fox.


Now, I have the circuitry complete, most of the mechanics complete, and that just leaves me with installing final program.

Only one problem, I can't seem to be able to get it to download into the PIC

I was successfully able to get a test program into it about 2 weeks ago and has been working as planned until the project was ready to accept the final program.


As it begins to put the program into the PIC it says the board recieved a data transfer error and is applying a reset. It does the same thing with the test program if I try to reload it.

Reading the ROM that was transferred, it follows the code that was suposed to go into it for about half of the first row and then just displays 3FFF in every other spot.


Now, I am able to program other PIC's in this programmer such as the PIC16F627 and the PIC16F628 flawlessly, but when it is set to program the PIC17F877 with its specific hexfile it just gives me that error.


Anyone have anyideas (heh, it just happens to completely fail the day before it's due) if so please post them as I am in a rush


The code is in the attached file and the programmer is the K149-BC
 

Attachments

  • FOXFINAL.asm
    6.5 KB · Views: 152
Are you trying to program the PIC in circuit? If so, circuitry on the MCLR, PGD and PGC lines can interfere with programming if you are not careful.
 
no, I've been trying just from the ZIF socket that is on the programmer.


what I just can't understand is if I hadthe samecodework before and not work now (test program) even with a brand new PIC

and even if it was a faulty programmer it can still program other PIC's that I have.


heck, I just tried putting the blank code template file microchip gives you, successfully built it through MLAB, and it still won't load it without bringing up that same error message. (-_-)


the only other programmer that I have is an old k8048 velleman kit which was outdated once I replaced my windows 98 to a vista laptop (no rs232 ports)

(heh, of all the times something else could have gone wrong with the program it had to be now. )
 
has anyone ever recieved this error?
 

Attachments

  • programmer problem.jpg
    programmer problem.jpg
    78.1 KB · Views: 144
Dumb question:
Have you rebooted your PC and cycled the power on the programmer?
 
I have change the code and recompiled like 5 time and the hex wouldn't load till I clean out previous builds and recompiled
 
Last edited:
Yes, the PIC is a PIC16F877. That's just my horrible attempt at typing this thread.

Thank's guys for your help, but I'm beginning to believe that both of these PIC's are somehow mysteriously broken in the same way (when you read back the rom that was transferred before it redieves the error, sometimes it stops at the first row,sometimes a few rows down)


So, I guess for now I'll have to set it up with a couple of 220Ω resistors to simulate the I/O's when they turn on and off, hope and pray that this order does infact arrive within the next day as the ridiculously pricey shipping says it will, and by the shear chance that they do arrive at my door before I have to head out I can put atleast the old test program back into one. Maybe, just maybe I'll atleast get third (there are usually only a couple of entries)



Anyways, here's the fox without the skin on it as it sits now...unprogrammed and disconnected from the board.
 

Attachments

  • 100_2143.JPG
    100_2143.JPG
    413.7 KB · Views: 159
did you gnd your self when putting the pic in the programmer you can kill 1 quick on carpet if it dry like it is here where i live
 
Just reset my computer (huh, wonder if it could be the crappy service pack 1 for vista that's been released that is also affecting this program. Every time I power down it uninstalls my network adapters during login. -_- )




I've got a large piece of metal that I discharge myself on before I handle these things, although I know that my first PIC was toast (while carring the board it slipped out of my hands.I caught it, but on the PIC.


the second one that I have however I had it slide right out of the tube onto the programmer without touching the leads.
 
UPDATE

Sorry again for the extremely late reply.

Well, I did eventually end up finding the problem... it was the programmer.

That day before before I looked everywhere within the state until I finally found a store that sold USB based PIC Programmers. I do have to admit, it was definately an upgrade (this new one by Olimex can run directly from MLAB), but it was a little expensive (try ~$90) ohwell. It fixed the problem.

What still boggles my mind is how this old USB programmer wasn't able to program the PIC16F877 just like it did before, but would sucessfully program both the PIC16F627 and PIC16F628.

It does use a PIC16F628 on the board itself. Waybe it is what was causing the problem. I'll try looking for some firmware and replace that PIC.

Thankyou again to everyone here who helped me resolve this issue. when I finally resolve the mechanical issues with this project I'll indefinately post a video of the results of this project.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top