<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to protocol</title><link>https://sourceforge.net/p/ut61/wiki/protocol/</link><description>Recent changes to protocol</description><atom:link href="https://sourceforge.net/p/ut61/wiki/protocol/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 10 Oct 2013 21:17:32 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/ut61/wiki/protocol/feed" rel="self" type="application/rss+xml"/><item><title>protocol modified by Örjan Wennbom</title><link>https://sourceforge.net/p/ut61/wiki/protocol/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -47,7 +47,7 @@
 Message format
 --------------

-0:   [+-]
+0:   +/-
 1-4: Digits (but see below)
 5:   Space
 6:   Precision
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Örjan Wennbom</dc:creator><pubDate>Thu, 10 Oct 2013 21:17:32 -0000</pubDate><guid>https://sourceforge.netddd513ceec0859c53f04dc7d5096d75dde71228f</guid></item><item><title>protocol modified by Örjan Wennbom</title><link>https://sourceforge.net/p/ut61/wiki/protocol/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="analysis-of-ut61-communications"&gt;Analysis of UT61 communications&lt;/h1&gt;
&lt;p&gt;Everything described in this document is implemented in m_ut61.h, so&lt;br /&gt;
that file can be referred to as a working example.&lt;/p&gt;
&lt;h2 id="usb-cable"&gt;USB cable&lt;/h2&gt;
&lt;p&gt;Start logging:&lt;br /&gt;
(This is a HID Set Report request)&lt;br /&gt;
  CT    21 09 00 03 00 00 00 00&lt;/p&gt;
&lt;p&gt;To read from the device listen to interrupt transfers from endpoint 82.&lt;br /&gt;
There you'll find 8-byte blobs roughly every 10 ms. I have identified two&lt;br /&gt;
types (They are likely described in the USB HID spec), identified by their&lt;br /&gt;
first byte:&lt;/p&gt;
&lt;p&gt;f0 - No data available, the rest of the bytes are 0&lt;br /&gt;
f1 - Here, have a character! Second byte is the character.&lt;/p&gt;
&lt;p&gt;If you assemble all the contiguos characters, you will end up with a&lt;br /&gt;
14-character message as described below.&lt;/p&gt;
&lt;h2 id="rs232-cable"&gt;RS232 cable&lt;/h2&gt;
&lt;p&gt;The RS232 cable uses 2400 baud with  8 bit characters, no parity and 1&lt;br /&gt;
stop bit. To activate it, the RTS line needs to be cleared and the DTR&lt;br /&gt;
line set.&lt;/p&gt;
&lt;p&gt;As the data packets all end with CRLF, you can use line-oriented reading&lt;br /&gt;
from the port.&lt;/p&gt;
&lt;p&gt;This is how the Windows application sets things up:&lt;br /&gt;
SET_BAUD_RATE 2400&lt;br /&gt;
CLR_RTS&lt;br /&gt;
SET_DTR&lt;br /&gt;
SET_LINE_CONTROL 8n1&lt;br /&gt;
SET_CHAR EOF:0 ERR:0 BRK:0 EVT:0 XON:11 XOFF:13&lt;br /&gt;
SET_HANDFLOW Shake:1 Replace:0 XonLimit:512 XoffLimit:1&lt;br /&gt;
PURGE TXABORT RXABORT TXCLEAR RXCLEAR&lt;br /&gt;
SET_QUEUE_SIZE InSize: 2048 OutSize: 2048&lt;br /&gt;
SET_TIMEOUTS RI:1 RM:0 RC:1 WM:0 WC:0&lt;/p&gt;
&lt;h2 id="message-format"&gt;Message format&lt;/h2&gt;
&lt;p&gt;0:   &lt;span&gt;[+-]&lt;/span&gt;&lt;br /&gt;
1-4: Digits (but see below)&lt;br /&gt;
5:   Space&lt;br /&gt;
6:   Precision&lt;br /&gt;
7-8: Flags&lt;br /&gt;
9:   Prefix and special flags&lt;br /&gt;
10:  Unit&lt;br /&gt;
11:  Relative measurement integer&lt;br /&gt;
12-13: CRLF&lt;/p&gt;
&lt;p&gt;The four digits are the measured value with the decimal point removed.&lt;br /&gt;
However, if the meter is overloading, the value "?0:?" is reported.&lt;/p&gt;
&lt;p&gt;The precision is a single ASCII digit with the following meaning:&lt;br /&gt;
0: There is no decimal point&lt;br /&gt;
4: There is one decimal digit&lt;br /&gt;
1: There are three decimal digits&lt;br /&gt;
2: There are two decimal digits&lt;/p&gt;
&lt;p&gt;The seventh and eighth bytes are a bit field. I have observed these bits:&lt;br /&gt;
0x0001  Bar graph visibility&lt;br /&gt;
0x0002  Data hold&lt;br /&gt;
0x0004  Rel&lt;br /&gt;
0x0008  AC&lt;br /&gt;
0x0010  DC&lt;br /&gt;
0x0020  Autorange&lt;br /&gt;
0x0200  Nano prefix&lt;br /&gt;
0x1000  Min&lt;br /&gt;
0x2000  Max&lt;/p&gt;
&lt;p&gt;Byte 9 consists of two 4-bit fields, prefix and special flags.&lt;br /&gt;
The prefix has the following meaning:&lt;br /&gt;
0x00  No prefix (or nano prefix, as per above)&lt;br /&gt;
0x10  Mega (M)&lt;br /&gt;
0x20  Kilo (k)&lt;br /&gt;
0x40  Milli (m)&lt;br /&gt;
0x80  Micro (µ)&lt;/p&gt;
&lt;p&gt;The special flags are:&lt;br /&gt;
0x00  Nothing special&lt;br /&gt;
0x02  %&lt;br /&gt;
0x04  Diode&lt;br /&gt;
0x08  Buzzer&lt;/p&gt;
&lt;p&gt;The unit byte reads as follows:&lt;br /&gt;
0x00  Percent&lt;br /&gt;
0x04  Fahrad&lt;br /&gt;
0x08  Hz&lt;br /&gt;
0x20  Ohm&lt;br /&gt;
0x40  Ampere&lt;br /&gt;
0x80  Volt&lt;/p&gt;
&lt;p&gt;Byte 11 contains a 7-bit signed integer corresponding to the measured&lt;br /&gt;
value in 64ths of the current range.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Örjan Wennbom</dc:creator><pubDate>Thu, 10 Oct 2013 21:16:51 -0000</pubDate><guid>https://sourceforge.neta82fa2a637d85704f742a118be0b3d9f48ed0bc1</guid></item></channel></rss>