4.10.17
Instruction manual UNIGATE
®
FC - PROFINET 2Port V. 1.5
21
Deutschmann Automation GmbH & Co. KG
Synchronous serial interface
5
Synchronous serial interface
The synchronous serial interface of the UNIGATE
®
FC is used to connect clocked shift registers
or components that have a Serial Peripheral Interface (SPI).
It allows
•
the expansion of the FC for digital inputs and outputs (for example for driving LEDS or for
reading switch positions)
•
communicate with microcontrollers or
•
the control of DA and AD converters.
Connection examples are give in chapter 3.
By using the synchronous serial interface can realize products that can work without another
microcontroller (stand-alone mode). Examples are sensor products or digital IO modules
5.1
Shift register operation
Before the interface can be used, it has to be initialized by setting various Script parameters.
(see chapter 5.1.1)
The parameters „
ShiftRegisterInputType
“ and „
ShiftRegisterOutputType
“ allow the
use of different shift register types, which differ in the polarity of the shift register signals. To use
the shift register types 74595 and 74165, for example, the values „
RiseClk_RiseLoad
“ and
„
RiseClk_LowLoad
“ can be set.
The shift register width is set by the parameter „
ShiftRegisterInputBitLength
“ and
„
ShiftRegisterOutputBitLength
“ The maximum width is 256 bits.
The data exchange with the connected shift registers ensues with the commands
„
WriteShiftRegister
“, „
ReadShiftRegister
“ or bidirectional with the command „
Shift-
RegisterDataExchange
“. The clock rate is approximately 45 kHz.
Further information on the commands and parameter values can be found in the Help section of
the Protocol Developer Software. On request, the Deutschmann Script language can be comple-
mented by additional parameter values in order to support other types of shift registers.
5.1.1
Example-Script
Note: The script example refers to the circuit example in chapter 3.5.
var InBuffer: Buffer[2];
var OutBuffer: Buffer[2];
MoveConst( OutBuffer[0], #0x58#0x21 );
Set( ShiftRegisterInputType, RiseClock_FallLoad );
Set( ShiftRegisterOutputType, RiseClock_RiseLoad );