I have had problem with the shiftin/shiftout commands depending on the device being used.The clock pulses are too fast and using the define shift_pauseus doesn't seem to help.Writing your own works best as you can control the clock pulses.This example sends out the control bits,then reads in the data bits.


DataAcquisition:
for Indexer = 12 to 0 step -1 ' Output data,13 clock pulses
portc.2 = SerialDataOut.0[Indexer] ' Output data port
gosub Clockout ' Output clock pulse
next Indexer ' Next data bit,next clock pulse
for Indexer = 1 to 12 ' Read data,12 clock pulses
SerialDataIn = SerialDataIn * 2 ' Shift each bit to the left
SerialDataIn = SerialDataIn + portc.3 ' Data in port
gosub Clockout ' Output clock pulse
next Indexer ' Next data bit,next clock pulse
Clockout: ' Clock pulse
pulsout portc.0,5 ' Clock pulse port, 1 msec
return