Menu

PIC12F675 - using an interrupt call

Help
vmatthews
2014-05-07
2014-05-13
  • vmatthews

    vmatthews - 2014-05-07

    Was trying to use GPIO.2 Port as a interrupt change as listed in the Help's Interrupt listing.
    Found no help in the 'Help' with GC for the 'GPIOchange' interrupt trapping.

    Seems like I need something for the H2OLevel to be coupled with
    the GPIOchange command.

    NOTE: I am able to get EXTINT0 using AN2, but Still wanted to understand the GPIOChange command

    Thanks, vic

    ;Chip Settings
    #chip 12F675,4
    
    #define H2oLevel an2
    #define LEDStatus GPio.4
    #define Horn GPIO.5
    
    dir LEDStatus out
    dir Horn out
    ''test LED and horn
    for tempx=0 to 9
    set horn on
    set ledStatus on
    wait 20 ms
    set horn off
    set ledStatus off
    wait 50 ms
    next
    
    ''' when resistance drops on AN0 do Int
        '''*** below is the line I would like to understand..
    'On Interrupt gpiochange call HornAlert 
        ''  the line belows is what is working..
        On Interrupt ExtInt0 call HornAlert
    IntOn
    Do 
    Wait 1 s 
    set  LEDStatus on
    Wait 1 s 
    set  LEDStatus off
    Loop
    
    Sub HornAlert 
        for tempx=0 to 9
    set Horn on
    wait 250 ms
    set horn off
    wait 250 ms
    next
    End Sub
    
     

    Last edit: vmatthews 2014-05-08
  • Anobium

    Anobium - 2014-05-12

    Did you ever resolve this?

     
    • vmatthews

      vmatthews - 2014-05-13

      I have not figured out how the GPIOChange functions.

       
  • Anobium

    Anobium - 2014-05-13

    Can you describe what you are trying to achieve? I am sure we can then help you.

     
  • kent_twt4

    kent_twt4 - 2014-05-13

    Looks like the GPIO2 (extINT pin) is not set to digital input. If button is grounding the pin, then it wouldn't hurt to turn on the weak pullup for that pin. So,

    Dir GPIO.2 In
    Set WPU2 ON
    

    Edit: Same thing for On Interrupt GPIOChange..., need Dir GPIOX In.

     

    Last edit: kent_twt4 2014-05-13

Log in to post a comment.