16f88 interrupt


Results 1 to 12 of 12

Thread: 16f88 interrupt

Threaded View

  1. #11
    Join Date
    Mar 2008
    Location
    london
    Posts
    15


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by mister_e View Post
    try this one
    Code:
            @ DEVICE INTRC_OSC, LVP_OFF, WDT_OFF, MCLR_OFF
            
            DEFINE OSC 4
            OSCCON=%01101000
            ANSEL=%00000000
            CMCON=%00000111
            
            OPTION_REG.6=1 'Trigger on rising edge
            
            trisa = %11111111
            trisb = %00000001
            CounterA    var word
    
            On Interrupt Goto UpdateCounter
            INTCON = %10010000 'Enable INTE
            
            PORTB=0
            Pause 50 ' Wait for startup
    
    loop:
            TOGGLE PORTB.5
            gosub dodelay
            Goto loop 
            
    DoDelay:
            for countera=0 to 200
                pause 1
                next
            return        
    
    
    disable
    UpdateCounter:
            low PORTB.5
            high portb.6
            Pause 2000 ' Wait 2 second
            low portb.6
            INTCON.1=0 're-enable interrupts
    resume
    ENABLE
    thank you very much , it was the trisb=0000001 command that resolved the problem. it works as expected but one more thing is not right, the portb.6 output 1.62 volts when the program goes through interrupt instead of giving a 5 volts output (a good logic one) as expected.
    is it supposed to be like this?????

    thank you again.
    Last edited by tur_bot; - 2nd April 2008 at 11:00. Reason: last little problem

Similar Threads

  1. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 02:35
  2. NEWBIE: Some basic questions using interrupts
    By JackPollack in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th March 2006, 02:59
  3. 16F88 Interrupt
    By sskeet in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 24th January 2006, 15:51
  4. How to use an Interrupt to drive a menu on 16f88
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th March 2005, 01:16
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

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