04.03.2013 Views

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

SHIFTOUT<br />

<strong>Syntax</strong><br />

shiftout dpin,cpin,mode,[OutputData1{\bits}, ..., OutputDataN{\bits}]<br />

Commands<br />

• Dpin - is a variable, constant or expression that specifi es the data input pin. This pin will switch<br />

to an input pin.<br />

• Cpin - is a variable, constant or expression that specifi es the clock output pin. This pin will switch<br />

to an output.<br />

• Mode - is a value (0 to 7) or a predefi ned constant that sets the incoming data conditions.<br />

• OutputData - is a variable, constant or expression that specifi es the data to be sent. The only<br />

limit to the amount of data is the available ram on the processor being used.<br />

• Bits - is an optional entry (1 – 32) defi ning the number of bits that will be sent.<br />

Supported<br />

• BA - Supported<br />

• BAN - Supported<br />

• BAP - Supported<br />

• BAP40 - Supported<br />

Description<br />

The SHIFTIN and SHIFTOUT commands can send or received data from synchronous serial<br />

devices like an SPI device. Synchronous serial differs from asynchronous serial (SERIN / SEROUT)<br />

in that there is a clock line. This clock line is used to time the data bits sent or received. There are<br />

several settings which make the SHIFTIN / SHIFTOUT commands fl exible enough to work with most<br />

synchronous serial devices.<br />

The following tables provide all supported modes and maximum speed in kilo bits per second that<br />

each processor family can handle. There are 8 modes. The fi rst 4 modes (0-3) are standard modes.<br />

The second set of 4 modes (4-7) are basically duplicates of the fi rst 4 modes but for high speed<br />

operation.<br />

Modes<br />

Mode Value Description<br />

MSBPRE 0 Sample bits msb fi rst, before clock pulse<br />

LSBPRE 1 Sample bits lsb fi rst, before clock pulse<br />

MSBPOST 2 Sample bits msb fi rst, after clock pulse<br />

LSBPOST 3 Sample bits lsb fi rst, after a clock pulse<br />

FASTMSBPRE 4 Faster sampling, msb fi rst, before clock pulse<br />

FASTLSBPRE 5 Faster sampling, lsb fi rst, before clock pulse<br />

FASTMSBPOST 6 Faster sampling, msb fi rst, after clock pulse<br />

FASTLSBPOST 7 Faster sampling, lsb fi rst, after clock pulse<br />

191

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

Saved successfully!

Ooh no, something went wrong!