How instant are Instant Interupts?


Closed Thread
Results 1 to 29 of 29

Hybrid View

  1. #1
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305

    Default How instant are Instant Interupts?

    New project, in the "Is this even possible?" stage.
    Hardware is open to sugestion.

    I need to send out a pulse of any of the following durations depending upon settings: 1, 3, 5, 10, 30, 50, 100, 1000, 3000, 5000, 10000uS.

    I need a delay before the pulse is sent out of any of the following: 0, 20, 50, 100uS.

    Trigger input is TTL 5V rising or falling edge, selectable.

    I want to have a 2x8 LCD display and a few buttons to set up a menu to change and set all these options. On completion of saving the settings, a button can be preesed to activate and wait for an incoming pulse. That would be the main program.

    I need high accuracy on the o/p pulse delay and duration as this is a strobe light application for high speed cameras running 10,000 plus frame rates per second.

    Are Instant Interupts up to the task?

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


    Did you find this post helpful? Yes | No

    Default

    Everything but the 0 delay before the pulse.
    It would take external hardware for that.

    Assuming an 18F with high priority ASM type interrupts at high OSC speed.
    The rest should be possible.

    So the next question will be ...
    What is the exact interrupt latency?

    And the best way to answer that is to have you set up a timer with 1:1 prescaler triggering an interrupt.
    When the timer rolls over to 0, an interrupt is generated and the timer continues counting.

    When it reaches the handler, immediately turn the timer off.
    The value in the timer now has the exact number of instructions it took to get there (+1).
    It should be around 30-40 instructions. @ 40Mhz, that's 3-4 uS.
    <br>
    DT

  3. #3
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default

    Yeah, the 0 delay is going to be fun.

    I'd thought about something along the lines of a 555 setup as a one shot with a couple of caps that can be switched in to the circuit to get the low uS delay and pulse width. Caps are switched in or out with FET's thus having control through the menu system.

    Everything else is ran through the PIC timers.

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


    Did you find this post helpful? Yes | No

    Default

    555? Eeewwwww!
    I think the minimum monostable time is around 2uS.

    Actually, for the 0 delay, I was thinking you could do it with some 74HC NAND gates. A little tricky though.

    By creating a SET/RESET flip-flop that gets toggled immediately on the incoming pulse, it can "gate" the FOSC/4 out signal into Timer1.

    With a CCP module in COMPARE mode, you can load the delay time in CCPRxL:H prior to the pulses, and when it sees a match, it will output a pulse on the CCP pin which will reset the flip-flop, turning off the final pulse with great precision, and no software delay.

    Interrupts will probably still be needed to reset things for the next pulse, but the actual task is done by hardware.
    <br>
    DT

  5. #5
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default

    No I'd never use a 555 timer but I though about something along the same lines. In the past, the way way past, I had a project that used some really high stability and acurate timing IC's. I think the part number began with Z.
    Anyway, I do agree that hardware is the way to go for the 0 and 1uS delay.

    I've never used a PIC timer or a ccp so this should be good for learning.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jmgelba View Post
    ... I've never used a PIC timer or a ccp ...
    Then you won't want to do this.
    But here's what I was thinking in post#4 ...

    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3287&stc=1&d=123847625 4" /><!-- Name:  ZeroDelay.JPG
Views: 1258
Size:  23.5 KB -->

    This would be for Zero delay only, just to show the concept.
    But it only takes a couple changes to get full control (zero delay or interrupt timed, selectable).

    Some PIC's have a Gated Timer1 built into the chip. That would make the OSC config easier, and it wouldn't need the lower NAND gate.

    Zero Delay or Full Control, it still only takes one 74HC00, and the mode is selected by the PIC.

    Purely theoretical.
    <br>
    DT

Similar Threads

  1. DT's instant interupts compile problem
    By comwarrior in forum General
    Replies: 4
    Last Post: - 18th October 2009, 19:30
  2. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  3. Instant interupts
    By Sneaky-geek in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th March 2009, 19:18
  4. DT Instant Interrupt counting
    By jderson in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 9th March 2008, 22:47
  5. Instant Interupts with a 12f675
    By wlundonly in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 26th January 2008, 01:52

Members who have read this thread : 0

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

Posting Permissions

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