]> jspc29.x-matter.uni-frankfurt.de Git - daqdocu.git/commitdiff
added note about read colissions
authorJan Michel <j.michel@gsi.de>
Tue, 24 Jun 2014 14:17:05 +0000 (16:17 +0200)
committerJan Michel <j.michel@gsi.de>
Tue, 24 Jun 2014 14:17:05 +0000 (16:17 +0200)
trb3/DacProgramming.tex

index b607f39a91805f3366c1f157cee6a7d239179044..a56ec759f770d522515c7d9e5b4ea2ea30680f0d 100644 (file)
@@ -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.