Instant Interrupts - Revisited


Results 1 to 40 of 773

Threaded View

  1. #11
    Join Date
    Mar 2010
    Posts
    15


    Did you find this post helpful? Yes | No

    Question Diolan Bootloader, 18F4550, DT_INTS-18

    I have a small test board that has an ICSP and a USB connection to a pic 18f4550. I have a reset button on the MCLR and a second button on portb.1. An led is connected to portb.0

    The ICSP is used to program a bootloader onto the chip. Then USB is used to add the user program.

    I have loaded the Diolan bootloader onto this chip and it is working.

    I can make a test program in PBP 2.6 that flashes the LED on port b.0
    like this: The Bootloader required code to start at 0x800

    Code:
    DEFINE OSC 48
    DEFINE RESET_ORG 0x800
    ' Example program to blink an LED connected to PORTB.0 about 
    ' once a second
    
    Main:   
       High 0          ' Turn on LED connected to PORTB.0
       Pause 500       ' Delay for .5 seconds
    
       Low 0           ' Turn off LED connected to PORTB.0
       Pause 500       ' Delay for .5 seconds
    
       Goto Main       ' Go back to loop and blink LED forever
       End
    The above program works as expected. So the next step was to try the DT_INTS-18 with the bootloader...the code appears to load into the PIC fine, but after reset there is a pause of about 5 seconds then the chip shows up as an un-recognized USB device but does not enter the bootloader mode. To enter bootloader mode the PB on portb.1 is held down during power-on/reset. OR the user application can branch to 0x0016.

    It appears the program is branching somewhere to restart the bootloader code since the pic shows up as an unrecognized USB device. It should not show up at all after the code is loaded since I don't have any usb code in the user app listed below.

    Here is my test program with the DT_INTS-18 that is not working...
    Code:
        DEFINE OSC 20          
        DEFINE RESET_ORG 0x800  
                              
    INCLUDE "DT_INTS-18.bas"     ' Base Interrupt System
    INCLUDE "ReEnterPBP-18.bas"     ' Include if using PBP interrupts
    
    LED1   VAR  PORTB.0
    
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler   TMR1_INT,  _ToggleLED1,   PBP,  yes
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    
    T1CON = $31                ; Prescaler = 8, TMR1ON
    @ INT_ENABLE  TMR1_INT     ; enable Timer 1 interrupts
    
    Main:
      PAUSE 1
    GOTO Main
    
    '---[TMR1 - interrupt handler]--------------------------------------------------
    ToggleLED1:
         TOGGLE LED1
    @ INT_RETURN

    Any thoughts on why it's not blinking the led using the DT_INTS-18 code and running off into la la land?

    ADDED: I am using the MPASM assembler as well.

    Thanks
    Tom
    Last edited by vamtbrider; - 25th March 2010 at 20:28. Reason: Added Assembler info

Similar Threads

  1. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 22:43
  2. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 21:02
  3. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 21:48
  4. Keypad and DT's Instant Interrupts
    By Homerclese in forum General
    Replies: 11
    Last Post: - 27th April 2007, 07:32
  5. Replies: 1
    Last Post: - 1st November 2006, 04:11

Members who have read this thread : 4

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