How instant are Instant Interupts?


Closed Thread
Results 1 to 29 of 29

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Keeping the thought alive

    Here's an update for the last post.
    Two 74HC86 XOR gates have been added to be able to invert the input and output polarities.

    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3300&stc=1&d=123889536 2" /><!-- Name:  ZeroDelay3.GIF
Views: 1066
Size:  14.1 KB -->

    I see that you specified "Trigger input is TTL 5V rising or falling edge, selectable." in the first post.
    I must have missed that part.

    I could be diverging from what you want to do.
    But the problem is intriguing, so I'm continuing onward ... thru the Fog.

    I think the circuit above gives you all the capabilities you're looking for.

    I did a quick pseudo-program to see what it would take for a simple test without interrupts, and it was surprisingly easy.

    If you can settle on a PIC to use ... preferably 2-CCP's (1 for the FOSC4).
    Could probably come up with something that's close.

    I love shooting things ... with camera's.
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Looks like 18F4220 at the moment. I only have v2.43 so I am limited in which devices I can use. I cant find my reciepts or proof of purchase anywhere to get the upgrade.

    I need a decent amount of I/O's. 2x8 lcd, at least 4 or 5 switches, status led's, logic gates, fet drive, lcd back light, adc for capacitor charge level/status.

    I'm not a coder or really much of a hardware guy, but I am a power supply and LED guy. If only I could show you some of the stuff going on here.....

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


    Did you find this post helpful? Yes | No

    Default

    I cant find my reciepts or proof of purchase anywhere to get the upgrade
    If you bought PBP from us, we can look it up for you, and send you a copy of your original
    receipt.

    Most other distributors should be able to do something similar to help you get the upgrade.
    Regards,

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

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


    Did you find this post helpful? Yes | No

    Default OK, talk to me about timers

    Part of this project is obviously timing.

    Say I have a pulse coming in at between 50 and 200uS and I need to match this incoming pulse to an output. Not really a problem.

    IF PORTA.0 = 1 THEN PORTA.1 = 1

    But what if that incoming pulse is longer than the 200uS and the output must be shut off after a predetermined maximum, lets say 1000uS?

    IF PORTA.0 = 1 THEN PORTA.1 = 1 no longer works. TMR0 has to be triggered at the same time as PORTA.1 goes high, then needs to count to a maximum of 1000uS and make PORTA.1 = 0.
    PORTA.1 then must be kept low until PORTA.0 has gone low.
    When PORTA.0 = 0 TMR0's flag can be reset and wait for PORTA.0 to go high again. If PORTA.0 has gone low before TMR0 has set the flag, it must be reset and ready to count to 1000uS.

    Does this make sense?

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


    Did you find this post helpful? Yes | No

    Default

    If you're doing it with software polling, timers don't add much value unless you plan on doing other things at the same time. But all that really makes things complicated.

    So here's a simple example that does the same thing with pauseus instead of a timer.
    Code:
    Delay = 1000
    
    Wait4Pulse: 
        IF !PORTA.0 THEN Wait4Pulse     ; Wait for incoming pulse
        PORTA.1 = 1                     ; Start Output pulse
        PAUSEUS Delay                   ;   pause for pulse width
        PORTA.1 = 0                     ; End of Output pulse
    
    Wait4PulseEnd:                      ; Make sure input pulse is finished
        IF PORTA.0 THEN Wait4PulseEnd
    
    GOTO Wait4Pulse
    Last edited by Darrel Taylor; - 9th April 2009 at 00:16.
    DT

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


    Did you find this post helpful? Yes | No

    Default

    DT, that wont work. The output has to reflect the input up to a maximum on time then the output has to be turned off regardless of input state.

    Code:
    Delay = 1000
    
    Wait4Pulse: 
        IF !PORTA.0 THEN Wait4Pulse     ; Wait for incoming pulse
        PORTA.1 = 1                     ; Start Output pulse
        PAUSEUS Delay                   ;   pause for pulse width *** this will keep the output on for 1000uS, not for the duration of PORTA.0 = 1
        PORTA.1 = 0                     ; End of Output pulse
    
    Wait4PulseEnd:                      ; Make sure input pulse is finished
        IF PORTA.0 THEN Wait4PulseEnd
    
    GOTO Wait4Pulse

  7. #7
    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
    DT, that wont work. The output has to reflect the input up to a maximum on time then the output has to be turned off regardless of input state.
    Now you tell me!
    That wasn't part of the plan.

    The schematics above don't apply then. Nor does the example.
    <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