Skip to content

Latest commit

 

History

History
59 lines (49 loc) · 2.13 KB

IO.mkd

File metadata and controls

59 lines (49 loc) · 2.13 KB

Direct control over ADALM1000 functionality can be accomplished using the implemented USB control transfers, a synchronous and slow communication endpoint accessible regardless of the configuration of the device.

The M1K implements many control transfers, including the following:

  • 0x17 - read a number of bytes from the ADM1177 hot-swap controller
  • 0x50 - set a GPIO pin low
  • 0x51 - set a GPIO pin high
  • 0x91 - get a GPIO input pin value
  • 0x53 - set device mode
  • 0x59 - set potentiometer state

M1K pinmappings are described below.

IO Name Net Name Net Description Pin ID
PA0 PIO0 user DIO 0 0
PA1 PIO1 user DIO 1 1
PA2 PIO2 user DIO 2 2
PA3 PIO3 user DIO 3 3
PB0 UA11-IN0 50Ω from ChA to 2v5 32
PB1 UA11-IN1 50Ω from ChA to GND 33
PB2 UA11-IN2 ChA close voltage sense loop 34
PB3 UA11-IN3 ChA connect output 35
PB5 UB11-IN0 50Ω from ChB to 2v5 37
PB6 UB11-IN1 50Ω from ChB to GND 38
PB7 UB11-IN2 ChB close voltage sense loop 39
PB8 UB11-IN3 ChB connect output 40
PB17 PWR_ENABLE turn on power for analog components 49
PB19 SWMODE-A ChA switch SVMI - SIMV 51
PB20 SWMODE-B ChB switch SVMI - SIMV 52

Note that Pixelpulse2 and LibSMU use many of the above control transfers to configure device state during normal operation. As such, using these control transfers while streaming data may not produce the expected results.

Examples:

Python (PySMU)

import pysmu
s = pysmu.Smu()
ser = s.serials[0]
# set PIO1 high
s.ctrl_transfer(ser, 0x40, 0x51, 1, 0, 0, 0, 100)
# get state of PIO0
print s.ctrl_transfer(ser, 0xc0, 0x91, 0, 0, 0, 1, 100)
# set PIO1 low
s.ctrl_transfer(ser, 0x40, 0x50, 1, 0, 0, 0, 100)
# get state of PIO0
print s.ctrl_transfer(ser, 0xc0, 0x91, 0, 0, 0, 1, 100)

Javascript (Pixelpulse2 About Pane)

Javascript currently does not support reading parameters from the M1K via control transfer.

// set PIO1 high, then low again
session.devices[0].ctrl_transfer(0x51, 1, 0);
session.devices[0].ctrl_transfer(0x50, 1, 0);