Problem Programming 16F870 when adding ON INTERRUPT


Results 1 to 7 of 7

Threaded View

  1. #3
    Join Date
    Jul 2010
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Intcon.5 = 1 'enable tmr0
    Unfortunately this didn't do anything

    I just tested this code on a 16F870 and a 16F628A:

    Code:
    led     var     PORTB.7
    
    
            OPTION_REG = $7f        ' Enable PORTB pullups
    
            On Interrupt Goto myint ' Define interrupt handler
            INTCON = $90            ' Enable INTE interrupt
    
    loop:   High led                ' Turn LED on
            Goto loop               ' Do it forever
    
    
    ' Interrupt handler
            Disable                 ' No interrupts past this point
    myint:  Low led                 ' If we get here, turn LED off
            Pause   500             ' Wait .5 seconds
            INTCON.1 = 0            ' Clear interrupt flag
            Resume                  ' Return to main program
            Enable
    I get the error in the PROGRAMMER in both cases. The error is in the code verification stage.

    Why would the programmer give this type of error, as if the code was not being written properly to the PIC? If I remove the "ON INTERRUPT" line, the code saves perfectly. I have been using this programmer for a while and had no problems until this one.

    Is the PICBASIC compiler inserting code in a non-programable area or something?
    Last edited by dream-; - 2nd August 2010 at 22:49.

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts