Small problem with PIC12F629


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2010
    Posts
    37

    Default Small problem with PIC12F629

    Hi there!
    I try in proteus something like this with PIC12F629:

    Code:
        trisio = %11111000
        PORTA.0 = 1
        pause 1000
        PORTA.1 = 1
        pause 1000
        PORTA.2 = 1
        pause 1000
    I expected to make PortA.0 high, after 1 seconds to make PORTA.0 and PORTA.1 high and after another second to have all PORTA.0, PORTA.1, PORTA.2 high.

    But the things works another way: after 1 seconds PORTA.0 become low and only PORTA.1 is high; after another 1 second, PORTA.0 and PORTA.1 become low and PORTA.2 is high.
    I dont understand why making a bit high toggle low the rest.
    Any ideea?
    Thank you.

  2. #2
    Join Date
    Jan 2010
    Posts
    37


    Did you find this post helpful? Yes | No

    Default

    Well,
    Code:
    cmcon = 7
    solve the problem.
    Thank you!

  3. #3
    Join Date
    Jan 2010
    Posts
    37


    Did you find this post helpful? Yes | No

    Default

    Now I got another problem.
    When I try to use icprog (JDM Programmer) I got a message that Oscillator clock is bad. My code is here:
    Code:
        INCLUDE "modedefs.bas"
    
        @ device  PIC12F629, intrc_osc_noclkout; Use internal oscilator
        @ DEVICE PIC12F629, MCLR_OFF ; Turn off internal reset 
        trisio = %11111000
        cmcon = 7
    What can I do?

  4. #4
    Join Date
    Jan 2010
    Posts
    37


    Did you find this post helpful? Yes | No

    Default

    The error message is:
    "No oscillator callibration value found"

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Unhappy

    Hi, Luxor

    I hope for you you didn't erase your chip before ...

    could you read the value located @ 3FF location ( last Program memory location )

    IF something different from 3FFF ... note the value preciously.

    IF 3FFF then change it to something like 3420h to 3450h ... you've lost your calibration value, and the intosc won't be very precise now ... ( use only external Xtal if precision required ! )

    not very easy to recover, but Pickit 2 ou 3 have a special recovering tool ( see around you if a friend has one ...)

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    I fought with that on, I think it was a 675, or maybe a 683, anyway I tried the JDM and the PICKit2, even tried to regenerate using PICKit2 to no avail. Then I got the PICKit1 from Bruce and it worked without a hitch. I cannot say why, only that it seems to be a programmer issue.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  7. #7
    Join Date
    Aug 2005
    Location
    down south
    Posts
    90


    Did you find this post helpful? Yes | No

    Default

    on the 12f629
    should it be GPIO.0 not PORTA.0

    WILL PORTA WORK
    " be nice it's people like me that make people like you look smart"
    yes I read the datasheet, of the 300 pages I understood 10

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts