+ Reply to Thread
Results 1 to 13 of 13

Thread: PIC16F877 can anyone help me with these programming issues?

  1. #1
    electronicsfreak Newbie
    Join Date
    Nov 2008
    Posts
    79

    Default PIC16F877 can anyone help me with these programming issues?

    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
    Attached Files


  2. #2
    ezpcb.com Newbie
    Join Date
    Nov 2008
    Posts
    17

    Default

    are you sure the chip wasn't broken?

  3. #3
    electronicsfreak Newbie
    Join Date
    Nov 2008
    Posts
    79

    Default

    I just tried it with one fresh out of the tube and it gives me the same error details

  4. #4
    kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent
    Join Date
    Jul 2006
    Location
    Victoria BC, Canada
    Posts
    3,681

    Default

    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.
    Inside every little problem, is a big problem trying to get out.

  5. #5
    electronicsfreak Newbie
    Join Date
    Nov 2008
    Posts
    79

    Default

    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. )

  6. #6
    electronicsfreak Newbie
    Join Date
    Nov 2008
    Posts
    79

    Default

    has anyone ever recieved this error?
    Attached Images

  7. #7
    be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent
    Join Date
    Aug 2008
    Location
    morristown,tn
    Posts
    2,000

    Default

    Are you sure you set it right in your post you say
    PIC17F877
    but you posted for help with a PIC16F877

  8. #8
    kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent
    Join Date
    Jul 2006
    Location
    Victoria BC, Canada
    Posts
    3,681

    Default

    Dumb question:
    Have you rebooted your PC and cycled the power on the programmer?
    Inside every little problem, is a big problem trying to get out.

  9. #9
    be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent
    Join Date
    Aug 2008
    Location
    morristown,tn
    Posts
    2,000

    Default

    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 by be80be; 18th February 2009 at 05:05 AM.

  10. #10
    electronicsfreak Newbie
    Join Date
    Nov 2008
    Posts
    79

    Default

    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.
    Attached Images

  11. #11
    be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent
    Join Date
    Aug 2008
    Location
    morristown,tn
    Posts
    2,000

    Default

    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

  12. #12
    electronicsfreak Newbie
    Join Date
    Nov 2008
    Posts
    79

    Default

    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.

  13. #13
    electronicsfreak Newbie
    Join Date
    Nov 2008
    Posts
    79

    Default

    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.

+ Reply to Thread

Similar Threads

  1. programming pic16F877 for ADC
    By tanoflash4 in forum Micro Controllers
    Replies: 3
    Latest: 5th August 2007, 10:54 AM
  2. JDM PIC Programming Issues (USB to Serial)
    By Fred.Amoson in forum Micro Controllers
    Replies: 4
    Latest: 5th August 2007, 09:19 AM
  3. Need help programming the MSSP on the PIC16F877
    By avinsinanan in forum Micro Controllers
    Replies: 1
    Latest: 20th August 2003, 10:04 AM
  4. Help in programming PIC16F877.....
    By Azhar Ali chohan in forum Micro Controllers
    Replies: 3
    Latest: 24th June 2003, 11:08 AM
  5. Programming the PIC16F877 in c++
    By RawTechie in forum Micro Controllers
    Replies: 3
    Latest: 7th June 2003, 09:33 PM

Tags for this Thread