@Darrel Taylor Interrupt ;-)


Results 1 to 11 of 11

Threaded View

  1. #1
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    44

    Default @Darrel Taylor Interrupt ;-)

    Hi Darrel,
    iīm using your last interrupt posting to me for a 16F913. But something is not working just like at the 16F872. I read the datasheet for the 16F913 and i think itīs the same parameter like 16F872.
    I set all PORTS to DIGITAL I/O (this was really hard to find out for this device). I think they are ok so.

    Maybe you know why the interrupt is not working.
    Code:
    DEFINE OSC 8
    ADCON1 = %111
    ANSEL = 0
    CMCON0 = 7
    LCDCON = %01000000
    LCDSE0 = 0
    LCDSE1 = 0
    
    @ERRORLEVEL -306
    
    RBCPins     VAR Byte
    LastPins    VAR Byte
    Lastpins =  PORTB
    
    INTCON.0 = 0
    INTCON.3 = 1
    
    TRISA = %00111000       ' RA0-2 OUT, RA3-5 INPUT
    TRISB = %11100000       ' RB7 & RB6 PORTChange by Interrupt, RB5 Input Clicker as Input is not needed for Interrupt change
    TRISC = %00000000
    
    ON INTERRUPT GOTO MyINT
    
    Main:
    '...
    '...
    '...
    GOTO Main
    
    DISABLE                        
    MyINT:
    RBCpins = PORTB
    IF RBCpins.7 <> Lastpins.7 THEN
        DPO2 = 0
        PAUSE 20
        DPO1 = 0
        PAUSE 40
        DPO2 = 1
        DPO1 = 1
    ENDIF
    
    IF RBCpins.6 <> Lastpins.6 THEN
        DPO1 = 0
        PAUSE 20
        DPO2 = 0
        PAUSE 40
        DPO1 = 1
        DPO2 = 1
    ENDIF
    INTCON.0 = 0
    RESUME
    ENABLE
    thx Robson
    Last edited by Robson; - 30th August 2007 at 22:25.

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