Design Guide
Revision 1.12
1998-08-12
HMS F
IELDBUS
S
YSTEMS
AB
Page 18 (35)
4.3 Handshake Procedure
In order to ensure that consistent data always is available, on the application side as well as on the fieldbus
side, a simple handshaking procedure is introduced. In the handshaking procedure, it is always the
application taking initiative to start handshaking and the DataTransfer module will respond to it.
Since the upper two bytes in the DPRAM are used for the handshaking, it is possible to use the interrupt
signal from the DPRAM. If you are going to use the interrupt flag, or operate in poll mode depend on your
preferences. However, there is no difference in the actual operation procedure.
The operation with the DataTransfer module can be devised into two main parts. Part one initialises the
DataTransfer module and part two is performing the actual data exchange. How these parts are
functioning, can be found in the following paragraphs.
4.3.1 Initialisation
After the application has finished its own initialisation process, the initialisation of the DataTransfer
module has to be performed. These initialisation is basically done in the following steps:
1.
Write 00h to the AB-DT control register (3FFh), this will ensure a stable start up for the AnyBus
DataTransfer module.
2.
Requesting access to the DPRAM.
3.
Receive access to DPRAM.
4.
Initialise, set input/output area (3F8h-3FBh) and output mode (in 3FDh).
5.
Release access to DPRAM.
6.
Check if initialisation was successful.
7.
How this will look in detail is shown in the following flowchart.
If the default settings are used, it is not necessary to change any values during the initialisation. However, it
is still necessary to run through the initialisation sequence, in order to reach the data exchange state.
After the initialisation is performed successfully, the DataTransfer module is in data exchange state, and
data can be exchanged with the fieldbus.
NOTE!
The initialisation is only performed once after system reset (e.g. power up)