ShiftIn/ShiftOut commands.

Started by bobbymcgill2007 December 29, 2007
Hi all - I was wondering if someone can help shed some light on the
ShiftIn/ShiftOut commands.

What I am trying to do is "sniff" a serial data stream that has clock
and data pulses with a BX24p.

The documentation is a little sparse, but from what I can tell, the
bits are shifted in on every clock pulse into a byte. So - does that
mean that the chip can sense the clock pulses and be able to get the
bit value - even with different clock rates? (basically an
input/receive clock)

Then the ShiftOut also uses a clock pulse. Is it an externally or
internally generated pulse? Does it use a clock pulse from an external
source or is there a command somewhere to set the clock rate internally?
(basically an output/transmit clock)

Any input is appreciated. Thanks.
> ... ShiftOut also uses a clock pulse. Is it an externally or
internally generated pulse?

Both ShiftIn and ShiftOut internally generate the clock on the
specified pin. The clock rate is fixed, according to the
documentation, at "less than 400kHz to be compatible with I2C", but
mentions of 225kHz appear in the archives here, easy to measure with a
scope.

The sense of the clock pulse is determined by its initialization when
the command is issued; if the specified clock pin is high when
ShiftIn/ShiftOut is executed the clock pulse will be low, and vice versa.
Tom