Shop OBEX P1 Docs P2 Docs Learn Events
A quick question about the speed at which outa really works — Parallax Forums

A quick question about the speed at which outa really works

ElectricAyeElectricAye Posts: 4,561
edited 2011-08-08 14:44 in Propeller 1
If I tell all the pins from 5 through 10 inclusive to become outputs, do the pins all become output at the very same time, or is there a time lag on the order of nanoseconds or microseconds (or what?) between pins?
outa[5..10] := %111111


My oscilloscope is a piece of junk, so I can't get it to trigger right on the second channel for comparison.

Thanks!

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-08-07 18:39
    I could verify this but I doubt there would be any real variation in the setting of the output states. I say any real variation as there would be some minute variation which is to be expected from multiple signals even if they are on the same port. This skew always exists which is why clocks are used to synchronize digital signals. Of course even if they were in the order of several nanoseconds it shouldn't matter on I/O ports anyway, the pcb can introduce more skew and ringing anyway.

    BTW, never microseconds!!!!
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-07 18:45
    ...Of course even if they were in the order of several nanoseconds it shouldn't matter on I/O ports anyway...

    BTW, never microseconds!!!!

    Okay, so it sounds like any variations would be maybe less than 10 nanoseconds?

    In any case, it sounds like any variations would be less than 1 microsecond, yes?

    Thanks!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-07 19:56
    If it were done in PASM, the outputs would all be written in less than one clock cycle. Someone who has studied the Spin bytecodes more than I have could tell you whether the same is true with Spin. I can only guess that it is.

    -Phil
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-07 20:15
    If it were done in PASM, the outputs would all be written in less than one clock cycle. Someone who has studied the Spin bytecodes more than I have could tell you whether the same is true with Spin. I can only guess that it is....

    Phil, thank you. That's very encouraging. I still have yet to learn any PASM, but if need be, something like this could provide the motivation.
  • frank freedmanfrank freedman Posts: 1,983
    edited 2011-08-07 20:43
    If I tell all the pins from 5 through 10 inclusive to become outputs, do the pins all become output at the very same time, or is there a time lag on the order of nanoseconds or microseconds (or what?) between pins?
    outa[5..10] := %111111
    
    

    My oscilloscope is a piece of junk, so I can't get it to trigger right on the second channel for comparison.

    Thanks!

    You could always set up an XOR gate into a couple of one shots on say the first and last pin of the group and see if the oneshot gets triggered by a difference between the pins as would be detected by the XOR gate. The XOR could give you the detection speed your scope lacks and the oneshot for the indication that the event occurred.

    Just a thought dredged from the 70's. Comer devotes part of a chapter in Logic and State machine design to this under "Hazard Covers".

    Frank
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-08-07 20:48
    SPIN just ends up doing a normal PASM mov $1ff,x where $1ff is replaced with the OUTA destination. So no need to check, no need to worry because any skew will be a lot less than one clock cycle and not something that makes any difference.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-07 20:55
    You could always set up an XOR gate into a couple of one shots on say the first and last pin of the group and see if the oneshot gets triggered by a difference between the pins as would be detected by the XOR gate....

    Interesting idea. I'll have to remember that for when I've got similar problems. Thanks, Frank

    SPIN just ends up doing a normal PASM mov $1ff,x where $1ff is replaced with the OUTA destination. So no need to check, no need to worry because any skew will be a lot less than one clock cycle and not something that makes any difference.

    Very good. I'm gonna run with this, then. Thanks, Peter!
  • TubularTubular Posts: 4,717
    edited 2011-08-07 21:21
    Section 9.5 of the Propeller Datasheet mentions a 1.0 to 1.5ns variation from one cog to another (total propagation delay). The difference between actual bits switching on/off should me much smaller, down in the picoseconds I would expect.

    Kuroneko did some testing on some pin to pin "blind spots" for very short pulses, but I don't think this is what you were asking.

    Do dive into PASM, I started recently, and its a heap of fun.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-07 22:09
    Tubular wrote: »
    ...

    Do dive into PASM, I started recently, and its a heap of fun.

    Yeah, someday I'll just have to do it. Maybe when Prop 2 comes out... soon? :-)
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-08-07 22:26
    Yeah, someday I'll just have to do it. Maybe when Prop 2 comes out... soon? :-)

    Stop procrastinating NOW!
    1. Create a new blank Spin file
    2. Type in just 6 lines of PASM code or so and try it out. Blink a LED if you like (of course create a PUB to run this code)
    3. You are no longer procrastinating
    4. You will be in a much better position when P2 comes along (but then you won't be until P3 comes along and then P4 and so on......)
  • AleAle Posts: 2,363
    edited 2011-08-07 22:53
    Do not forget as a last instruction in your PASM code an endless loop of some sort... or you may enter the realm of "PASM does not do what (I believe) it should" ;-)
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-08-07 23:02
    Ale wrote: »
    Do not forget as a last instruction in your PASM code an endless loop of some sort... or you may enter the realm of "PASM does not do what (I believe) it should" ;-)


    So the words "I believe" can make things disappear into thin air? :)
    Now we start getting pedantic and we have to mention the # word as well! (Shhhh, let him find out himself)
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-08-07 23:14
    So the words "I believe" can make things disappear into thin air? :)
    Now we start getting pedantic and we have to mention the # word as well! (Shhhh, let him find out himself)
    Oh how cruel! Tell him, how that little thing can change time (the length of time scratching one's head). :)
  • TubularTubular Posts: 4,717
    edited 2011-08-08 14:14
    So ElectricAye, have you taken the "Pasm Baptasm" yet?
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-08-08 14:30
    ElectricAye: re PASM... You do not have to learn every instruction. Many you will not use until later.

    The assembler on the prop is much simpler than most (any???) micros. The instruction set is regular and easy.

    As Peter says, start out with the simple program, like flash a led or two. Then you will be able to look at a few simple pasm objects (not complex ones yet).

    So... ehay are you waiting for??? Go for it!!!
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-08-08 14:44
    Guys,
    I appreciate all the words of encouragement on PASM baptpasm, spasms, orpasms, etc. but I just spent last week choking and sputtering on simple SPIN code dealing with strings, so, being the dork that I am in programming, it will probably be a while. I'm guessing my need for speed will happen this Fall, so maybe it will happen then.

    thanks, tho.
Sign In or Register to comment.