DT Ints work around for IOCA Register?


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    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

  2. #2
    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, 21:31
  2. Quick thoughts: DT Ints with encoders
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 7th January 2010, 02:01
  3. PIC16F877A pwm use for IR transmission
    By mcbeasleyjr in forum General
    Replies: 0
    Last Post: - 11th July 2009, 19:51
  4. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 03:21
  5. MX7705 or AD7705 experience
    By FM11 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th January 2006, 22:54

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