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


    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

  2. #2
    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

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


    Did you find this post helpful? Yes | No

    Default

    2 different projects/ideas.

    This last one has nothing to do with the first one. Its a pulse follower with a protective cut off.

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


    Did you find this post helpful? Yes | No

    Default

    I am still very interested in the first one and looking forward to taking a look at the code.

    The second one was me trying to learn timers and how to manipulate them.

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


    Did you find this post helpful? Yes | No

    Default

    And now for something Completely Different!

    Main brains only got 1 track left.
    Ya gotta tell me when to switch to track B ...

    OK, back to the first problem.
    I've got this code for the last schematic.
    It hasn't even seen an electron yet, but I think it's close, although it's guaranteed to change.

    I'm trying to make a breadboard for it.
    But it's going slower than anticipated. (blame Half-Life).

    Here's what I got ...
    http://www.pbpgroup.com/files/ZeroDelay1.htm
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Interesting peice of code - over my head for the moment.

    Going back to the pulse following example, here is a piece of code I came up with at about 4am this morning.

    Code:
    OSCCON = $70 'set internal resonator to 8mhz
    DEFINE OSC 8
    ADCON0 = %00000001
    ADCON1 = %01111100
    ADCON2 = %10111110
    
    PORTB = %00000111 
    TRISA = %11111111
    TRISB = %11110000
    
    loop:
    IF PORTA.5 = 0 THEN flash
    GOTO loop
    
    FLASH:
    PORTB = %00001100          'turns on fets
    A = 0                               'resets count to 0
    
    while A <= 5                      'follow status of i/p turn off fets if i/p goes away
    PORTB = %00001100           
    A = A + 1
    IF (PORTA.5 = 1) THen
    PORTB = %00000111
    WEND
    if (A <=4) THEN
    GOTO loop
    if (A = 5) then                    'if A=5 fets are still on
    pauseus 1500                     'set max time for fets to be on
    PORTB = %00000111           'turn off fets
    IF (PORTA.5 = 0) THEN        'if i/p is still on, wait 2ms then repeat loop
    pause 2 
    return

  7. #7
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    jmgelba , These lines will never execute because of the value of "A" before hand.

    if (A <=4) THEN <<<<<<<<<<<<<<<<<<<<<<<<< here A = 6
    GOTO loop
    if (A = 5) then 'if A=5 fets are still on <<<<<<<<<<<<<<<< here A = 6
    pauseus 1500 'set max time for fets to be on
    PORTB = %00000111 'turn off fets

    Also wheres the ENDIF's?

    Dave Purola,
    N8NTA

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