Problems with 12F675


Closed Thread
Results 1 to 40 of 67

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    @ SLEEP in assembly language, simply puts the processor to sleep for 1 sleep/wake cycle. Program execution will resume immediately on the first wake-up. Or if interrupts are enabled, it will jump to the ISR first, then resume were it left off. Although if interrupts are enabled, you must have 2 NOP's after the @ SLEEP statement to allow the pipeline to load the ISR's first instruction.
    Thank You Darrel,
    1 sleep / wake cycle ? still not causing sparks across my synapses, Is that OSC/4, Arbitrary countdown of WDT, something conjured using black cat bones and herbs? AND IF WDT is not enabled, will it sleep forever waiting for an interrupt? And if so will that interrupt wake it 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.

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    1 sleep / wake cycle ? still not causing sparks across my synapses, Is that OSC/4, Arbitrary countdown of WDT, something conjured using black cat bones and herbs? ...
    1 sleep/wake cycle is the process of putting the PIC to sleep, and having it wake-up from one of many reasons.

    If that reason is due to the WDT, it may be more like "Black DOG bones".
    The WDT isn't very accurate in most PIC's. And it varies from one Family to another. But essentially it's the base period of the WDT, multiplied by the Prescaler.

    AND IF WDT is not enabled, will it sleep forever waiting for an interrupt? And if so will that interrupt wake it up?
    Yup! She'll pull a "Sleeping Beauty" until a Prince comes along for a kiss.

    Available Princely possibilities are ...
    From the Midrange Reference.



    Also, Bruce pointed out that the datasheets recommend 1 NOP after @ SLEEP instead of 2.

    Not sure why I thought it was two.
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    <h1> THANK YOU ! </h1>
    That is what I needed confirmation on.
    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.

  4. #4
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    Yes, it's work now !
    @ DEVICE PIC12F675, intrc_osc_noclkout, wdt_ON, pwrt_on, mclr_off, bod_off
    ...
    @ Sleep
    ...
    GPIF=0
    ...
    Thanks again to all for help ! @ Cheers !

  5. #5
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    Works...but don't sleep ! I measure the current and it is all the time about 3.5 mA. Based on "PICadilly 12F675", writen by Ian Burn, I try to re-re-redefine the code. But...even I made like in book, the current consumption it's 3.5 mA !
    " @ DEVICE PIC12F675, intrc_osc_noclkout, wdt_OFF, pwrt_on, mclr_off, bod_off
    ....
    IOCB= %00001100
    INTCON.3=1
    OPTIONS_REG.6=1
    ....
    main:
    ...
    INTCON.0=0
    Pause 100
    @SLEEP
    Pause100
    ... "
    I don't understand why do not work ! I remove the PIC from schematic, and the current consumption is about 2.5 mA; so, the 12F675 consume about 1 mA, all the time and never go to sleep with "less than 1 microamp" !

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


    Did you find this post helpful? Yes | No

    Default

    Hi fratello,
    Well you have taken this thread every which away, instead of making new threads for different projects, so we do not really know which schematic and code you are asking about, so only "General" statements can be applied here. First, you are chasing 1 ma out of 3.5 ma, is there any way to kill the 2.5 since it is the bigger portion? Secondly, I do not think you will ever see 1&micro;A, maybe wrong just my opinion. Just before @ SLEEP, I would try tristating the GPIO by TRISIO = 255, disable WPU and in your configs, shut off WDT, and disable MCLRE, you might switch to LP_OSC, to further reduce power. Read this thread, different chip but useful maybe:
    http://www.picbasic.co.uk/forum/showthread.php?t=11325
    Last edited by Archangel; - 7th August 2009 at 17:18.
    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
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    Thanks for reply ! I use the schematic from post #1 and the code continuous improved in this thread. I made this changes on the last code posted by Mr.Darell. I say that I use this schematic on automobile ; I think every way to reduce the consumption it's necessary...or maybe the battery of my car give enough current, even I don't start the engine for a long period...It is not a verry big problem, but I want to understand the "mechanism" of the sleep procedure, and I am dissatisfied because, even I try all the variants, the obvious results are not present ! Just I try to make this project almost perfect and I really appreciate the support of all. Sorry if I disturb somebody...or if I became boring...

Similar Threads

  1. 12F683 vs 12F675.
    By sccoupe in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th July 2009, 04:58
  2. LANC code 12F675
    By MikeDD in forum General
    Replies: 4
    Last Post: - 9th May 2008, 05:44
  3. 12F675 cant serout to PC
    By ruijc in forum General
    Replies: 9
    Last Post: - 3rd December 2007, 00:11
  4. USART problems
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 47
    Last Post: - 6th March 2005, 21:45
  5. Serial LCD on 12F675
    By anj in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 31st March 2004, 23:11

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