Skip to content
Snippets Groups Projects
Select Git revision
  • 9056ba1e2797e9eeceed017a48adc2347fe38b53
  • master default
  • labcomm2014
  • labcomm2006
  • python_sig_hash
  • typedefs
  • anders.blomdell
  • typeref
  • pragma
  • compiler-refactoring
  • labcomm2013
  • v2014.6
  • v2015.0
  • v2014.5
  • v2014.4
  • v2006.0
  • v2014.3
  • v2014.2
  • v2014.1
  • v2014.0
  • v2013.0
21 results

compiler

Digital in/out and poll commands are sent as one byte:

   +-+-+-+-+-+-+-+-+
   |0|0 0|  chan   | Bit clear
   +-+-+-+-+-+-+-+-+

   +-+-+-+-+-+-+-+-+
   |0|0 1|  chan   | Bit set
   +-+-+-+-+-+-+-+-+

   +-+-+-+-+-+-+-+-+
   |0|1 0|  chan   | Bit get
   +-+-+-+-+-+-+-+-+

   +-+-+-+-+-+-+-+-+
   |0|1 1|  chan   | Channel get
   +-+-+-+-+-+-+-+-+


Channels are sent as 2 to 6 bytes, depending on resolution:

   +-+-+-+-+-+-+-+-+  +-+-+-+-+-+-+-+-+ 
2  |1| bit8...bit2 |  |0|bit|  chan   |
   +-+-+-+-+-+-+-+-+  +-+-+-+-+-+-+-+-+ 

   +-+-+-+-+-+-+-+-+  +-+-+-+-+-+-+-+-+  +-+-+-+-+-+-+-+-+ 
3  |1|bit15...bit9 |  |1| bit8...bit2 |  |0|bit|  chan   |
   +-+-+-+-+-+-+-+-+  +-+-+-+-+-+-+-+-+  +-+-+-+-+-+-+-+-+ 

   ...

   +-+-+-+-+-+-+-+-+  +-+-+-+-+-+-+-+-+     +-+-+-+-+-+-+-+-+ 
6  |1|bit31...bit30|  |1|bit29...bit23| ... |0|bit|  chan   |
   +-+-+-+-+-+-+-+-+  +-+-+-+-+-+-+-+-+     +-+-+-+-+-+-+-+-+ 



Channel 31 is special, as it serves as the configuration channel. When
reading from it multiple responses are sent with the following layout

 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
 |           command specific data           |cmd|kind |conf chan|
 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+

  kind: 000 == end of configuration
        001 == digital in
        010 == digital out
	011 == analog in
	100 == analog out
	101 == counter in

cmd == 0 (Resolution)

 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
 |                               | # of bits |0 0|kind |conf chan|
 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+

  # of bits (1..32) 

cmd == 1 (Minimum value)

 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
 |              minimum              |S| unit|0 1|kind |conf chan|
 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
 
  S (sign): 0 == +
            1 == -
  unit: 000 == V
        001 == mV
        010 == uV

cmd == 2 (Maximum value)

 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
 |              maximum              |S| unit|1 0|kind |conf chan|
 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+
 
  S (sign): 0 == +
            1 == -
  unit: 000 == V
        001 == mV
        010 == uV