Hi,
SHIFTOUT/SHIFTIN are used for synchronous communications (unlike SEROUT/SERIN etc which are asyncrounous) which means that there one dataline and one clock line (and quite often a chip select). If you SHIFTOUT a byte variable there will be 8 pulses on the pin you specify as ClockPin. During each pulse the 8 indivdual bits of your byte variable will be present as a voltage on the DataPin. Depending on the MODE you specify with the SHIFTOUT command you can change the exact behaviour of the output ie. in which order the bits are shifted out and the "polarity" of the clock.
Please do scope it and you'll see how it works.
EDIT: Oh, the constant thing. That's just to be compatible with the BasicStamp2 syntax where the I/O's are labeled 0-15. Usually '0' is PortB.0 but it might differ depending on the actual PIC you're compiling for. Best is to just forget about that and use PortB.3 etc.
Bookmarks