11.07.2015 Views

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PICBASIC</strong> <strong>PLUS</strong> Compiler5.65. SHINSyntax : SHIN dpin , cpin , mode , [ result { \bits } { ,result { \bits }...} ]Overview :Operators :Shift data in from a synchronous-serial device.Dpin is a Port.Pin constant that specifies the I/O pin that will be connectedto the synchronous-serial device’s data output. This pin’s I/Odirection will be changed to input and will remain in that state after theinstruction is completed.Cpin is a Port.Pin constant that specifies the I/O pin that will be connectedto the synchronous-serial device’s clock input. This pin’s I/Odirection will be changed to output.Mode is a constant that tells SHIN the order in which data bits are tobe arranged and the relationship of clock pulses to valid data. Beloware the symbols, values, and their meanings: -Symbol Value DescriptionMSBPREShift data in highest bit first.0MSBPRE_LRead data before sending clock. Clock idles lowLSBPREShift data in lowest bit first.1LSBPRE_LRead data before sending clock. Clock idles lowMSBPOSTShift data in highest bit first.2MSBPOST_LRead data after sending clock. Clock idles lowLSBPOSTShift data in highest bit first.3LSBPOST_LRead data after sending clock. Clock idles lowMSBPRE_H 4Shift data in highest bit first.Read data before sending clock. Clock idles highLSBPRE_H 5Shift data in lowest bit first.Read data before sending clock. Clock idles highMSBPOST_H 6Shift data in highest bit first.Read data after sending clock. Clock idles highLSBPOST_H 7Shift data in lowest bit first.Read data after sending clock. Clock idles highResult is a bit, byte, or word variable in which incoming data bits willbe stored.Bits is an optional constant specifying how many bits (1-16) are to beinput by SHIN. If no bits entry is given, SHIN defaults to 8 bits.Notes :SHIN provides a method of acquiring data from synchronous-serialdevices, without resorting to the hardware SPI modules resident onsome PIC types. Data bits may be valid after the rising or falling edgeof the clock line. This kind of serial protocol is commonly used by controllerperipherals such as ADCs, DACs, clocks, memory devices, etc.120Copyright Crownhill 2001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!