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.66. SHOUTSyntax : SHOUT Dpin, Cpin, Mode, [OutputData {\Bits} {,OutputData {\Bits}..} ]Overview :Operators :Shift data out to 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 input. This pin will beset to output mode.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 will beset to output mode.Mode is a constant that tells SHOUT the order in which data bits areto be arranged. Below are the symbols, values, and their meanings: -Symbol Value DescriptionLSBFIRSTShift data out lowest bit first.0LSBFIRST _LClock idles lowMSBFIRSTShift data out highest bit first.1MSBFIRST_LClock idles lowLSBFIRST _H 4Shift data out lowest bit first.Clock idles highMSBFIRST_H 5Shift data out highest bit first.Clock idles highOutputData is a variable, constant, or expression containing the datato be sent.Bits is an optional constant specifying how many bits are to be outputby SHOUT. If no Bits entry is given, SHOUT defaults to 8 bits.Notes :SHIN and SHOUT provide a method of acquiring data from synchronousserial devices. Data bits may be valid after the rising or fallingedge of the clock line. This kind of serial protocol is commonly usedby controller peripherals like ADCs, DACs, clocks, memory devices,etc.At their heart, synchronous-serial devices are essentially shiftregisters;trains of flip flops that receive data bits in a bucket brigadefashion from a single data input pin. Another bit is input each time theappropriate edge (rising or falling, depending on the device) appearson the clock line.The SHOUT instruction first causes the clock pin to output low andthe data pin to switch to output mode. Then, SHOUT sets the data pinto the next bit state to be output and generates a clock pulse. SHOUTcontinues to generate clock pulses and places the next data bit on thedata pin for as many data bits as are required for transmission.122Copyright Crownhill 2001

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

Saved successfully!

Ooh no, something went wrong!