Shop OBEX P1 Docs P2 Docs Learn Events
delay between output pin changes? — Parallax Forums

delay between output pin changes?

ArchiverArchiver Posts: 46,084
edited 2002-07-28 07:44 in General Discussion
When setting the OUTS register to a value, are all the pins set to the
value specified at the same time? Or is there a slight delay between
all/any of the pins?

ie.. If I set OUTS to 0xFFFF, will all 16 pins be set at the same time? Or
will there be a delay between say, pin 7 and 8 while the interpreter
switches the PICs ports?

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-07-28 07:44
    The 16 I/O pins on a BS2 are comprised of the port b and port c
    pins of the underlying PIC16C57. The port b pins are implemented as
    PBASIC I/O pins 0-7, and the port c pins as 8-15.

    All eight pins of a single port may be updated at once with a single
    PIC instruction. However, there is no PIC instruction capable of
    updating more than 1 port simultaneously, hence some delay is
    inevitable between the two sets of pins.

    Each PIC instruction takes 200 nsec on a BS2, so that's the absolute
    minimum delay between updates to respective ports. More likely, the
    sequence of instructions that update the two ports ("OUTS = xxxx")
    would involve several PIC instructions, so the delay between
    updating OUTL and OUTH would likely be on the order of 10 usec at
    least. Someone with a fancy o'scope could provide a more
    quantitative answer.

    Regards,

    Steve


    Pepsi wrote:

    When setting the OUTS register to a value, are all the pins set to the
    value specified at the same time? Or is there a slight delay between
    all/any of the pins?
Sign In or Register to comment.