Meego Wiki
Views

Quality/QA-tools/hat-control

From MeeGo wiki
< Quality | QA-tools(Difference between revisions)
Jump to: navigation, search
m (Added new features: Multiple HAT support and current sensor)
(Using HAT SW to control usb and power switches.)
 
(One intermediate revision not shown)
Line 83: Line 83:
   $ git clone git://gitorious.org/meego-quality-assurance/hat-control.git
   $ git clone git://gitorious.org/meego-quality-assurance/hat-control.git
-
Go to hat-control folder and compile sources
+
Go to hat-control folder and compile sources (autoconf, automake, libtool and pkg-config are required)
-
   $ cd hat-control
+
   $ autoreconf -i
 +
  $ ./configure --prefix=/usr
   $ make
   $ make
 +
  $ sudo make install
== Using HAT SW to control usb and power switches. ==
== Using HAT SW to control usb and power switches. ==
Line 92: Line 94:
1. Connect HAT device to USB port and start HAT driver.
1. Connect HAT device to USB port and start HAT driver.
-
  $ cd src 
 
   $ hat_drv &
   $ hat_drv &

Latest revision as of 11:11, 7 April 2011

Contents

HAT Device

HAT purkki1.jpg

HAT device is test hardware to PC USB interface, which allows accurate measurements from DUT. Device has two switchable power outputs and two switchable USB paths. The power and data lines of the USB can switched on or off separately. HAT device has also four sensor inputs for different sensors. Currently only current measurement sensor is available, but other sensors will be available soon. Sensor inputs without sensor HW can be directly used to measure voltage levels if needed.

Hw concept.jpg

HAT device specs

Sensors inputs:

  • Analog input resolution is 12bit at 10kHz (for one channel. For two channels 10kHz/2 = 5kHz)
  • Analog input voltage range 0 - 2.44V
  • Input impedance ~1Mohm
  • Sensor inputs have one digital output line (TTL) for controlling sensor (e.g sensor gain)

USB:

  • Data+ and data- lines can swithced off or on.
  • Power line can be swithced off or on.
  • Maximum current 500mA
  • LED indicates data lines switch state.

Power

  • Absolute maximum input voltage 20V
  • Absolute maximum input current 1.5A
  • Two power outputs.
  • LED indicates power line switch state.

HAT-control

HAT-control is software that is used to control HAT (Hardware Accessory for Testing) device. SW contains two applications. Driver (hat_drv) application controls HAT device via USB. The control SW (hat_ctrl) controls HAT device using driver. Communication between driver and control processes is done using shared memory.

SW Installation

HAT-control sw can be installed to Ubuntu 10.04. It should work also other distributions, but it is not tested yet.

HAT SW dependences:

  • libusb-1.0.8
  • liblabjackusb
  • glib-2.0

Libusb installation:

1. Install libusb-1.0.x package:

  sudo apt-get install libusb-1.0

glib-2.0 installation:

1. Install glib-2.0 package:

  sudo apt-get install libglib2.0-dev

Liblabjackusb installation:

1. Get exodriver sources:

  git clone https://github.com/labjack/exodriver.git

2. Go liblabjackusb folder

  $ cd exodriver/liblabjackusb

3. Build library

  $ make

4. Install library

  $ sudo make install

5. Liblabjackusb needs access to the /dev/bus/usb. Run following commands in labjack-exodriver root folder.

  $ cd ..
  $ sudo cp 10-labjack.rules /etc/udev/rules.d
  $ sudo udevadm control --reload-rules

Building HAT SW

1. Build HAT SW:

Get sources using git (or some otherway):

  $ git clone git://gitorious.org/meego-quality-assurance/hat-control.git

Go to hat-control folder and compile sources (autoconf, automake, libtool and pkg-config are required)

  $ autoreconf -i
  $ ./configure --prefix=/usr
  $ make
  $ sudo make install

Using HAT SW to control usb and power switches.

1. Connect HAT device to USB port and start HAT driver.

  $ hat_drv &

Driver should print 'hat_drv: HAT driver started succesfully', if it has started succesfully. It also shows serial numeber of the controller device.

2. Use hat_ctrl SW to control HAT device. For example switch power output 1 on

  $ hat_ctrl -pwr1=on

Get all parameters just type

  $ hat_ctrl --help

New features

Multiple HAT support

Multiple HAT support will be added in couple of weeks. HAT driver and control software will have new parameter "-SN [SerialNumber]" which will specify the HAT device. When you have only one HAT device, you don't need to add "-SN" parameter. So, no modifications to excistence setup is needed if used only one HAT device.

New current sensor

The HAT Current Sensor can be used with HAT device by connecting it to one of the sensor inputs of HAT device. The sensor can be used for measuring the current from the device under test (DUT). The sensor has two measurement ranges, 0-100mA and 0-1.5A. The range is software selectable.

Further development

HAT SW is now very early state. There might be major changes in the near future. Command line parameters might change in near future.

Personal tools