Timing issue


Closed Thread
Results 1 to 10 of 10

Thread: Timing issue

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Timing issue

    Sorry, I missed the GPIO setting.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default Re: Timing issue

    Hi,

    Three things ...

    1) you use the IOC interrupt ... so that rings the " Mismatch condition " bell in my head ... see Sleep datasheet chapter.

    2) Microchip recommends to place a NOP instruction just past the Sleep one, when using the feature this way.

    3) when you push a button ... you obviously release it one day ! makes two input changes ...

    Alain
    Last edited by Acetronics2; - 27th November 2011 at 09:57.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  3. #3
    Join Date
    Jan 2009
    Posts
    78


    Did you find this post helpful? Yes | No

    Default Re: Timing issue

    2) Microchip recommends to place a NOP instruction just past the Sleep one, when using the feature this way
    try to add

    @ sleep
    @ nop

    If the GIE
    bit is clear (disabled), the device continues execution at
    the instruction after the
    SLEEP instruction. If the GIE bit
    is set (enabled), the device executes the instruction
    after the
    SLEEP instruction, then branches to the interrupt
    address (0004h). In cases where the execution of
    the instruction following
    SLEEP is not desirable, the
    user should have a
    NOP after the SLEEP
    instruction.

  4. #4
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: Timing issue

    Hi All, and thanks for your answers!!!

    Quote Originally Posted by mackrackit View Post
    Sorry, I missed the GPIO setting.
    No problem Dave!!!


    Quote Originally Posted by Acetronics View Post
    Hi,

    Three things ...

    1) you use the IOC interrupt ... so that rings the " Mismatch condition " bell in my head ... see Sleep datasheet chapter.

    2) Microchip recommends to place a NOP instruction just past the Sleep one, when using the feature this way.

    3) when you push a button ... you obviously release it one day ! makes two input changes ...

    Alain
    Alain; I read the datasheet but couldn't get anywhere, believe me, I tried.

    Quote Originally Posted by bogdan View Post
    try to add

    @ sleep
    @ nop
    bogdan, tried also that, but its not the solution for my problem.

    Ok, the only conclusion that i came up, is this:

    If i disable the WPU on the button pin, put a pull-down resistor in this pin and connecting the VCC to the button, i don't get the issue. I only get the issue, if i take of the pull down resistor, enable the WPU and connect the GND to the button.
    So the conclusion that i came up, not knowing it it is the correct one, is that, on power up the GPIO state is LOW. So because i have the WPU enable on this pin, i think a interrupt is triggered, because i have a mistmach condition on this pin. If i disable the WPU, put a pull-down resistor in this pin and connecting the VCC to the button, i don't have the mistmatch condition, so the PIC goes to sleep.

    If this conclusion is not the correct one, i don't know, why the micro is not going to sleep on power up!!!
    Thanks and Regards;
    Gadelhas

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