I am stumped!!!


Closed Thread
Results 1 to 20 of 20

Thread: I am stumped!!!

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Ok, I didn't know about that...Thank you.

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


    Did you find this post helpful? Yes | No

    Default

    Sorry. My fault for not mentioning this. The @ SLEEP instruction puts it to sleep forever until a watchdog timeout, or an interrupt wakes it up.

    When it wakes up due to watchdog timer timeout, it executes the instruction immediately after the @ SLEEP, and lands on your goto cycle.

    Any time you use the assembler version @ SLEEP you'll need to make sure you have WDT disabled unless you want it to wake up with the watchdog timer timeout.
    Regards,

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

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


    Did you find this post helpful? Yes | No

    Default

    Taz,

    Try this version with the nop just after @ SLEEP and see if this helps.
    Code:
    DEFINE OSC 4
    
    CMCON=%00000111
    VRCON = 0 
    PAUSEus 10 
    TRISA = %00000110
    TRISB = %11110000   ' using upper 4-bits for interrupt
    PORTA = %00000000 
    PORTB = %00000001
    
    OPTION_REG.7 = 0 
    OPTION_REG.6 = 0
     
    led var portA.3
     
    INCLUDE "DT_INTS-14.bas" ; Base Interrupt System
    INCLUDE "ReEnterPBP.bas" ; Include if using PBP interrupts
     
    ASM
    INT_LIST macro ; IntSource, Label, Type, ResetFlag?
        INT_Handler RBC_INT, _check, PBP, yes
        endm
        INT_CREATE 
    ENDASM
     
    @ INT_ENABLE RBC_INT 
     
    cycle:
        HIGH led
        pause 100
        LOW led
        pause 100
        @ Sleep
        @ NOP
        goto cycle
     
    check: 
        WHILE (portb >> 4) != 15
          PAUSE 10
        WEND 
        @ INT_RETURN
    Regards,

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

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