From: Jan Michel Date: Tue, 24 Jun 2014 14:17:05 +0000 (+0200) Subject: added note about read colissions X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=00632a5e010e5f4c5c422bd544e1fdc1a00a5471;p=daqdocu.git added note about read colissions --- diff --git a/trb3/DacProgramming.tex b/trb3/DacProgramming.tex index b607f39..a56ec75 100644 --- a/trb3/DacProgramming.tex +++ b/trb3/DacProgramming.tex @@ -60,5 +60,20 @@ The ASCII format is shown below, the commands can be found in table~\ref{ltc2600 \item Example Configuration: daqtools/config/DAC\_config.db \end{itemize*} +\paragraph*{Collisions during reading} +Writing to all registers is blocked while a transfer is in progress, i.e. writing can not be broken. +Reading back a value can break, if to processes access the SPI port in a interleaved manner, because reading the read-back register is non-atomic. +There is a two-level locking mechanism: + +If you intend to read back a value, set Bit 16 in the control register 0xd411. +This blocks any subsequent SPI access until the read-back register has been read. +This should be implemented in all software, but one has to take care that when killing a task, +the reading of the register might be skipped and the locking therefore not be cleared. + +Nevertheless, this can still be broken if a program does not make use of this feature. +If you need secure access, first set Bit 17 in Register 0xd413. Now, only accesses are +allowed for which the "su" bit (Bit 17 in the control register 0xd411) is set. Everything +else is discarded and not executed. Make sure to clear this bit after finishing the secure +register access. This should be used e.g. for reading the configuration Flash memory.