5.7 YAESU5 configuration - frequency - FT920 example
You need to first look at the documentation on ASCII command masks.
The outgoing commands for all YAESU5 radios are five bytes:
- four bytes of optional bcd (binary coded decimal) data
- following by a hexadecimal opcode byte.
- The readbytes and setbytes fields are always set to 10 (ie: 10 chars generating 5 bytes)
Set frequency - FT920 example
The manual specifies the frequency in four bytes: P4 P3 P2 P1 followed by opcode = 0A
(Be aware that the FT818 manual notation is reversed, ie: P1 P2 P3 P4 Opcode)
Thus: 56 34 42 01 will set 14.234560 MHz (frequency resolution = 10 Hz)
We configure this in the catcodes table as: setmask = htcmedgf01
ie: ten ascii characters which will be translated into five bytes.
In detail: ht cm ed gf 01. t is replaced by tens, h by hundreds, m by thousands
c by ten thousands d by hundred thousands
e by millions, f by ten millions g by hundred millions
(Note that their is no u = units because the resolution is 10Hz )
All a bit tricky ... but that's how it is! .... It works fine !
With YAESU5, the setbytes field is ALWAYS set to 10.
Read frequency FT920 example
The command ('Status update') specified as; Opcoded = 10 then P1 ** ** P4
P1 = 03 returns 2 x14 bytes of data for:
VFOA in bytes 0 -1 3 (specified as 1 to E)
VFOB in bytes 14 - 27 (specified as 1 to E)
P4 is unused here with P1 = 03;
Within each 14 byte VFO block (I use 0 to 13 here, rather than the stated 1 to 14):
- byte 0 Band selection ?? what is it .. no explanation
- bytes 1 to 4 Operating frequency - Discovered to be in binary (not BCD)
- bytes 5 and 6 Clarifier offset - binary 2s complement
- byte 7 Mode data
- bytes 8 Flag .. clarifier on/off, antenna selection etc
- bytes 9 and 10 Filter data
- bytes 11 and 12 CTCSS decoder data
- byte 13 Memory recall data
Therefore, for VFOA, we need bytes 1 to 4 of the first 14 byte block
(= bytes 1 to 4 of the combined 28 byte block.)
We set the answermask to: #28:04:01:FF:bbbbbbbb
This means:
- Receive 28 bytes ( we have to inform the USB/serial code how many bytes to wait for.)
- Extract 04 bytes starting at bytes 01
- Ignore the FF -- This is a mask to extract specific bits ... only for single byte extract.
- bbbbbbbb - translate the four bytes into 8 characters as a hexadecimal (binary) string.
The corresponding mask for VFOB is #28:15:01:FF:bbbbbbbb
ie: The same, but starting at byte 1 of the second 14 byte half of the block = 14 + 1 = 15.
We must set the answerbytes field to 8 = no of chars in bbbbbbbb.
Explanation:
This system is designed to fit into the existing character based system (ASCII option)
All the interpretation is done on the server and returned to the web browser as a numeric string.
(ie: the data is transmitted back with the value part of the returned data array = 14234560)
This is all perhaps a little complex - but hopefully, the examples for F818, FT847 and FT920
with assist in applying a configuration to other radios (with help from the iogroup if needed)
The actual answermask for data is the 8 characters: bbbbbbbb,
hence we set answerbytes = 8 ( NOT 28 )
Clarifier FT920 (Rx only)
The clarifier is the one control where I can set up a slider with both on/off and reset buttons.
(and with two- way communication)