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

Quick question on 16F628A

Discussion in 'Microcontrollers' started by bigal_scorpio, Nov 24, 2011.

  1. bigal_scorpio

    bigal_scorpio Active Member

    Joined:
    Oct 6, 2007
    Messages:
    1,072
    Likes:
    4
    Location:
    Rotherham South Yorkshire England
    Hi to all,

    I have just built a jumbo LED clock from a design on Jose Pino's web page that uses a 16F628 and when I got to the stage of programming the PIC I found to my dismay that the packet I had it in was mislabled, the actual PIC is a 16F628"A".

    All the research I did on the net seemed to point to the "A" being compatible with the code from a non"A". But on trying the code I am not getting much activity except the minutes digits showing capital "C"s but backwards.

    I have tried various configurations of the fuses but that was the most I got. Is there a way of setting the configuration bits that would help me. I just wish I had a non "A" instead of the "A" version so I could rule out the differences.

    Jose's page does not mention any special setting of the fuses and I have tried a good few combinations, but there are 7 fuses plus the protection one to choose and I doubt that the PICs legs will stand that many changes.

    Here is a link to the clock pagehttp://www.josepino.com/circuits/led_clock

    Any ideas guys........Al
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,163
    Likes:
    909
    Location:
    Rochdale UK
    What osc are you using? is MCLR a digital pin ? 0x3F50 works on both.. internal osc and all digital pins.
     
    Last edited: Nov 24, 2011
  3. Mickster

    Mickster Well-Known Member

    Joined:
    Feb 24, 2008
    Messages:
    1,082
    Likes:
    57
    Location:
    BDA
    ONLINE
    Hi Al,
    you may need to check the device migration document 40048a.pdf.

    I'd give you a direct link, but Win7/IE9 seems to make me open the PDF directly with no URL.

    Do a google search for '40048a.pdf' and it's the top result.

    Regards.
     
  4. dave

    Dave New Member

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


     
  5. francisco6329

    francisco6329 New Member

    Joined:
    Nov 13, 2011
    Messages:
    21
    Likes:
    0
    Location:
    Republica Dominicana, San Cristobal

    "But on trying the code I am not getting much activity except the minutes digits showing capital "C"s but backwards."

    shows code to help you, with port configuration or code
     
  6. francisco6329

    francisco6329 New Member

    Joined:
    Nov 13, 2011
    Messages:
    21
    Likes:
    0
    Location:
    Republica Dominicana, San Cristobal
    test each display, with a simple program such as displaying characters 0 through F.

    do not try to do something difficult, without testing or simple basics.

    see codes.
     

    Attached Files:

  7. bigal_scorpio

    bigal_scorpio Active Member

    Joined:
    Oct 6, 2007
    Messages:
    1,072
    Likes:
    4
    Location:
    Rotherham South Yorkshire England
    Hi Ian,

    I'm using a 4Mh crystal and MCLR is not even connected, as far as I know all pins are digital.

    Al
     
  8. bigal_scorpio

    bigal_scorpio Active Member

    Joined:
    Oct 6, 2007
    Messages:
    1,072
    Likes:
    4
    Location:
    Rotherham South Yorkshire England
    Hi Mickster,

    I have read the migration doc, but found nothing that suggested it would not work.

    As to Windows 7 try right clicking the link and then choose save as.

    Al
     
  9. bigal_scorpio

    bigal_scorpio Active Member

    Joined:
    Oct 6, 2007
    Messages:
    1,072
    Likes:
    4
    Location:
    Rotherham South Yorkshire England
    Hi Fransisco,

    Thanks for the test code, I will give them a try! Just wish I knew some ASM but it won't sink in I'm affraid. Too many years and pints I think. ;)

    Al
     
  10. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    May I suggest sending an email to Jose? He was kind enough to answer one of my emails a couple years ago. Be sure to ask what fuse settings he used (I'm not sure there are any fuse settings in that hex file).

    Happy Holidays...

    Mike
     
    Last edited: Nov 24, 2011
  11. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,218
    Likes:
    640
    Location:
    Derbyshire, UK
    There are fuse settings in the HEX file, PUT is set, code protect is set, and osc is set to HS. The same value works on the 628A as well.

    It's a pretty bizzare HEX file though?, rather strangely it includes all the blank addresses as well as the programmed ones (it doesn't use much of the 628's memory).
     
  12. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,163
    Likes:
    909
    Location:
    Rochdale UK
    There is your problem.... If the chip is set to use HS instead of the recommended XT.. The XTAL caps may be giving you a problem... Running this in ISIS appears to work. So it must be to do with the osc setting.
     
  13. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,185
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi Al,
    The hex program runs OK in Oshonsoft for both 628 ans 628A.
    Unzip this avi file to show the scanning.

    Exactly which circuit have you built, I know its the Jumbo, but post the actual schematic from your link.

    E
     

    Attached Files:

  14. bigal_scorpio

    bigal_scorpio Active Member

    Joined:
    Oct 6, 2007
    Messages:
    1,072
    Likes:
    4
    Location:
    Rotherham South Yorkshire England
    Hi Mike,

    I was planning on emailing Jose but I wasn't sure what I needed to ask him. Looks like maybe something to do with the fuses or Osc settings.

    Al
     
  15. bigal_scorpio

    bigal_scorpio Active Member

    Joined:
    Oct 6, 2007
    Messages:
    1,072
    Likes:
    4
    Location:
    Rotherham South Yorkshire England
    Hi Nigel,

    Yes mate, I did look at the hex and from the bottom upwards it looks very strange! I wondered if it was corrupt until I got to the top.

    Al
     
  16. bigal_scorpio

    bigal_scorpio Active Member

    Joined:
    Oct 6, 2007
    Messages:
    1,072
    Likes:
    4
    Location:
    Rotherham South Yorkshire England
    Hi Ian,

    I see what you mean but is there a solution?

    Al
     
  17. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,218
    Likes:
    640
    Location:
    Derbyshire, UK
    It makes VERY little difference, every example I've tried has worked perfectly regardless of the setting being XT or HS.

    But you can simply set the fuse settings in your programmer before you blow the chip, HS for the oscillator, and PUT on, I wouldn't bother setting code protect on, it's a waste of time and effort.
     
  18. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,185
    Likes:
    644
    Location:
    Ex Yorks' Hants UK

    Hi Al,
    You have my address if all else fails, feel free.:D
    Did you see my post #12.??

    E
     
    Last edited: Nov 25, 2011
  19. bigal_scorpio

    bigal_scorpio Active Member

    Joined:
    Oct 6, 2007
    Messages:
    1,072
    Likes:
    4
    Location:
    Rotherham South Yorkshire England
    Hi Eric,

    The scan seems to be ok mate. The schematic I used is the last one on the page, credited to Flash Gordon. I can't copy it mate!

    My circuit is exact except that I am powering the 4050s from 12v instead of from the 5v rail. My segments are each 5x red 5 x 2 leds and at 25mm each look really good as they are diffused LEDs.

    I have tested the segments and all are ok.

    I have always wanted a large LED clock for my workshop and now my neck is getting worse I can't look up at my regular clock! So I thought I would finally get around to making one. I did attempt to start from scratch but my coding skills are definately not up to it and I just kept getting confused with the interrupts and timings (well most of it really) hehehe

    Al
     
  20. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,185
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi Al,
    Look at this clip from the d/s for the 4050.

    Are you using buffered 'B' or unbuffered 'UB' 4050's.?
     

    Attached Files:

  21. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,185
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi Al,
    As I suspected the 4050 when powered from 12V will not switch the output with a 0/5V input signal it..

    The switching input must be at least +6V to be recognised as a logic high.

    I suspect that Jumbo circuit is just another 'artists impression' !:rolleyes: Extract: This schematic is only a sample

    To confirm the d/s, I have tried it using 4050's on a BB , it does not switch!
     

    Attached Files:

    Last edited: Nov 25, 2011

Share This Page