Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    I have.
    But they haven't been tested very thoroughly..

    The update also includes every interrupt source I could find for 14-bit cores. (including F1's).

    This page shows the added sources.
    If you use the menu on the left, it will take you back to the old version. So don't.
    http://www.darreltaylor.com/DT_INTS-14/intro2.html

    Download the file at the bottom of the page. Not the one from the Download page.
    DT_INTS-14 version 1.0

    Woohoo! It's 1.0 finally.
    But consider it still beta.
    DT

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,144


    Did you find this post helpful? Yes | No

    Default

    I like smiling faces!

    Amazing! Thanks.

    I have to test them on the new PICs. Wonder whenthey are coming...

    Ioannis

  3. #3
    Join Date
    Jun 2005
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Trying to reach Darrel...

    Hey Darrel--

    I've been trying to reach you re: the consulting I'd hired you to do. I've sent three emails with no response. If you need more money, I'm happy to pay it, and you also have $2200 of my company's equipment... won't you please reply to me?

    Thanks--

    --Alan McFarland
    www.nila.tv

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    That's just wrong, on so many levels.
    I have no Public response. But I will leave this post here.
    <br>
    DT

  5. #5
    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 19:28. Reason: Added Assembler info

  6. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Does it work if you disable A/D on RB0?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  7. #7
    Join Date
    Mar 2010
    Posts
    15


    Did you find this post helpful? Yes | No

    Default Odd

    I added the port configuration and acon register configs. That has an effect...
    The bootloader never leaves the bootloader mode to run the user app.

    if I comment out the Hardware configuration section and compile I can load the code via the bootloader, the device disappears from the USB list and then ~10seconds later I get the USB device not recognized.

    I have reloaded the led test program just to make sure the bootloader and chip are still working and they are. Very puzzling, but the registers do seem to have an effect.

    Nothing in the DT_INT writes to EEPROM 0x00? If there is a 5A there then the bootloader thinks its still in boot mode.

    Code:
        LED1   VAR  PORTB.0
        
        DEFINE OSC 20          
        DEFINE RESET_ORG 0x800  
        
        INCLUDE "DT_INTS-18.bas"        ' Base Interrupt System
        INCLUDE "ReEnterPBP-18.bas"     ' Include if using PBP interrupts                                           
    
        '   Hardware configuration
        '   ======================    
            '
            '   I/O and PORTs
            '   -------------  
        PORTB   =   0
        PORTC   =   0
        PORTD   =   0
        PORTE   =   0
        TRISB   =   %00000000       '<2-1> Inputs
        TRISC   =   0
        TRISA   =   0
        TRISD   =   0
        TRISE   =   0
            '
            '   A/D converter
            '   -------------       
        ADCON0  =   %00000000       ' A/D converter off     
        ADCON1  =   %00001111       ' All Digital Inputs
     '   ADCON2  =   %00000000 
                               
    
    
    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 10  
    GOTO Main
    
    '---[TMR1 - interrupt handler]--------------------------------------------------
    ToggleLED1:
         TOGGLE LED1
    @ INT_RETURN
    Still puzzled...

  8. #8
    Join Date
    Mar 2010
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    This hardware config give the same results as the original issue...ie the LED does not blink and the code appears to run off into la la land. Not sure how it is being detected as a usb device with the DT_INTS-18 code.

    Code:
        '   Hardware configuration
        '   ======================    
            '
            '   I/O and PORTs
            '   -------------  
        PORTB   =   0
        PORTC   =   0
        PORTD   =   0
        PORTE   =   0
        TRISB   =   %11111110       '<7:1> Inputs
        TRISC   =   0
        TRISA   =   0
        TRISD   =   0
        TRISE   =   0
            '
            '   A/D converter
            '   -------------       
        ADCON0  =   %00000000       ' A/D converter off     
        ADCON1  =   %00001111       ' All Digital Inputs
        ADCON2  =   %00000000
    I have two port b pins connected together as part of the ICSP and 2 others connected for inputs off a single PB. Setting the TRISB to FE is what got me back to the original problem.

  9. #9
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    I've never used this loader, but I did take a quick peek at the source files.

    Try this;
    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
        
    '   Hardware configuration
        '   ====================== 
        ADCON1  =   %00001111       ' All Digital Inputs                         
    
    
    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 10  
    GOTO Main
    
    '---[TMR1 - interrupt handler]--------------------------------------------------
    ToggleLED1:
         TOGGLE LED1
    @ INT_RETURN
    Remove power. Place a jumper from PORTE.0 to ground. Power up & load the above after compiling it.

    After programming it with the loader, power down. Move the jumper on PORTE.0 to Vcc, and power up.

    Does it work now?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  10. #10
    Join Date
    Mar 2010
    Posts
    15


    Did you find this post helpful? Yes | No

    Default Same result

    If I don't have the TRISB config the bootloader never enters the user program mode.

    I added the TRISB = %1111110 and it enters the user program but still shows an undetected USB device after a few seconds and the LED on PORTB.0 is still not blinking.

    One more piece of info, I am getting power from the USB port on my laptop. Even though the user program is not using USB I am "stealing" power for this test setup from the USB port. i.e. I download the program to the bootloader through the PIC USB and leave the cable connected to power the board for testing.

    It doesn't look like anything in the DT_INTS would be triggered from activity on the USB port since I have not explicitly configured the USB_INT. The PIC is certainly seeing a request from the PC since its connected to the PIC circuitry and that could be why I get the USB device not recognized...although I don't get that when i am running just the Blink program using PAUSE 500 statements.

    When I get home later tonight I will load this program directly on the PIC through the ICSP without the bootloader to verify my setup is happy. Then I will try the bootloader again and use an external power supply instead of the USB power.

    ADDED: I have reconfigured the Bootloader to use PORT B.1 instead of Diolan's default of PortE.0. My end application will use Port B.1 so I built this test board assuming portb.1 would work.
    Last edited by vamtbrider; - 25th March 2010 at 21:53. Reason: Added Bootloader Jumper Information

  11. #11
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Thanks for the help Darrel.

    I will look into it further. I had initialized stepcount to 32, then later to 8. Seems to get stuck after about two flashes of the led's.

    Walter

  12. #12
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Maybe you need to set PCLATH before changing PCL?
    DT

  13. #13
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Help with assembly table lookup with DT INTS?

    Is there a way to use an assembly lookup table from within a DT INTS ASM interupt? When I try, the interrupt locks up on me. If I comment out the CALL SineTable, all is fine. I have tried it a few different ways, but no go so far.

    Code:
    INCLUDE "DT_INTS-18.bas"     ; Base Interrupt System
    LOW  LED1     
    high led2     
    ASM
    
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler   TMR1_INT,   ToggleLED1,   ASM,  yes
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    
    T1CON = $31                  ; Prescaler = 8, TMR1ON
    @   INT_ENABLE  TMR1_INT     ; Enable Timer 1 Interrupts  
    
    Main:
        @ NOP
    GOTO Main
    
    '---[TMR1_INT - interrupt handler]------------------------------------------
    ASM
    
    ToggleLED1
            btg     _LED1               ; toggle the pin
            btg     _LED2
    StepLoop
            movf    _STEPCOUNT,W    ; Pass table offset via W
            call    SineTable    ; Get table value 
            movwf   CCPR1L
            decfsz  _STEPCOUNT,F    ; Next step
            goto    $+6
            movlw   d'32'
            movwf   _STEPCOUNT ;_STEPCOUNT    ; Load counter for 32 steps  
            NOP
            NOP
            NOP
            NOP
        INT_RETURN
    SineTable   
            addwf   WREG        ;added for pic18f each address is 16 bits
            addwf    PCL,F
            retlw   d'0'          ; Dummy table value
            retlw   d'128'        ; 0 degree, 2.5 volt
            retlw   d'148'
            retlw   d'167'
            retlw   d'185'
            retlw   d'200'
            retlw   d'213'
            retlw   d'222'
            retlw   d'228'
            retlw   d'230'        ; 90 degree, 4.5 volt
            retlw   d'228'
            retlw   d'222'
            retlw   d'213'
            retlw   d'200'
            retlw   d'185'
            retlw   d'167'
            retlw   d'148'
            retlw   d'128'        ; 180 degree, 2.5 volt
            retlw   d'108'
            retlw   d'89'
            retlw   d'71'
            retlw   d'56'
            retlw   d'43'
            retlw   d'34'
            retlw   d'28'
            retlw   d'26'        ; 270 degree, 0.5 volt
            retlw   d'28'
            retlw   d'34'
            retlw   d'43'
            retlw   d'56'
            retlw   d'71'
            retlw   d'89'
            retlw   d'108'
    ENDASM

  14. #14
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    You should be able to do that.

    But I think you need to initialize the STEPCOUNT variable, or put a CLEAR at the top.
    If it powers up with a value higher than 32, the table jump will throw it outside of the interrupt code.

    hth,
    DT

  15. #15
    Join Date
    Feb 2010
    Posts
    3


    Did you find this post helpful? Yes | No

    Default DT site down...

    Hi,

    I´m not being able to access Darrell´s website to download DT_INTS-14 (I already use INTS-18, which is great, but I´m working on a project which runs on a 16F628A this time). Can someone please attach the latest version of both INTS-14 and INTS-18 to this thread, so people can download even if the site is down?

    Thanks!

  16. #16
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Here is the latest version 1.00 of DT_INTS-14. The link is to is site, which is back up. http://www.darreltaylor.com/DT_INTS-14/NEW_DT_INTS.zip

    More info on above:http://darreltaylor.com/DT_INTS-14/intro2.html
    Older version of above:http://darreltaylor.com/DT_INTS-14/intro.html

    and here is the latest version of DT_INTS-18 http://www.picbasic.co.uk/forum/showthread.php?p=82871
    More info on DTS_INTS-18: http://darreltaylor.com/DT_INTS-18/home.html

    Besides the webpages above, this post contains info about the time re-enter takes, which I did not see details of on Darrel's site.
    http://www.picbasic.co.uk/forum/show...7587#post17587
    Last edited by ScaleRobotics; - 6th February 2010 at 15:40.

  17. #17
    Join Date
    Feb 2010
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    Here is the latest version 1.00 of DT_INTS-14. The link is to is site, which is back up. http://www.darreltaylor.com/DT_INTS-14/NEW_DT_INTS.zip

    More info on above:http://darreltaylor.com/DT_INTS-14/intro2.html

    and here is the latest version of DT_INTS-18 http://www.picbasic.co.uk/forum/showthread.php?p=82871
    Still down for me here in Brazil... Even tried do flush my DNS cache to make sure... Would you be kind enough to attach INTS-14 to your post, so I can continue working?

    Thanks!

  18. #18
    Join Date
    Feb 2010
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    Thanks. Now only the only file I still need is elapsed_int-14. Could you please upload that one as well?

    Thanks again!

  19. #19
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by younesmaia View Post
    Now only the only file I still need is elapsed_int-14. Could you please upload that one as well?
    I think the latest version of that is still this one: http://www.picbasic.co.uk/forum/show...7473#post17473

  20. #20


    Did you find this post helpful? Yes | No

    Question

    Am I the only one confused by the "ALL_INT -- Global Interrupts" interrupt source?

Similar Threads

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

Members who have read this thread : 5

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