MotoHawk Master SPI Definition

This MotoHawk™ block allows the Master side of a full duplex Serial Peripheral Interface (SPI) link to be specified in order to perform inter CPU communication.

Block ID

Master Definition

Library

motohawk_SPI_lib

Description

This MotoHawk™ block allows the Master side of a full duplex Serial Peripheral Interface (SPI) to be specified in order to perform inter CPU communication. SPI communication is peer to peer, where one peer is designated as the Master and the other is designated as the Slave. The Master initiates communication, which the Slave responds to. Communication is full duplex, meaning that when the Master initiates a transfer the Slave will also initiate a transfer. Thus the response to a particular transfer is pre-loaded by the Slave before the transfer has been initiated by the Master.

Master communication is achieved by specifying transactions via the Master SPI Transaction block, which are scheduled for transmission when the block executes. Transactions associate data to an identifier that can then be referenced by triggers that will execute when (say) the transaction has been transmitted on the bus, or to the Slave's reply to that transaction via the Master SPI Read block.

An application may contain multiple SPI master definitions, provided that each SPI master definition block has a unique name and is assigned an exclusive SPI resource chosen from the block drop down resource list.

Typically the Slave side is executing on another target. See here.

Block Parameters

Parameter Field Values Comments/Description
Name Unique, C-legal, single quote enclosed alphanumeric Name for this Master SPI Definition that will be referenced by other blocks like transaction and trigger blocks.
Resource Drop-down list SPI resource to use with this Master definition. The behavior is unsupported by the module if (None) is the only resource.
Frame Size Drop-down list Specifies the number of bits in one frame of data. All communication will need to be compatible with this definition.
Timeout (us) Numeric The time without an acknowledge before the master considers the transaction to be lost. Set to zero for open loop when interfacing to a device that does not support an acknowledge. However all currently supported hardware utilizes an acknowledge. Setting to zero when an acknowledge is in use will result in a timeout always being detected. Thus this value should be set to a non-zero. A value 300+ us is recommended. The referenced task will wait at least this long (and potentially longer) for an acknowledge that the transfer completed and was handled by the Slave. A waiting task will yield execution to other tasks.
Min Frame Spacing (us) Numeric Specifies the delay between frames if a zero timeout is specified, or when the slave can handle multiple frames without an acknowledge. This value is not used on hardware that utilizes frame acknowledgement, which is all currently supported hardware.
Task Name Single quote enclosed alphanumeric Specifies the task that will physically execute the SPI transfer. The task may be shared with other activity, but the task will yield once the transfer has been initiated until either an acknowledge is detected or a timeout is detected. A task that yields execution will not execute other activity that has been assigned to the task. Therefore tasks that execute time critical operations should not be used for inter CPU SPI communication.