Triggering 5 TTL clocks simultaneously


Closed Thread
Results 1 to 40 of 84

Hybrid View

  1. #1
    TurboLS's Avatar
    TurboLS Guest


    Did you find this post helpful? Yes | No

    Default

    So I guess I could have it running in the background, then when I want to start the horizontal clocks, I could do an ON INTERRUPT command to make sure it is on the rising edge of the Reset HWPM clock.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    you don't have to make sure it's on the rising edge. Interrupt will do it for you. When you set your interrupt you can select rising or falling edge.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    TurboLS's Avatar
    TurboLS Guest


    Did you find this post helpful? Yes | No

    Default

    And I set that in the registers, right? And then I can run a wire from PIN 17 to an interrupt pin and do an ON INTERRUPT command? Would it look something like this or totally different? I am going to try and find some examples.

    horizloop:
    ON INTERRUPT
    PORTB.2 = 0
    PORTB.3 = 1
    PAUSEUS 139
    PORTB.3 = 0
    PORTB.2 = 1
    PAUSEUS 50
    ADCIN 0, adval ' A/D 8 bit value from PORTA.0 into adval
    SEROUT2 PORTC.6,16416,[BIN8 adval,13,10] ' Output 8 bit word serially to PC from C.6
    PAUSE 87
    horizpulse = horizpulse + 1
    IF horizpulse < 784

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    NOP...

    i'll have more spare time tomorrow for that... BUT have a look on this thread download the code i did. It use the interrupt on an pin to do specific task. Can be handy to start. Code is well documented.

    ON INTERRUPT GOTO define the place to go when an intterupt happen. See PBP manual on that statement. care will have to be made in the interrupt routine too. sould not be too loang... at minimum less than the time between each interrupts.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    TurboLS's Avatar
    TurboLS Guest


    Did you find this post helpful? Yes | No

    Default

    Well I would think I would only need one in the loop, just to make sure the Reset(HWPM) and Horizontal 2 are on their rising edge as in synch as possible.

  6. #6
    TurboLS's Avatar
    TurboLS Guest


    Did you find this post helpful? Yes | No

    Default

    What if I did something like this??

    horizloop:
    PORTB.2 = 0
    PORTB.3 = 1
    PAUSEUS 139
    ENABLE
    ON INTERRUPT GOTO H2lock
    DISABLE
    PAUSEUS 15
    ADCIN 0, adval ' A/D 8 bit value from PORTA.0 into adval
    SEROUT2 PORTC.6,16416,[BIN8 adval,13,10] ' Output 8 bit word serially to PC from C.6
    PAUSEUS 87
    horizpulse = horizpulse + 1
    IF horizpulse < 784 THEN
    GOTO horizloop
    ELSE
    PAUSEUS 270
    GOTO vertloop
    ENDIF

    H2lock:
    PORTB.3 = 0
    PORTB.2 = 1
    RESUME

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    NOP, On Interruot goto is placed at the header of your code before your main loop. Since it's working in background, it will jump by himself to the interrupt routine. did you look at my previous link?

    INTCON and probably others have to be set for interrupt type/source.

    i'll make something like this later today.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. PICs can do more if use others than delays instructions
    By hardcore in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 24th February 2010, 19:52
  2. How do I set GPIO 0-2 and 5 simultaneously?
    By cstack in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th August 2009, 09:32
  3. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  4. Replies: 11
    Last Post: - 13th July 2005, 19:26

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