1. 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.
    Dismiss Notice

Error programming 16F628

Discussion in 'Microcontrollers' started by gregmcc, Aug 20, 2005.

  1. gregmcc

    gregmcc Member

    Joined:
    Aug 20, 2005
    Messages:
    303
    Likes:
    0
    Location:
    Darwen, UK
    good idea - i dont know if its programming or reading garbage. I'll setup the led program and let you know.
     
  2. eblc1388

    eblc1388 Active Member

    Joined:
    Jan 25, 2005
    Messages:
    2,228
    Likes:
    18
    Location:
    UK
    This may not help.

    You do know that there is a big difference between programming 16F628 and the 16F628A, do you? Just checking to make sure you are using the non-A PIC.

    If all else failed, try using a legacy PC running Win98.
     
  3. Joel Rainville

    Joel Rainville New Member

    Joined:
    Jul 17, 2005
    Messages:
    730
    Likes:
    0
    Location:
    Montréal, Québec, Canada
    Why would his programmer be able to program the non-A and not the A version? Isn't that dependant on the programming software used?

    Greg, try removing all installed printer drivers, or any driver bound to the LPT port used for the programmer on your PC.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. eblc1388

    eblc1388 Active Member

    Joined:
    Jan 25, 2005
    Messages:
    2,228
    Likes:
    18
    Location:
    UK

    Programming support for 16F628A is only available in the beta version of WinPicProg.
     
  6. Joel Rainville

    Joel Rainville New Member

    Joined:
    Jul 17, 2005
    Messages:
    730
    Likes:
    0
    Location:
    Montréal, Québec, Canada
    Well then, Greg, make sure you use proper software if you are using the A version. IC-Prog will work fine.
     
  7. Joel Rainville

    Joel Rainville New Member

    Joined:
    Jul 17, 2005
    Messages:
    730
    Likes:
    0
    Location:
    Montréal, Québec, Canada
    BTW, the non-A version hasn't been available from Microchip for a while now.
    Of course, some suppliers still offer it, but the A version is generally cheaper. At least that's the case at Digikey.

    So you should not assume anyone's using the obsolete part. It makes no sense to get the non-A version nowadays.
     
  8. gregmcc

    gregmcc Member

    Joined:
    Aug 20, 2005
    Messages:
    303
    Likes:
    0
    Location:
    Darwen, UK
    ok - tried the led program. nothing happens! so i presume its not being programmed properly.

    I'll uninstall my printer drivers and let you know what happens.

    also checked - its def the non-a version I'm using. its a pic16f628-04/p
     
  9. Joel Rainville

    Joel Rainville New Member

    Joined:
    Jul 17, 2005
    Messages:
    730
    Likes:
    0
    Location:
    Montréal, Québec, Canada
    Can you post a picture of your board?
     
  10. gregmcc

    gregmcc Member

    Joined:
    Aug 20, 2005
    Messages:
    303
    Likes:
    0
    Location:
    Darwen, UK
    i've deleted all my printer drivers and tried setting my parallel port to normal, it was set to epp - no difference. I've attached a pic of my board. The wires are connected to a ic socket.

    if it helps any - this is the hex of the blinking leds program:
    :020000040000FA
    :020000000428D2
    :08000800FF30A100FF30A2004F
    :1000100007309F00211033200530162023142F2095
    :100020000530162023102F200C281528A4002408A2
    :10003000A5006430A6000A301D28A700FF30A800E4
    :100040002608AA002508A9007730280703182528C4
    :10005000A90B2428AA0B2228A70B20280800302847
    :0E0060002308850008003428210865000800E8
    :02400E00623F0F
    :00000001FF

    below is the hex after I program the pic and read it back - shouldn't it be the same :x

    :020000000428D2
    :10000400A100FF30A20007309F00211033200530EB
    :10001400162023142F200530162023102F200C28FF
    :100024001528A4002408A5006430A6000A301D2861
    :10003400A700FF30A8002608AA002508A9007730E9
    :10004400280703182528A90B2428AA0B2228A70B64
    :1000540020280800302823088500080034282108B7
    :04006400650008002B
    :02400E00623D11
    :00000001FF
     

    Attached Files:

  11. Joel Rainville

    Joel Rainville New Member

    Joined:
    Jul 17, 2005
    Messages:
    730
    Likes:
    0
    Location:
    Montréal, Québec, Canada
    This is weird!

    Your target PIC is both powered by and grounded on the programmer right?

    Can you include your socket in that shot?
     
  12. Exo

    Exo Active Member

    Joined:
    Sep 18, 2003
    Messages:
    1,953
    Likes:
    1
    Location:
    Belgium
    You said you were using a shielded printer cable, yet all i see is a bunch of unshielded wires wich are curled together. It won't work like that...

    how long are these wires ? i've had p16pro40's fail because of 15cm unshielded wires between progger and pic...
     
  13. gregmcc

    gregmcc Member

    Joined:
    Aug 20, 2005
    Messages:
    303
    Likes:
    0
    Location:
    Darwen, UK
    yip - its grounded to the dc in. and powered by the circuit.

    picture attached.
     

    Attached Files:

  14. Joel Rainville

    Joel Rainville New Member

    Joined:
    Jul 17, 2005
    Messages:
    730
    Likes:
    0
    Location:
    Montréal, Québec, Canada
    Hmmm, I think you got it Exo! That would explain the weird behaviour.

    Those wires connecting the socket to the circuit look a bit long... They might pickup radio stations and write a mix of object code and "Stairway to heaven". I think I recognize a guitar riff encoded in that second hex file :p:lol::p
     
  15. gregmcc

    gregmcc Member

    Joined:
    Aug 20, 2005
    Messages:
    303
    Likes:
    0
    Location:
    Darwen, UK
    the shielded cable is between the computer and the programmer.

    between the programmer and the pic I have the single cables. no longer than 10cm
     
  16. Joel Rainville

    Joel Rainville New Member

    Joined:
    Jul 17, 2005
    Messages:
    730
    Likes:
    0
    Location:
    Montréal, Québec, Canada
    Do you have a short length of shielded cable left? I'd try to replace at least PGC, PGD and MCLR with that, or maybe just make them shorter?...
     
  17. Exo

    Exo Active Member

    Joined:
    Sep 18, 2003
    Messages:
    1,953
    Likes:
    1
    Location:
    Belgium
    Yes, try replacing them with shielded cables and untangle them, curling them up increases wire capacitance greatly...
     
  18. eblc1388

    eblc1388 Active Member

    Joined:
    Jan 25, 2005
    Messages:
    2,228
    Likes:
    18
    Location:
    UK
    Hi gregmcc,

    Your programmer is fine. See the comparsion of the two files(I make them into two files from your previous posting) you have posted.

    What you have read back from the PIC is actually what you have programmed, except with one error which happened while programming and caused offset in address.

    Why the error happened I can't tell. Except that the "FF30" at address 0008 just disappeared into thin air and the rest of the code placed into address starting from 0004.

    There appears to be a one-bit error difference in the last word but as it is the config word and that the difference location is bit9 which is not implemented in the config word so it is not an error.
     

    Attached Files:

  19. gregmcc

    gregmcc Member

    Joined:
    Aug 20, 2005
    Messages:
    303
    Likes:
    0
    Location:
    Darwen, UK
    i've now tried to untwist all the wires - made no difference.

    i think the time has come for me to give up on this programmer and try another type. i tried the jdm programmer before this one and that didnt work either :-(
     
  20. eblc1388

    eblc1388 Active Member

    Joined:
    Jan 25, 2005
    Messages:
    2,228
    Likes:
    18
    Location:
    UK
    Your programmer is fine.
    Your programmer is OK.
    Your programmer is functional.
    Your programmer is good.

    Just try another programming software. :twisted:
     
  21. gregmcc

    gregmcc Member

    Joined:
    Aug 20, 2005
    Messages:
    303
    Likes:
    0
    Location:
    Darwen, UK
    can you recommend one - i tried one from picallw - same problem.
     

Share This Page