IC12F508 with Internal Oscillator and Software Reset


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2009
    Posts
    2

    Default IC12F508 with Internal Oscillator and Software Reset

    Hi


    1)
    Can any body send me example code for Glow LED By using Internal Osc.?

    2)
    How I reset PIC12F508 Controller?

    I want to know how i reset that.?

    Further I want to also use GP3/MCLR/VPP as General Purpose IO Pin


    -------------------------
    SO SOFTWARE RESET


    In my previous experience on MCLR direclty connected to Reset switch for PIC18F4520.


    what i do in this (PIC12F508)case?

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


    Did you find this post helpful? Yes | No

    Default

    Hi Karan123,
    What is a " Glow LED"? Please define what you mean by " reset" pic. Do you mean make it wake from sleep, or shut off and restart from scratch as in a
    "Hot Boot" like hitting the reset button on a PC, or just reinitialize all the registers to the way you set them at start up ?
    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.

  3. #3
    Join Date
    Feb 2009
    Posts
    2


    Did you find this post helpful? Yes | No

    Default PIC12F508 with Software Reset

    Thanks for Reply...

    1)
    What is a " Glow LED"?

    Means ON LED with PIC12F508 uC.

    2)
    Please define what you mean by " reset" pic


    Restart from Scratch when power is ON


    Karan

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by karan123 View Post
    Thanks for Reply...

    1)
    What is a " Glow LED"?

    Means ON LED with PIC12F508 uC.

    2)
    Please define what you mean by " reset" pic


    Restart from Scratch when power is ON


    Karan
    To restart"from scratch" would require a power off or MCLR reset, maybe a brownout recovery, but I doubt it. So to reset you can use the mclr pin with a 5k resistor pulling it high and tie one of the other pins set as input to it, to reset just say LOW for that pin and PIC will reset. Other way would involve opening the VDD with a transistor or relay. Glow_LED var GPIO.0
    HIGH Glow_LED

    Lastly you could put a label at the very beginning of you code and execute a goto label, that will not however reset every register unless you have set every register in code.
    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.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Code:
    @ device  pic12F508, intrc_osc, wdt_on, mclr_off, protect_off
    
    X VAR BYTE
    
    OPTION_REG = %10001111 ' pull-ups disabled, 1:128 prescaler assigned to WDT
    GPIO = 0               ' pins clear on POR
    TRISIO = 0             ' all outputs (except for GPIO.3, which is input only)
      
    Main:
      FOR X = 0 TO 9       ' toggle LED on GPIO.0 10 times
        GPIO.0 = 1
        PAUSE 500
        GPIO.0 = 0
        PAUSE 500
      NEXT X
      
      ' sleep until WDT causes a device reset (around 2.3 seconds)
      @ SLEEP
    The watchdog timer will timeout in around 2.3 seconds and cause a device reset. If you
    just want to start over from 0, just replace @ SLEEP with @ GOTO 0.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6


    Did you find this post helpful? Yes | No

    Default @Bruce

    Hi Bruce, I'm reading reading about WDT and was wondering if you (or anyone else) could explain how you arrived at 2.3s...(if possible using Mr.E's multicalc...as thats what I normally use)...

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Wink

    Hi, Michael


    just use:

    Code:
    NAP 7
    2.60 Manual, page 116 ... range x = 0 ... 7 and duration is 18 ms * 2^x


    No calculations needed ...


    for calculations ...


    Parameter : 31 WDT Watchdog Timer Time-out Period
    (no prescaler)
    min: 9* ; Typ : 18 ; Max 30 ms @ VDD = 5.0V (Industrial)
    soooo ...

    128 * 18 ms = 2304 ms ... ...

    CQFD !

    BTW ... I do not think those calculators are really useful here ... nor handy !!!
    Last edited by Acetronics2; - 1st October 2009 at 13:47.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  8. #8


    Did you find this post helpful? Yes | No

    Lightbulb

    Thanks!...makes sense now...
    nice way to say RTFM...

Members who have read this thread : 1

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