I'm an idiot and I don't know why! - CCP1_INT


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Posts
    27

    Red face I'm an idiot and I don't know why! - CCP1_INT

    I've been learning about interrupts thanks to the fabulous work of Darrel. I've been able to get INT_INT, RX_INT, and RBC_INT working with no problems. But I can't figure out how to get CCP1_INT working. I've looked at others examples and still I am missing something. Will someone please show me how big of an idiot I really am?
    I've tried different configuration with TMR1...starting it, stopping it, leaving it out altogether with no luck.

    It doesn't get much easier than this....

    Code:
    '16f628A
    DEFINE OSC 20
    CMCON = 7
    VRCON = 0
    TRISB  = %00011011
    TRISA  = %00010000
    CCP1CON = %00000101 
    INCLUDE "DT_INTS-14.bas"
    INCLUDE "ReEnterPBP.bas" 
    
    clear
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler   CCP1_INT,  _ToggleLED,   PBP,  yes
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    
    @ INT_ENABLE  CCP1_INT
    
    Mainloop:
            pause 1
            goto Mainloop
            
    ToggleLED:
        TOGGLE PORTA.0
    @ INT_RETURN

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


    Did you find this post helpful? Yes | No

    Default

    What is triggering the interrupt on RB3?
    Regards,

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

  3. #3
    Join Date
    Sep 2008
    Posts
    27


    Did you find this post helpful? Yes | No

    Default

    pushbutton
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    RB3 CCP1 input is an ST type, so it needs 0.8 * Vdd to meet the logic 1 input threshold.

    I can't really tell from your schematic, but it looks like you might have a voltage divider?
    Regards,

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

  5. #5
    Join Date
    Sep 2008
    Posts
    27


    Did you find this post helpful? Yes | No

    Default

    5.00v on Pin3
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    Hmm ... should work. I just tested it with the older version of DT_INTS-14 & ReEnterPBP.

    Are you using the latest version? I haven't tried the newer rev yet.
    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