DT Ints work around for IOCA Register?


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2005
    Location
    Salt Lake City, Ut, USA
    Posts
    108

    Default DT Ints work around for IOCA Register?

    Hello all,

    Thought I would start a new thread real quick, rather than this question getting buried in my Digitizing Arm post. I'm scribbling some code for the PIC16F688, and would love to use the DT Ints library. Will the library work on the IOCA Reg, or am I stuck with PBP interrupts? Can I change a few lines in DT_INTS-14.bas and make it work? Any help would be great.

    Thanks guys,
    Chris

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


    Did you find this post helpful? Yes | No

    Default

    Don't have a 16F688 to test, but this works in MPSIM --
    Code:
    @ __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_OFF & _CP_OFF
    
    DEFINE  OSC 4
    
    OSCCON = %01100000 ' 4MHz internal
    ANSEL = 0     ' Set portA outputs to Digital / No ADC
    CMCON0  = 7   ' comparators disabled
    PORTA = 0
    TRISA = %00000001 ' RA0 input
    OPTION_REG.7 = 0  ' pull-up global enable
    WPUA = %00000001  ' pull-up enabled on RA0
    
    include "DT_INTS-14.bas"
    include "ReEnterPBP.bas"
    
    ASM
    INT_LIST  macro    ; IntSource,  Label,  Type, ResetFlag?
            INT_Handler   RAC_INT,  _MyInt,   PBP,  yes
        endm
        INT_CREATE           ; Creates the interrupt processor
    
        INT_ENABLE  RAC_INT  ; Enable RA change interrupt
    ENDASM
     
     WHILE !PORTA.0   ' read for wake up om change
     WEND 
     IOCA.0=1         ' RA0 int-on-change enabled
    
    Main:
      TOGGLE PORTA.2
      PAUSE 500
      GOTO Main
    
    MyInt:
      WHILE !PORTA.0 
      WEND           ' wait for button release
      TOGGLE PORTA.1
      @ INT_RETURN
    Just added these to DT_INTS-14 --
    Code:
      #define RAC_INT   INTCON,RAIF     ;-- RA Port Change Interrupt
    
      ifdef RAIF    ;----{ RA Port Change Interrupt }--------------[INTCON, RAIF]---
          INT_Source  INTCON, RAIF, INTCON, RAIE
      endif
    Regards,

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

  3. #3
    Join Date
    Dec 2005
    Location
    Salt Lake City, Ut, USA
    Posts
    108


    Did you find this post helpful? Yes | No

    Default

    Thanks a ton Bruce. I'll give that a run. I just didn't want to really screw somethin' up!

    Thanks again,
    Chris

Similar Threads

  1. Active low input?
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th August 2010, 20:31
  2. Quick thoughts: DT Ints with encoders
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 7th January 2010, 01:01
  3. PIC16F877A pwm use for IR transmission
    By mcbeasleyjr in forum General
    Replies: 0
    Last Post: - 11th July 2009, 18:51
  4. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  5. MX7705 or AD7705 experience
    By FM11 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th January 2006, 21:54

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