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

programming 12c508a

Discussion in 'Microcontrollers' started by kamelat, Oct 14, 2017.

  1. kamelat

    kamelat New Member

    Joined:
    Oct 14, 2017
    Messages:
    11
    Likes:
    0
    Hi everyone,
    I have 12c508a pic and I'm using proteus to simulate before writing in the pic.
    But the problem is that I found tutorials written in ass
    the first file worked verry well, but it's a HEX file so I can't change it.
    But the second file is open one, but I don't know how to compile it, I've tried mplab, but it didn't work.
    Help me please
     

    Attached Files:

  2. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    6,052
    Likes:
    519
    Location:
    Cleveland, OH, USA
    ONLINE
    Welcome to ETO.

    SimpleTimer.zip compiles fine for me using MPLab8.92. It should also program, but I did not try to do that.

    I did not take the time to simulate or test it.

    What errors do you get when you try to program? The 12C508a is a one-time programmable chip. Are you sure that is what you have? Once you write that program to it, there will be no opportunity for changes. Can you get a 12F5xx chip?

    John
     
  3. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,319
    Likes:
    653
    Location:
    Derbyshire, UK
    ONLINE
    Yes, don't use the antique 12C508 (not even from this millennium :D) - there are many MUCH more modern 8 pin PIC's, which are reprogrammable and considerably cheaper.
     
  4. dave

    Dave New Member

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


     
  5. kamelat

    kamelat New Member

    Joined:
    Oct 14, 2017
    Messages:
    11
    Likes:
    0

    Thank you for your reply
    I have
    MPLAB X IDE v4.01
    and I opened a project with pic12c508a
    but when I compile, it won't work
    [​IMG]

    The problem I have to use 12c508 a
     
  6. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    6,052
    Likes:
    519
    Location:
    Cleveland, OH, USA
    ONLINE
    It just occurred to me to check this:

    upload_2017-10-14_7-54-41.png

    As a Yogi Berra used to say, it was like deja vu all over again. The last time I tried to program a non-flash chip I had to buy a PicStart Plus to do it.
     
  7. kamelat

    kamelat New Member

    Joined:
    Oct 14, 2017
    Messages:
    11
    Likes:
    0
  8. kamelat

    kamelat New Member

    Joined:
    Oct 14, 2017
    Messages:
    11
    Likes:
    0
    jpanhalt
    ========
    thank you
    but what I'm looking for is a programm that can give me a hex file
     
  9. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    6,052
    Likes:
    519
    Location:
    Cleveland, OH, USA
    ONLINE
    Here's the hex file I got (release version) for the SimpleTimer.asm that you posted.

    John
     

    Attached Files:

  10. kamelat

    kamelat New Member

    Joined:
    Oct 14, 2017
    Messages:
    11
    Likes:
    0
    jpanhalt
    ============
    what did you use to get the hex file??
     
  11. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    6,052
    Likes:
    519
    Location:
    Cleveland, OH, USA
    ONLINE
    I used MPLab 8.92 . You are apparently using MPLabX 4.0x I do not use that version, but I am pretty sure it generates a hex code too, once you get your code to compile.

    First get your code to assemble (compile) in either Release or Debug. Then, assemble (compile) it in release mode. Then, look in the files. You will find several including a .hex file.

    The example you put in Post#4 is not he same code I assembled for you.

    John
     
  12. kamelat

    kamelat New Member

    Joined:
    Oct 14, 2017
    Messages:
    11
    Likes:
    0
    jpanhalt
    =============
    Hello again
    I have downloded the 8.92v but the code didn't compile for me
    I guess the problem is in the code itself
    So would you give a simple code for pic12c508a that I can use pins as outputs
     
  13. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    6,052
    Likes:
    519
    Location:
    Cleveland, OH, USA
    ONLINE
    The problem is not in the code you posted. It compiled fine for me with absolutely no changes. I already gave you the hex file for the code you posted that does what you ask (See: post #7).

    I don't think sending you another code for doing the same thing will accomplish anything.

    Have you set up a project for the code? Can you zip it an post the entire project file? Please post the code you want to use, if it is different.
     
  14. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    6,052
    Likes:
    519
    Location:
    Cleveland, OH, USA
    ONLINE
    On second thought. Here is the zipped project file for Simple Timer (the code you posted). Unzip it, and click on the file SimpleTimer.mcp . MPLab 8.92 doesn't even have to be running and it should open. If it doesn't start MPLab 8.92 and go through the open project dialog.

    John
     

    Attached Files:

  15. kamelat

    kamelat New Member

    Joined:
    Oct 14, 2017
    Messages:
    11
    Likes:
    0
    jpanhalt
    =============
    Thank you so much
    final request please:
    could you write to me how to put gpio high and stay that way
    because I used to programm with c not ass
    Thank you
     
  16. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    6,052
    Likes:
    519
    Location:
    Cleveland, OH, USA
    ONLINE
    Your program would need some modification to do that, because it uses TRIS to set direction to input, which turns off the outputs. I can modify that, but which pin do you want to be constantly high? So as to avoid confusion, either give the pin number or the GPIO number, but be sure to say which numbering system you use.

    What programmer are you using? Depending on what you have, that may be a wasted effort.
     
  17. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
    I'm not sure but I think I am there is no 12c508a in mplab-x 3.65 that I could find I had to add for the 12f508 chip because it was missing names.
    That was for asm files I was playing with I just looked at 4.01 the files are there with right names for these chips.
    I had problem with tris bits' but 4.01 should work fine.
     
  18. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
    On these chips your better to write a port all at once or you'll be doing something you don't want to happen.
     
  19. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    6,052
    Likes:
    519
    Location:
    Cleveland, OH, USA
    ONLINE
    If you look at the program, I do not think RMW is an issue.
     
  20. kamelat

    kamelat New Member

    Joined:
    Oct 14, 2017
    Messages:
    11
    Likes:
    0
    jpanhalt
    =======
    I just want to simulate a trrafic light:
    [​IMG]
     
  21. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    6,052
    Likes:
    519
    Location:
    Cleveland, OH, USA
    ONLINE
    You have not answered either question I put to you.

    Making one light steady on does not simulate any traffic light I have seen in the past 70 years. Please try to answer my questions
     

Share This Page