RTD Embedded Technologies, Inc.
|
www.rtd.com
30
ERES35105
User’s Manual
NOTE: If multi-thread safe operation is not required, steps 1, 2, 5, and 6 can
be eliminated.
7.3.2
W
RITING TO A
B
OARD
R
EGISTER
To write to one of the Board Registers, use the following steps:
1.
Read the GPIOAB_CTRL, GPIOCD_CTRL, SELECT and INDEX_DATA registers and store them so they can be restored.
2.
Save the Index Register
a.
Set GPIOAB_CTRL and GPIOCD_CTRL to their Read values.
b.
Set SELECT such that DATA=0, WR_STRB=0, and OE#=0
c.
Read INDEX_DATA and store it as the Old Index.
3.
Set the Index Register
a.
Set SELECT such that DATA=0, WR_STRB=0, and OE#=1 and set INDEX_DATA to the desired Index.
b.
Set GPIOAB_CTRL and GPIOCD_CTRL to their Write values.
c.
Set SELECT such that DATA=0, WR_STRB=1, and OE#=1. (May also set INDEX_DATA to the desired Index again).
4.
Set the Data Register
a.
Set SELECT such that DATA=1, WR_STRB=0, and OE#=1 and set INDEX_DATA to the desired Data.
b.
Set GPIOAB_CTRL and GPIOCD_CTRL to their Write values. (Already set by Step 3 above)
c.
Set SELECT such that DATA=1, WR_STRB=1, and OE#=1. (May also set INDEX_DATA to the desired Data again).
5.
Restore the Index Register
a.
Set SELECT such that DATA=0, WR_STRB=0, and OE#=1 and set INDEX_DATA to the Old Index.
b.
Set GPIOAB_CTRL and GPIOCD_CTRL to their Write values. (Already set by Step 3 above)
c.
Set SELECT such that DATA=0, WR_STRB=1, and OE#=1. (May also set INDEX_DATA to the Old Index again).
6.
Restore Other Registers
a.
Restore GPIOAB_CTRL
b.
Restore GPIOCD_CTRL bit-
wise or’ed with the Read Value (to make sure the SELECT pins are always output)
c.
Restore SELECT and INDEX_DATA with the
WR_STRB bit cleared (to make sure a write isn’t duplicated)
NOTE: If multi-thread safe operation is not required, steps 1, 2, 5, and 6 can
be eliminated.