Instant Interrupts - Revisited - Page 13


Closed Thread
Page 13 of 20 FirstFirst ... 391011121314151617 ... LastLast
Results 481 to 520 of 773
  1. #481
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,802


    Did you find this post helpful? Yes | No

    Default

    Thanks Darrel. Besides the wsave3 thing I had to commend out, yes it helped.

    Now is fine.

    About the disable interrupt, will the timer be enabled upon @ INT_RETURN ?

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    Also if I want to disable TMR0 interrupts inside the timer0 INT Handler, will the Interrupts be enabled on exiting the routine? Like this:

    Code:
    INT_Service_TMR0:
    @ INT_DISABLE TMR0_INT
        tmr0=21                 'Preload for 60msec time out
        timer0=1                'timer 0 has timed out flag
    @ INT_RETURN    <<<<<<<<----------------Here I do not want to enable timer0
    No it will not be re-enabled automatically.

    And you won't get any more interrupts from the timer untill there's an @ INT_ENABLE TMR0_INT somewhere else in the program.

    The Timer will continue to run and overflow, so the next time you Enable the timer ints ... make sure you clear the flag first or it will immediately jump into an unwanted INT.
    @ INT_CLEAR TMR0_INT
    <br>
    DT

  3. #483
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,802


    Did you find this post helpful? Yes | No

    Default

    OK. Better is to use Tmr1 but not available at the moment.

    Thank you very much.
    Ioannis

  4. #484


    Did you find this post helpful? Yes | No

    Thumbs up

    Thanks! ...Hadn't noticed because the main routine wasn't doing anything, and the other Led still seamed to toggle at 1 Hz...

  5. #485


    Did you find this post helpful? Yes | No

    Smile

    I still had some strange anomalies going on...
    reading GPIO.2 to a testvariable (Testbit VAR BIT BANK0)
    just before the @ INT_RETURN seems to solve those...

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


    Did you find this post helpful? Yes | No

    Default

    Good Point Michael,

    I'll have to remember that.
    <br>
    DT

  7. #487
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126


    Did you find this post helpful? Yes | No

    Default New Enhanced Core Pics 16f193x ?

    Hey Darrel,
    Have you had a chance to try any of the new enhanced core pics yet ?

    I have a few 16f1936 chips on order and would love to know if you have had a chance to play with DT_INT on them yet.

    bill

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by bcd View Post
    I have a few 16f1936 chips on order and would love to know if you have had a chance to play with DT_INT on them yet.
    Did you order them in the QFN package?
    Apparently the SOIC's won't be available from Microchip till November

    I think the only thing you can get in a DIP package so far is the 1934, but they're usually out of stock on those.

    I have some on order too, have no idea when I'll get them.

    Consequently, DT_INTS will not work with the "E" (F1) chips.
    <br>
    DT

  9. #489
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126


    Did you find this post helpful? Yes | No

    Default

    Got 16f1936 and 16f1937 in DIP and some 16f1936 in SOIC due to arrive with UPS today.
    Ordered them last week from microchip direct.

    Want me to send you a couple ?

    Bill.

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


    Did you find this post helpful? Yes | No

    Default

    Ohhhh, that's great news.
    And thanks for the offer.

    I should have looked at Microchip Direct more often.
    There's all kinds of them now.

    They are on order.
    Supposedly shipping tomorrow.

    Thanks for the reminder Bill!
    <br>
    DT

  11. #491
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Wink

    Never used an interrupt before in my life, but am going to try in my current project. I need to use the 'interrupt-on-change' capability of the 18F to detect (and hopefully count) the decoded clock output from a rotary encoder. Do you have (or) can you point me to, an example of 'interrupt-on-change' using your routines?

    Thanks very much, and I'm waiting to see the unfinished pages on your site, Darrel!

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


    Did you find this post helpful? Yes | No

    Default

    ... I need to use the 'interrupt-on-change' capability of the 18F to detect (and hopefully count) the decoded clock output from a rotary encoder.
    Try this one from SteveB ...

    http://www.picbasic.co.uk/forum/show...5396#post25396

    There were some changes to it, so read the rest of the thread too.

    hth,
    DT

  13. #493
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Smile

    I'm on it, and thanks!

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


    Did you find this post helpful? Yes | No

    Default

    WOW!

    Kudos to Microchip Direct!!!
    Ordered them on the 5th, shipped from Thailand on the 6th, received on the 8th.
    I can't get anything from California shipped that fast.

    5 - 16F1937
    5 - 16F1936
    1 - 16F1934

    $34 with shipping (Fed-Ex).

    Everything else is on hold.
    Time to update DT_INTS-14.
    <br>
    DT

  15. #495
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,802


    Did you find this post helpful? Yes | No

    Default

    I can double that. My experience with Microchip Direct was wonderful.

    Either 1 pcs or 250, service is top.

    Ioannis

  16. #496
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Thumbs up

    Darrel,

    Want to thank you again for your Instant Interrupts. I inserted them into my huge 18F program, and the elapsed timer is working perfectly! Am going to watch your website and waiting for the "Command Reference"!!

  17. #497
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126


    Did you find this post helpful? Yes | No

    Default I'll third that !!

    I find it is actually easier and quicker to deal with Microchipdirect than the local microchip office - seems to be a lot cheaper as well ! I wonder if the office just orders online and then drop ships ???

    Glad to hear you got some new toys ! Looking forward to the news.

    bill.

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


    Did you find this post helpful? Yes | No

    Default

    These chips are Amazing ....
    They've got everything you could need in a 16F.
    I think I even found a kitchen sink

    And they are backwards compatible enough that it shouldn't even take very long for the update to DT_INTS.

    At $2.52 ea. for the 40-pin jobs, I may never use another 16F.<hr>

    And for the "Command reference" ... It's been waiting a few years now.
    Everyone just kinda picked it up and went with it. So I got lazy.
    Should've, could've, would've, maybe ...
    <br>
    DT

  19. #499
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126


    Did you find this post helpful? Yes | No

    Default

    I love the fact they are 5v as well - seemed a lot of the newer 18f series were moving to 3.3v only.

    I think they are my new favourite series of PICs.

    bill

  20. #500
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,802


    Did you find this post helpful? Yes | No

    Default

    I do not want to destroy the good climate that 16F193x have created, but look at the errata file 80479A.pdf. They have some issues that may affect users that will use EEPROM or CCP rgisters.

    Ioannis

  21. #501
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,802


    Did you find this post helpful? Yes | No

    Default Time to respond to an interrupt.

    I think next one Darrel has to answer, but if anyone knows...

    How fast will the DT-INTS 14 interrupts (with PBP service) respond to a PORTB Interrupt on change?

    Or better put, how many cycles will it take?

    I am testing a Wiegand-26 reader the has 48uSec pulses every 2ms and at 4MHz the 16F628 chip does not feel it at all.

    Another reader the has 0,38ms pulse is OK with the 16F628. The PIC is running rather slow at 4MHz.

    I'd prefer a way to calculate the time it takes to respond on an Interrupt.

    My service test routine is something like this:

    Code:
    CardReader:
       if d0=0 then
            array[index]=0
            index=index+1
        endif
       
        if d1=0 then
            array[index]=1
            index=index+1
        endif
    @ INT_RETURN
    Ioannis


    P.S. After some testings I found that the pulse must stay at more that 150uSec for the PIC to grab it. Thats it at 4MHz.
    Last edited by Ioannis; - 14th October 2009 at 17:05.

  22. #502
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,802


    Did you find this post helpful? Yes | No

    Default

    Sorry I missed the Edit window time.

    The 150uSec is really 115uSec...

    Ioannis

  23. #503
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Question Which type of interrupt is easier to implement?

    DT,

    I have only used interrupts once, (using Instant Interrupts) based on your clock routine. I am starting a design in which I want to again use your interrupt routines, (and I admit I haven't read all your examples and documentation yet). I'm at the point where I'm making a first guess at pin assignments on a PIC18F67J60. I know I'm going to have to use the clock output of a rotary encoder as one interrupt source, and a generic 'some button has been pushed' kind of interrupt from a bunch of PCF8574's as another. Being really new at interrupts, which would more straightforward to implement... the PortB 'onchange interrupts', or individual B0 (Int0), and B1 (Int1) dedicated interrupts?

    Thanks much,
    Len G.

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


    Did you find this post helpful? Yes | No

    Default

    It really depends on what you need to catch.

    If you only need to catch either the Rising or Falling edge of a signal, then it's much easier to use INT1, INT2 and INT3.

    But it you need to catch both edges, then the best route is RBC_INT (PORTB Change) on PORTB.4-7.

    So I'd guess buttons on INT?, and encoders on RBC.
    <br>
    DT

  25. #505
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    Thank you.

  26. #506
    Join Date
    Nov 2008
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel,
    i use your instant interrupts on a 18F6722.
    A question to the interrupts:
    I want to use a timer which shall make 1sec ticks and i have both uarts receving commands from other devices. I also have two subs writing and reading via I2C-Bus to some internal devices. Problem: If having more and more activity on the i2c bus and also interrups are coming via the uarts, the timer is getting slower (2 - 3 sec) depending on the activity.
    All interrups are defined as high priority interrups.
    Any idea?

    Regards,
    Ralf

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ralfmayr View Post
    I want to use a timer which shall make 1sec ticks and i have both uarts receving commands from other devices. I also have two subs writing and reading via I2C-Bus to some internal devices. Problem: If having more and more activity on the i2c bus and also interrups are coming via the uarts, the timer is getting slower (2 - 3 sec) depending on the activity.
    All interrups are defined as high priority interrupts.
    Any idea?
    Hi Ralf,

    Do you have PAUSEs in your handlers?
    Interrupt handlers should be as fast as possible, get in - do only what needs to be done - and get out.

    If for instance it were writing to I2C EEPROM then sitting around waiting 10mS for each write to complete, then no other interrupts can occur during that time that it's doing nothing.

    If you have pauses, or long strings of data being sent or received, then those handlers should be LOW PRIORITY. Then with the Timer still in High Priority, it won't miss a beat.

    hth,
    DT

  28. #508
    Join Date
    Nov 2008
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel,
    thanks for the answer.
    I don't have any pauses, the i2c bus writes and reads ad-converters and io-expanders, no eeproms.

    I think the main problem is the handler for the uarts. The interrups for the uarts are handled as fast as possible, i read back the RCSTA registers and then i put the data in an array, by triggering on "{" and "}" for start of text and end of text. When "}" was received the serial command is valid and then i parse the string.
    After that i handle my i2c bus and so on....
    Maybe it is more effective to make a ring buffer, and when ever there is time then i check this buffer and parse the data in it. But i never made such a ring buffer.....

    Regards,
    Ralf

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


    Did you find this post helpful? Yes | No

    Default

    Receiving data 1-byte at a time is always the best way to do it with USARTs and interrupts.

    No Timeouts, no WAIT(), and no long strings.

    For a simple Ring buffer, check out Joe S.'s Serial Backpack program, modified for DT_INTS.

    http://www.picbasic.co.uk/forum/show...8336#post28336
    <br>
    DT

  30. #510
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default Pbpl?

    I hope this hasn't been answered already but,

    What about using Instant Interrupts with PBPL? Should they work? I'm really hoping I'm just doing something wrong cause I'm gonna need them!! (I'm using Ver 2.50 and 2.60 is in the mail)
    :-|
    Last edited by circuitpro; - 10th December 2009 at 01:41.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by circuitpro View Post
    What about using Instant Interrupts with PBPL? Should they work?
    Yes they should.
    <br>
    DT

  32. #512
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Unhappy

    With the PBPL box checked in the compiler options, when I put in your
    3 INCLUDE statements:

    INCLUDE "DT_INTS-18.bas"
    INCLUDE "ReEnterPBP-18.bas"
    INCLUDE "Elapsed_INT.bas"

    I get a compile error saying:

    Error [113] c:\blue1\pbp\pbppi18l.lib 1465: Symbol not previously defined (INT_ENTRY_H)

    Does that mean anything to you? No errors without those INCLUDES. No errors if I change to PBP instead of PBPL. (except my LONG variable errors, of course!)
    Last edited by circuitpro; - 10th December 2009 at 02:51.

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


    Did you find this post helpful? Yes | No

    Default

    By themselves, the include files will not compile.

    There must be an INT_LIST and INT_CREATE in your program.
    Code:
    INCLUDE "DT_INTS-18.bas"
    INCLUDE "ReEnterPBP-18.bas"
    INCLUDE "Elapsed_INT-18.bas"  ; Elapsed Timer Routines
    
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler   TMR1_INT,  _ClockCount,   PBP,  yes
        endm
        INT_CREATE            ; Creates the interrupt processor
    ENDASM
    
    @   INT_ENABLE  TMR1_INT  ; Enable Timer 1 Interrupts
    You'll need the -18 version of the Elapsed Timer too.
    http://darreltaylor.com/DT_INTS-18/downloads.html
    DT

  34. #514
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Red face

    O. Well, u know I'm a newbie at this. sorry to bother you.

  35. #515
    Join Date
    Feb 2006
    Location
    Brussels, Belgium
    Posts
    104


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post

    You should NOT set INTCON, PIEx, PIRx, IPRx or any other interrupt related registers manually. DT_INTS handles all of those bits for you.
    So where in D_INTS do you configure if you want to trigger off a rising or falling edge for something like INT0 ?

    Thanks, Andrew

  36. #516
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,802


    Did you find this post helpful? Yes | No

    Default

    This is supposed to be done in the option register, isn't it?

    DT-INTS are not for settings.

    Ioannis

  37. #517
    Join Date
    Feb 2006
    Location
    Brussels, Belgium
    Posts
    104


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    This is supposed to be done in the option register, isn't it?

    DT-INTS are not for settings.

    Ioannis
    See my first post - Darrel says not to set the interrupt registers manually.

    Andrew

  38. #518
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,802


    Did you find this post helpful? Yes | No

    Default

    This one you should set it yourself. Otherwise how would the system know what you want?

    Ioannis

  39. #519
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,802


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    WOW!

    5 - 16F1937
    5 - 16F1936
    1 - 16F1934
    Time to update DT_INTS-14.
    <br>
    Hi Darrel. Did you had any luck with these new chips?

    Ioannis

  40. #520
    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

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 : 10

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