Shop OBEX P1 Docs P2 Docs Learn Events
New TV project... — Parallax Forums

New TV project...

ackerdackerlyackerdackerly Posts: 4
edited 2009-02-09 21:41 in BASIC Stamp
Once again, after a long hiatus, I am back with another project for the TV station that I work for.

This time, I need to monitor the state of 4 data lines - or a nibble of data - at one time.· When a change occurs on the data lines, I need to output the change on another set of 4 pins with a delay added depending on the pattern of the new data.

If the content of the input is binary 0100 and it changes to 0010, I want to read and write the nibbles together as a unit instead of reading and resetting the pins indivdually.· The reason being that the reading and outputting of the pattern must be quick and·"parallel" in nature so as to NOT confuse the equipment that is connected to the output.

I was playing with the INA, INB OUTA and OUTB nibbles but am not getting any useful results.

Is there a way to read and write a 4-bit binary value to 4 pins as a nibble instead of individually from/to each pin?

Talk among yourselves...

Comments

  • JomsJoms Posts: 279
    edited 2009-02-06 21:56
    Seems like overkill to use a stamp for this. If I read this correctly just use a RS flip-flop and some steering diodes... Should only need one chip as most are quad RS flip-flops.

    Just wondering... What are you trying to control, a router of some sort? I also work at a TV station and just built a complete master switcher built with two basic stamps...

    If I didn't quite understand the quesiton correctly just let me know back...
  • ackerdackerlyackerdackerly Posts: 4
    edited 2009-02-06 23:00
    Here is what we are doing:

    Budget considerations are forcing us to develop a "cheap"·system to switch HD video.

    The idea is to use the tally signals off the analog·MC switcher to drive a 12x HD switcher which switches HD programming - when available - to our Digital transmitter chain.

    Currently, there are four digital sources:·

    the SD version of analog.
    Prime-time Network programming that shall be nameless.
    the HD output of the video server.
    one HD-capable satellite receiver - just in case.

    Due to the difference in path latencies, switched HD video would be clipped by a finite number of frames at the beginning and end of each switch - depending on the source.

    My supervisor has already designed a circuit like you mentioned in your post but has asked me to create a Stamp-based equivalent.

    As you can imagine, we are talking about one line in four changing state at any given time with a delay depending on what line it is.

    My idea is, since we are dealing with four lines, to somehow load·those four bits simultaneously into a memory nibble and then loop.· Once a change in the pattern/value occurs, logic is applied, a suitable delay occurs and the pattern/value is sent out four other pins to the HD switcher's GPI control input.

    It is the loading/sending of those bits simultaneously·that is causing me difficulty.· I imagine that, because I have forgotten so much since my last Stamp project, I am overlooking an obvious solution...·or maybe I am trying too hard to do this.

    BTW, do you know the correct method to drain excess fluid from an automatic transmission?··smilewinkgrin.gif

    Post Edited (ackerdackerly) : 2/6/2009 11:05:42 PM GMT
  • JomsJoms Posts: 279
    edited 2009-02-07 00:20
    Well... lets look at the last problem first, a short answer is no... But I suppose you could just loosen the plug and let a little run out, then snug it back up. I am from South Dakota, up here we do everything from build electrical things, to roofing, to snow removal...maybe I need to look into automotive work [noparse]:)[/noparse].

    Now, back to the first problem... I have actually found controlling things serially is a lot easier then using the GPI's. I have built many things in our station using the GPI but again found timing was an issue. Really once you understand how some of the serial video communcations work it isn't too different between manufacturers, from Grass Valley Encore, to Pesa BURP, to Utah party-line...

    What brand/model is your current master switcher? Does it have its own frame or does it control router busses of your house router? What brand is your HD router? Do you need to worry about any different leval switching? Does your up-convertor allow you to compesate for any delay?

    Let me know and I will see what I can come up with for you...

    PS... from the nameless programming, I put a guess on ABC?, CBS seems to be fairly well timed between SD-HD...
  • JomsJoms Posts: 279
    edited 2009-02-07 00:21
    As a side note... you can see pictures of my most recent project in the customer applications part of the site... http://www.parallax.com/tabid/729/Default.aspx
  • ackerdackerlyackerdackerly Posts: 4
    edited 2009-02-07 01:53
    My apologies, but I am looking for answers to my question.

    Please disregard my unfortunate attempt at humor with the automatic transmission question.

    Is it possible to load data simultaneously from a group of pins as if it were a memory location?
    ·
  • SRLMSRLM Posts: 5,045
    edited 2009-02-07 01:56
    So, you want to read a state of input pins (4 of them) together as a nibble, delay a while, and output that same state on the other side?

    What's wrong with INA? You should be able to assign the value like so

    myNumber var nib

    myNumber = INA

    Post Edited (SRLM) : 2/7/2009 2:06:03 AM GMT
  • ackerdackerlyackerdackerly Posts: 4
    edited 2009-02-07 02:22
    Thanks for the reply!

    I'll try that syntax and see what develops
  • JomsJoms Posts: 279
    edited 2009-02-07 02:26
    I tried throwing some code together but didn't bread-board it to check the operation.· If it doesn't work let me know, otherwise someone might chime in and see a mistake.

    Basically, how it works, it looks at the four input pins to see if/when any change, then wait a preset delay depending on the input selected, then it will send the data to OUTB...

    This is designed for a digital in, meaning pin0=1, pin1=2, pin2=3, pin3=4....· This will probably not work right for a binary input...· If you need binary you sould be able to just add 12 more 'pause' lines in there...· I was assuming no binary because you are using a 4 input HD router...

    Let me know if I am on the right track or if I am completely off on this code....
  • JomsJoms Posts: 279
    edited 2009-02-07 02:30
    I re-read the first post, and it is binary, in which case the code I posted will still work... However, you will just need a pause line of code per input that you plan on useing.

    Also, I think you can change the "%0001" to just "1" and it should act the same way...
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-02-07 03:27
    You can take advantage of PBASIC 2.5's enhanced syntax to make your program more readable, viz:

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    numberin      VAR  Nib
    numberstored  VAR  Nib
    
    DO
      numberin=INA
      IF (numberin <> numberstored) THEN
        numberstored = numberin
        SELECT numberin
          CASE %0001: PAUSE 50
          CASE %0010: PAUSE 75
          CASE %0100: PAUSE 60
          CASE %1000: PAUSE 40
        ENDSELECT
        OUTB = numberstored
      ENDIF
    LOOP
    
    
    


    I've left out the comments, which you can add back.

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 2/7/2009 3:32:34 AM GMT
  • remmi870remmi870 Posts: 79
    edited 2009-02-09 21:41
    wouldnt it be easier to use a parallel to serial converter like a 74hc165 with shiftin, then pause, and send it out to a 74hc595, this way you could do any combination to adjust the output. the problem i see with is monitoring 4 lines at once, the second is where do you plan on saving the data? the eprom is volitol and you only have a set amount of time that it can be used.
Sign In or Register to comment.