Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Sao Paulo - Brazil
    Posts
    92


    Did you find this post helpful? Yes | No

    Smile Multiple measurements with Instant Interrupts.

    Hi Darrel,

    some days ago, I was trying to measure the "ON time" of my car´s gasoline injectors (one of the 4)

    I´m using a 16F877 @ 10 Mhz, and I´m using the Timer0 as a 250 ms counter and Timer1 as a pulse counter, I ran out of possibilities of new measurements.

    Bruce told me that I should use a new device with more timers available, like the 18F4431 (or similar).
    The problem is : This device (or similar) is not available here in Brazil, and Microchip do not send samples to Brazil.

    I was reading this post about the interrupts and decided to ask :

    Is that possible to read the pulses on Timer1 on a fixed time interval (so, I would have the car´s speed and the mileage) and measure the injector on-time (so I would have the consumption) with the instat interrupts running on a 16f877 ?

    Thanks !

    Sergio

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


    Did you find this post helpful? Yes | No

    Default

    Sure you can.

    I'd use the Capture mode of the CCP modules using Timer1, for the ON time.

    Timer 2 can be the timebase used to count the speedometer pulses on the INT (external interrupt) pin.

    And the same signal from the Injector can be fed to T0CKI, so Timer 0 can count the RPM's too.

    Speed, Distance, Consumption and Tachometer.
    <br>
    DT

  3. #3
    Join Date
    Nov 2003
    Location
    Sao Paulo - Brazil
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    Wow !

    thank you !

    I´ll try it this weekend and post the results here !

    Bye !

  4. #4
    Join Date
    Jul 2007
    Location
    Spain
    Posts
    2


    Did you find this post helpful? Yes | No

    Question Instant Interrupt & EEprom

    Hi,

    how i use the instant interrupt (very nice pice of code) and the write or eeprom comand. In the manual they say to turn off all interrupts. Or is there no problem to use them together?

    Many Thx for reply

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


    Did you find this post helpful? Yes | No

    Default

    If an interrupt happens at just the right time, or actually just the Wrong time, it can cause the EEPROM write operation to fail.

    But it's not always necessary to turn off the interrupts.

    What I do, is write the value to EEPROM, then read it back and compare it to what it was writing. If they're not the same, go back and try to write it again.

    After a certain number of tries (I use 10, but it never takes that much), if it still hasn't written it properly, then turn off the interrupts and write it one last time.

    It takes a little extra code, and some extra time, but it doesn't mess with the interrupts.

    HTH,
    DT

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Hi, Darrel

    I'm playing with PbP Interrupts ( a Lawn tractor computer: Total run Time, Split time, RPM, max RPM, Air and Oil Temp and Oil press ... AND a maintenance reminder)

    ... AND ...

    I did not see an INT_DISABLE GLOBAL and INT_ENABLE GLOBAL Macros ... just for the compatibility with the others "interrupt control" macros ...

    Of course just to set "THE" INTCON.7 bit ... ( case is i.e.... using the asm "sleep" instruction !!! )

    No, no thats not to be called lazyness ...

    Nice playing ground ... Thank you once more !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    Hi Alain,

    You are absolutely correct.
    To keep everything consistant, there should be a GLOBAL for the INT_ENABLE/DISABLE.

    I will include that in the next version, which should be available very soon.

    Thanks for the idea's.
    Wish I received more of them.
    <br>
    DT

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