Need 4 modes with just 3 switches - need all modes to be selectable QUICKLY!


Results 1 to 40 of 68

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    I think what you want here is RABC_INT. So:
    Code:
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
        INT_Handler    RABC_INT,  _Switch_Interupt,   PBP,  yes  
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
     
    @   INT_ENABLE   RABC_INT     ; Enable 'Int On Change' interrupts
    Note: Your schematic is wrong with pins 11 & 12 shown as RB2 & RB3. These should be RB6 & RB5 respectively. So;
    Code:
    Switch_Interupt:
     
    if portB.4 = 0 then  mode = 1
    if portB.5 = 0 then  mode = 2
    Should be;
    Code:
    Switch_Interupt:
     
    if portB.6 = 0 then  mode = 1
    if portB.5 = 0 then  mode = 2
    if porta.2 = 0 then ? whatever ' this is the interrupt pin on RA.2
    Or, of course, you can use RA.1 as shown in your schematic for this interrupt pin. Either will work the same since they both have IOC (interrupt-on-change) functionality, and internal pull-ups.

    Note I have not used DT_INTs on this PIC type with interrupt-on-change, but that should get you going. I'm sure Darell will jump in here, and correct me if I'm wrong, but I think that's what you're looking for.

    But, I HAVE used his DT_INTs for our 4-digit & 6-digit serial LED displays, and I most certainly can vouch for them working spot-on, and making life a lot easier for us mere mortals...

    I've also used DT_INTs in several commercial applications, and had ZERO problems - so a huge thanks to DT for all the hard work, and sharing his routines with us.
    Last edited by Bruce; - 6th August 2010 at 21:34. Reason: BIG thanks to DT
    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