MHS2300 series of dual-channel DDS signal generator
communication protocol (draft)
Summary
The overall structure of control commands using the command line,
the communication rate9600,19200,38400 and 57600bps optional, issue
the command from the PC, the native resolution is performed, and then
returns the result to the PC, at the end of each command newline symbol
(hexadecimal representation of "0x0a"),. The following illustrate different
commands.
Details
The overall command structure of the machine in three parts, each
instruction are comma (,) to separate
A start instruction
Starting instructions include a start flag colon character (:), And the
machine address of the decimal representation of the two characters,
For example, the local address is set to01, the start command is: 01
2 command section
Command section can contain One or more instructions executed
simultaneously, there are three general instruction,
The first class to read instructions to lowercase r at the beginning;
The second category is a write command, in lowercase w at the
beginning;
The third category is an arbitrary wave transmission commands in
lowercase a beginning;
Against r and w commands to define a number of the machine can access
the register address, read or write all you need to specify the register
address
For example, readingCH1 frequency command value is r23
CH1 amplitude values of read instruction r25
WriteFrequency is 12.45kHz instruction CH2 is w241245000
WriteCH2 amplitude value of 2.58V instructions to w26258
As for the specific list of address register instructions detailed in the table
behind, arbitrary wave transmission instruction for individual instruction
is followed by specific instructions.
3 End instruction
The end of the instruction is three decimal numbersLRC checksum value,
plus behind the line breaks 0x0a, ASCII value and one of the LRC
checksum value in front of all the characters and then add 1 to get
negated, the LRC value can also be set by the local inspection and not be
inspection, generally in order to simplify the operation, the machine
default is not carried LRC checksum
WithoutLRC checksum end command 000 + (carriage return 0x0d) +
(newline 0x0a)
ConductLRC parity, LRC is 23 and the command
023 + (carriage return 0x0d) + (newline 0x0a)
4 Specific application examples:
Based on the above description, for example, we want to readCH1 single
frequency value of the task,
: 01, r23, 000 + (carriage return 0x0d) + (newline 0x0a)
Reply message to the machine(Read frequency is 26.38kHz), 067 for the
LRC checksum value, which is the blue part of the character values
negated sum plus one
: 01, r230002638000,067 + (carriage return 0x0d) + (newline 0x0a)
If you want to readCH1 frequency and amplitude values do two tasks at
the same time, you can use the following command
: 01, r23, r25, 000 + (carriage return 0x0d) + (newline 0x0a)
Reply message to the machine(Read frequency is 26.38kHz, amplitude
value 7.26V)
: 01, r230002638000, r250000000726,079 + (carriage return 0x0d) +
(newline 0x0a)
In reading, while you can also write, for example, the following
command needs to be done to put the four with the use of a command to
achieve the
: 01, r23, r25, w241245000, w26258, 000 + (carriage return 0x0d) +
(newline 0x0a)
Machine returns information
: 01, r230002638000, r250000000726, w24, w26,059 + (carriage return
0x0d) + (newline 0x0a)
5 Register Address List
Name
Show
Address
Remark
CH1waveform
Wave1
21
0: sine, 1: squart, 2: triangle
101: arbitrary01, 102:
arbitrary02...
CH2waveform
Wave2
22
0: sine, 1: squart, 2: triangle
101: arbitrary01, 102:
arbitrary02...
CH1frequency
Freq1
23
0 ~ 500000000 (max
5MHz)
CH2 frequency
Freq2
24
0 ~ 500000000 (max
5MHz)
CH1amplitude
Ampl1
25
0 ~ 2000 (max 20.00Vpp)
CH2 amplitude
Ampl2
26
0 ~ 2000 (max 20.00Vpp)
CH1offset
Offs1
27
0 ~ 100:0 ~ 100%
65535: -1% 65534: -2%...
CH2offset
Offs2
28
0 ~ 100:0 ~ 100%
65535: -1% 65534: -2%...
CH1 duty
Duty1
29
999:0.1 ~ 1% ~ 99.9%
CH2 duty
Duty2
30
999:0.1 ~ 1% ~ 99.9%
CH1phase
Pha1
31
1 to 359:1~ 359
CH2phase
Pha2
32
1 to 359:1~ 359
Burst pulse
P_num
33
1 ~ 1048575
Sweep frequency
S_f0
34
0 ~ 500000000 (max
(begin)
Sweep frequency
5MHz)
S_f1
35
(end)
Sweep amplitude
0 ~ 500000000 (max
5MHz)
S_a0
36
0 ~ 2000 (max 20.00Vpp)
S_a1
37
0 ~ 2000 (max 20.00Vpp)
S_d0
38
999:0.1 ~ 1% ~ 99.9%
S_d1
39
999:0.1 ~ 1% ~ 99.9%
Sweep time
S_tim
40
1 ~ 99:1 s ~ 99s
Sweep mode
S_mod
41
0: Sweep Frequency
(begin)
Sweep amplitude
(end)
Sweep duty
(begin)
Sweep duty
(end)
1: Sweep Amplitude
2: Sweep Duty
Sound option
Sound
42
0: Sound disable
1: Sound enable
Language option
Lang
43
0: Engish 1: Chinese
Key lock
K_loc
44
0: Keyboard Unlock
1: Keboard Lock
Memory position
Mpos
45
0 to 99
The following parameters are read-only, write invalid
Counter
M_c
80
Measure
M_f
81
M_lf
82
M_h
83
M_l
84
Measure period
M-t
85
Measure duty
M_d
86
Frequency
Measure Low
Frequency
Measure High
level Time
Measure Low
level Time
The following is a bit manipulation instructions
CH1 Output
CH1_ON
61
0: OFF 1: ON
CH2 Output
CH2_ON
62
0: OFF 1: ON
CH1 Low
CH1_uHz
63
0:Normal
Frequency
CH2 Low
1:10 uHz resolution
CH2_uHz
64
0:Normal
Frequency
TTL_IO
1:10 uHz resolution
TTL_IO
65
mode
Measurement
1: TTL_IO Input
Ext_SEL
66
select
CH1 Trace mode
0: TTL_IO Output
0: Ext.IN
1: TTL_IN
CH1_TR
67
0:Normal
1: Trace Frequency
CH2 Trace
CH2_TF
68
frequency
CH2 Trace
1: Trace Frequency
CH2_TA
69
amplitude
CH2 Trace duty
0:Normal
0:Normal
1: Trace Amplitude
CH2_TD
70
0:Normal
1: Trace Duty
The following parameters are stored command execution
Save
save
90
savemem
91
configations
parameter
Save common
00 to 99
parameter
Here's the address of an arbitrary wave
Arbitrary data
Arbitrary01 ~
01 ~
The Adderss is Used to
Arbitrary15
15
Write Arbitrary data
The following are the key sequence
Key_sequence
Key_S
00
This is used to simulate
keyboard events
6 bit operation instruction
Address61 to 70 is a bit operations, which is the value written only 0 or 1,
for example,
Open ChannelsW611 is a command
Close ChannelW610 is a command
Open ChannelsCommand 2 is w621
Close ChannelCommand 2 is w620
7 save the parameters on the implementation of Directive
Here are two commands, addresses,90 instructions for saving the
configuration parameters, such as sound options, language options, etc.,
can be followed by any parameters
Instruction format indicate
w900
91 instruction set used to store common parameters, such as channel 1,
channel 2 frequency, amplitude, etc., the storage location is 00 to 99 total
100 positions
Instruction format indicate (stored position18) w9118
8 written instructions about any wave
Do not write any wave and w r commands and instructions
simultaneously, can only be used alone, one can only write to a memory
location, the machine total 15-bit arbitrary waveform storage.
Arbitrary Waveform written format is very simple, such as writing
position01 a full-wave rectified waveform of the form:
a01512, 515,518, ......., 515,000 + (carriage return 0x0d) + (newline 0x0a)
Ellipsis There are a lot of ...... said intermediate data, separated by
commas, this example command due to the longer format, we specialize
in one file to describe all arbitrary command.txt complete command.
9 button on the analog command
Address key analog command in00, the back can simulate up to 10 with
the keys, each key figure is expressed as:
F1 1
F2 2
F3 3
F4 4
F5 5
Left 6
Right 7
Ok 8
For example, followed by pressingF3 F5 F2 to enter the frequency
measurement mode
By sending commands Such operation can be achieved w00352