DT_INTS-18 - problem with INT0


Results 1 to 17 of 17

Threaded View

  1. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    Try something like this to see how it goes.

    It just waits to free the button.

    I know Darrel will spank me for this, but hey, it is just for testing!

    Ioannis


    Code:
    ' set fuses    - USE INC FILE FOR NOW
    
    include "modedefs.bas"        ' serial modes
    INCLUDE "DT_INTS-18.bas"     ' Base Interrupt System
    INCLUDE "ReEnterPBP-18.bas"     ' Include if using PBP interrupts
    
    
    ' ---- setup registers ----------------------------
    ADCON0 = 0 ' A/D off
    ADCON1 = 0
    ADCON2 = 0
    ADCON3 = 0
    ANSEL0 = 0  'digital i/o
    ANSEL1 = 0
    INTCON.4 = 1 'enable INT0
    INTCON2.7 = 0 'pullups on
    INTCON2.6 = 0 ' Int 0 on falling edge of C3
    
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler   INT0_INT,  _ManualFire,   PBP,  yes
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    
    
    '---[INT0 - interrupt handler]--------------------------------------------------
    ManualFire:
        Camera_meter = 1
        Camera_shutter = 1
        pause 10
        Camera_meter = 0
        Camera_shutter = 0
        while portb.0=0:pause 10:wend
    @ INT_RETURN
    
    end
    Last edited by Ioannis; - 4th January 2010 at 09:44.

Similar Threads

  1. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  2. Microcode Studio 18f2455 problem?????
    By volkan in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 21st May 2007, 21:04
  3. Real Time Clock & Eeprom
    By smart_storm in forum General
    Replies: 8
    Last Post: - 17th February 2006, 19:03
  4. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 22:59
  5. PORTA.PinNo = 1 ' problem
    By frank small in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2004, 14:30

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