Zektor MAS7.1 user manual

Home Theater Solutions
MAS7.1
RS-232 Serial Protocol Reference
Table of Contents
RS-232 Port Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
RS-232 Pinout and Baudrate Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Command Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Command Responses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
The Acknowledgement Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
The Error Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Query Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Checksums and CRC8’s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
MAS7.1 Quick Command Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Table of MAS7.1 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
A Simple Control Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Powering On / Off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Controlling the Front Panel Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Reading the Current Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
MAS7.1 Command Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
The MAS7.1 Command Set. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Error Response Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Command Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
‘B’ Button Emulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
‘DZ’ Delay Settings (*) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
‘FPC’ Front Panel Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
‘FS’ Restore Factory Default Settings (*) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
‘IR’ Query Last IR Code Received (*) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
‘IRC’ Set Learnable IR Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
‘LI’ Front Panel Light Intensities and Mode (*) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
‘MCS’ Multi-Channel Split . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
‘MZ’ Mute (*) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
P’ Power Control (*) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
‘PSM’ Primary / Secondary Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
‘‘Q’ Query Status (*) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
‘QZ’ Query for Zone Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
‘SS’ Save States (*) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
‘SZ’ Set Input (*) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
‘V’ Version Query (*) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
‘XE’ Transmit Enable Settings (*) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
‘XS’ Control Settings (*) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
K.I.S.S.™ Keep It Simple Serial. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
The K.I.S.S.™ Command Structure Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Using Bitmapped Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Using Command Checksums and CRC-8 Checkcodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Clearing the Command Buffer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
The Response Strings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Response String Checksums and CRC-8 Checkcodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Master / Slave and Asynchronous Modes of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
The Master / Slave Mode of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
The Asynchronous Mode of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Checksums and CRC-8 Checkcodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Differences between a Checksum and a CRC-8 Checkcode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Source Code Example of Calculating a Checksum. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Source Code Example of Calculating a CRC-8 Checkcode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2
MAS7.1 Suplemental Guide, Rev 1.1, 9/28/07

RS-232 Port Hardware




RS-232 Pinout and Baudrate Settings

The RS-232 port on the MAS7.1 is the same format, and pinout, as a PC modem, and uses the same type of cable as a standard serial modem would, which is a st an dard straight through cable. Do not use a cable that is marked as a “Null Modem” cable.
The MAS7.1 can also be used with any USB to RS-232 conversion cable, these are all typically straight through cables. (Be sure to install any drivers that come with the USB to RS-232 cable you are using.)
The RS-232 port is a female type DE-9 connector (sometimes mistakenly referred to as a DB-9 connector) with the following pinout:
Pin definitions:
1 - No Connect 6 - No Connect 2 - TX 7 - No Connect 3 - RX 8 - No Connect 4 - No Connect 9 - No Connect 5 - GND
The port settings used by the MAS7.1 are:
Baudrate: 9600 Data Bits: 8 Stop Bits: 1 Parity: NONE
MAS7.1 Supplemental Guide, Rev 1.1, 9/28/07
3

MAS7.1 Quick Reference

Command Syntax

The MAS7.1 serial command set uses an ASCII based protocol and a terminal emulator, like Hyperterm, can be used to test the serial port of the MAS7.1.
Each serial command is formatted as:
CMD param1,param2,...<CR>
Where:
CMD = The name of the command. param = Any number of parameters can follow a command. <CR> = The carriage return character, usually the character associated with the “Enter” key.
For instance the name of the command turn power on and off is ‘P’ (must be capitalized) therefore, to turn on the MAS7.1 send a:
P 1<CR>
to turn off the MAS7.1 send a:
P 0<CR>
the commands will not be echoed back, but instead you will receive a command response string.

Command Responses

The MAS7.1 will always respond to a command, there are no “time-out” modes, if you send a command and don’t get a response in 100ms, something’s wrong with the connection.
There are three different types of responses: Acknowledgements, Errors and Query Strings.

The Acknowledgement Response

Every command will get either an acknowledgement or error response. Anytime you issue a command and there are no errors, you will receive the acknowledgement response. Which is:
+<CR><LF>
which is the ‘+’ character followed by a carriage return (hex=0Dh) and a line feed (hex=0Ah).

The Error Response

Every command will get either an acknowledgement or error response. If something is wrong with the command, you will get an error response. Which is
!<err><CR><LF>
which is the ‘!’ followed by an error number (in ASCII), followed by a carriage return and line feed. For instance ‘2’ is not allowed as a parameter in the ‘P’ (power) command, so:
P 2<CR>
would cause the MAS7.1 to respond with:
!2<CR><LF>
the ‘2’ being the error code for “Parameter out of range”. For the full listing of error codes, see:
Error Response Codes” on page 9
4
MAS7.1 Suplemental Guide, Rev 1.1, 9/28/07
MAS7.1 Quick Reference
Command Responses (Continued)

Query Strings

A query string is a command string that you would normally send to the MAS7.1, proceed ed by the ‘=’ charac­ter, and with the parameters filled in to reflect the current state of the command. Commands return a query string when a ‘?’ is used as a parameter.
For instance to find the current power on / off state of the MAS7.1 send:
P ?<CR>
and, assuming the power is on, it will respond with:
+<CR><LF> =P 1<CR><LF>
The ‘+’ is the acknowledgement, indicating there were no errors in the command, the next line is the power command’s current setting, the ‘1’ indicates the power is turned on.
You can setup the MAS7.1 to send query strings when some thing changes, for inst ance when the power is tog­gled. See:

Checksums and CRC8’s

You can optionally append a checksum or a CRC8 checkcode to the end of any serial command and it will be tested by the MAS7.1. If the checksum or CRC8 checkcode does not match, the command will be rejected with a “!4” error response.
To add a checksum to a command, append a ‘;’ followed by the calculated checksum. For instan ce to turn on the MAS7.1 using a checksummed command:
P 1;220<CR>
To add a CRC8 checkcode to a command, append a ‘:’ followed by the CRC8 checkcode. For instance to turn on the MAS7.1 using a CRC8 checkcoded command:
P 1:221<CR>
By setting the proper control flags, you can also have the MAS7.1 append a CRC8 checkcode or a checksum to all of its response strings. See:
For more information on checksums and CRC8 checkcodes, and how they’re calculated, see:
and CRC-8 Checkcodes” on page 28.
Master / Slave and Asynchronous Modes of Operation ” on page 27
‘XS’ Control Settings (*)” on page 21.
Checksums
MAS7.1 Supplemental Guide, Rev 1.1, 9/28/07
5
MAS7.1 Quick Reference

MAS7.1 Quick Command Reference

The quick reference tables and command descriptions refer to Inputs, Zones (or outputs) and Channels.
Inputs = The number of inputs a switch has. The MAS7.1 is a 3x1 switch and has 3 Inputs. Zones = Number of Zones, or outputs, a switch has. The MAS7.1, a 3x1 switch, has 1 Zone. Channels = The breakaway channels. These are signals that can be switched indepe ndently of each other.
They are referred to in the commands by a single letter. The MAS7.1 has 4 channels:
M - Multichannel audio (the 5.1 audio connections). A - Analog audio (the L&R stereo connections). D - Digital audio. H - HDMI video.
Some notes on using the tables:
Each command is followed by a <CR> (not shown in the tables).
The ‘Command’ column shows the syntax of the commands. The values in italics are variables and are described in the ‘Comments’ column. The no n-ita lic characters ar e literals and should b e used as sh own.
Many commands allow a variable number of argument s, the examples shown her e are common u sages of the commands, for more details refer to the complete command reference.
All command names are case sensitive. The parameters used in commands are not case sensitive.
Most commands can be queried by replacing their parameters with a ‘?’ character.
The MAS7.1 is a 3x1 switch and has only one output zone. The command set used by the MAS7.1 is designed to be compatible with our line of matrix switches, to make writing a “universal Zektor device driver” easier . Because of th is, many of the com mands requir e you to supply a n output zone, and for the MAS7.1, the value can only be ‘1’.
The commands in this table that are marked with a ‘x’ in the ‘U’ column are universal throughout most of the Zektor product line. By using only these commands a Zektor universal driver can be more easily written.

Table of MAS7.1 Commands

U Command Description Comments
xP p Power control p=power state (0=off, 1=on, +=toggle). xSZ 1,n Set zone to input 1=Zone, n=Input (1-3,+,-). xSZ 1,Mn,An,Dn,Hn Set inputs w/breakaway 1=Zone, n=Inputs (1-3,+,-). M=Multichannel, A=Stereo, D=Digital, H=HDMI xMZ 1,m Mute zone 1 Mutes everything. 1=Zone, m=Mute (0=Normal, 1=Muted, +=Toggle). xMZ 1,Mm,Am,Dm,Hm Mute w/breakaway Mutes only the given chans. 1=Zone, m=Mute (0,1,+), M=Multi, A=Stereo, D=Digital, H=HDMI xDZ 1,Md,Ad,Dd,Hd Set delays Set delay times for each chan. 1=Zone, d=Delay (in ms). M=Multi, A=Stereo, D=Digital, H=HDM x V ? Get version string Returns: Product name and firmware version string. xLI mode,dim,bri Sets LED intensities mode=Mode (0=off, 1=dim, 2=bright, 3=auto), dim=Dim level (0-99), bri=Bright level (1-100). x Q ? Query for statu s Returns: Operating status flags (see text). x QZ ? Query for no. of zones & inputs Returns: Number of zones, number of inputs, and breakaway channel options. x IR ? Read last IR code Returns: Last IR code received.
IRC cmd,ircode Set (learn) an IR code cmd=Command being set (see text), ircode=New IR code for command.
B b,b,... Emulate button presses b=Button Codes (up to 16 codes per ‘B’ command, see text). x SS n,$ Save current settings Save current settings in EEPROM. n=Settings to save (see text). x FS 246,$ Reset to factory settings Resets everything back to their factory default settings! x XS flags Control settings Set / reset control options. flags=Control option flags (se e te x t). x XE flags
FPC pri,sec,sync Front panel control pri=Primary setting (1-3,+), sec=Secondary setting (1-3,+), sync=Sync setting (0,1,+).
PSM flags Primary / secondary mapping Maps channels to the primary or secondary buttons. flags=Map flags (see text).
MCS flags Multichannel split Maps split between multichannel and analog stereo connections. flags=Split flags (see text).
Transmit enable flags Enable commands to asynchronously send there status . flags=Enable flags (see text).
6
MAS7.1 Suplemental Guide, Rev 1.1, 9/28/07
MAS7.1 Quick Reference
MAS7.1 Quick Reference (Continued) A Simple Control Example
If you’re not looking to write a driver that will control this and all Zektor products, then here is an example of a couple of commands that will most likely do everything you’ll need in a simple installation.
<CR> = A Carriage Return, all commands end with a <CR>. <CR><LF> = A Carriage Return, Line Feed, all responses end with a <CR><LF>.

Powering On / Off

To power on the MAS7.1 issue the following command:
P 1<CR>
To power off the MAS7.1 issue this command:
P 0<CR>

Controlling the Front Panel Settings

To simulate the pressing of a Primary Button:
FPC pri<CR>
Where:
pri = A number between 1 and 3 indicating which primary button you’re pressing.
If the Sync LED is lit, the both the primary and secondary LEDs will change, if it is not lit, only the primary LEDs will change, similar to pressing the front panel buttons 1-3.
To sequence through the inputs:
FPC +<CR>
The ‘+’ can be used in many cases to sequence or toggle a value. To sequence in the opposite order, use the ‘-’ character.
To simulate the pressing of a Secondary Button (S1 - S3):
FPC ,sec<CR>
Where:
sec = A number between 1 and 3 indicating which secondary button you’re pressing.
If the Sync LED is lit, the both the primary and secondary LEDs will change, if it is not lit, only the secondary LEDs will change, similar to pressing the front panel buttons: S1-S3.
To simulate the pressing of the Sync Button:
FPC ,,+<CR>
This command will toggle the Sync LED on and off, similar to pressing the front panel ‘Sync’ button.
MAS7.1 Supplemental Guide, Rev 1.1, 9/28/07
7
MAS7.1 Quick Reference
A Simple Control Example (Continued)
To turn on the Sync LED:
FPC ,,1<CR>
and to turn off the Sync LED:
FPC ,,0<CR>
To set the primary selection to 2, the secondary selection to 1, and to turn off the SYNC LED:
FPC 2,1,0<CR>

Reading the Current Settings

To query the MAS7.1 for its current state, use the ‘?’ as the only parameter and the MAS7.1 will respond with a ‘=’ followed by the command with the current settings as parameters.
To read the power on state of the MAS7.1
P ?<CR>
the MAS7.1 will respond with
+<CR><LF> This indicates the command was accepted with no errors =P 1<CR><LF> This indicated the MAS7.1 is currently ON
To read the front panel settings:
FPC ?<CR>
the MAS7.1 will respond with:
+<CR><LF> Command accepted =FPC 2,1,0<CR><LF> Indicates the primary is 2, the secondary is 1, and the SYNC LED is OFF
8
MAS7.1 Suplemental Guide, Rev 1.1, 9/28/07

MAS7.1 Command Reference

The MAS7.1 Command Set

Examples are given for many of the ways a command can be issued. Most commands have a ‘set’ mode for changing a parameter value, and a ‘query’ mode for reading the current value.
If the command has a query mode, the associated response string, it will be listed. As described in the section on the K.I.S.S.™ protocol, whitespaces and commas are optional in many cases.
The format used here includes a single space after the command and commas, with no spaces, between parameters. The format given here does not show the optional checksum or CRC-8 checkcodes that may be appended to all commands, nor does it show the required <CR> that terminates all commands.
The response strings are the strings returned from MAS7.1, which use the same format as described above. The format does not show the optional checksum or CRC-8 checkco des that may be appended to all response strings if enabled, nor does it show the <CR><LF> that terminates all Response Strings.

Error Response Codes

The following are the Error Response codes that can be returned by the MAS7.1:
!1 Unrecognized command. !2 A parameter was out of range. !3 Syntax error, a badly formed command. !4 Checksum or CRC-8 error. !5 Too many or too few parameters. !6 Device busy, cannot process command. !7 Buffer overflow.
And some more detailed descriptions of their meanings: Error 1: The command given was not recognized as a MAS7.1 command. Commands are case sensitive and
in the MAS7.1, all commands are upper case. Error 2: One of the parameters given was too large, or too small, the command will be ignored. Error 3: Something was wrong with the command' s syntax. There was p ossibly extra data at the end o f the line,
or non-decimal data as part of a p aram eter. There cannot be whitespace before or after a checksum or CRC-8 checkcode, or this error will be returned.
Error 4: The ';' or ':' character was used to indicate a Checksum or CRC-8 Checkcode was appended to the command string, but the Checksum or CRC-8 Checkcode did not match the calculated one. The command will be ignored.
Error 5: The number of parameters given does not match the number allowe d by this command. Error 6: To prevent conflicts between the front panel Setup Mode and the serial port settin gs, when the MAS7.1
is in the Setup Mode, many parameters become read only and any attempt at writing them will return Error 6. Issuing the “Button Emulation” command with button code ‘0’ can be used to exit the Setup Mode, at which point the command can be re-issued without an Error 6 response.
Error 7: An internal buffer has overflowed, for instance more than 16 button codes were sent as part of the “Button Emulation” command.
MAS7.1 Supplemental Guide, Rev 1.1, 9/28/07
9
MAS7.1 Command Reference

Command Definitions

The commands are defined in alphabetical order. (*) In an effort to make “Zektor Universal Drivers” easier to write, Zektor has adopted a subset of “Universal
Commands”. By using only these commands, it should be possible to write a driver that works with all Zektor products. Reducing the ef fort of writing driver s for mult iple Zektor prod uct s. The comma nds that ar e p art of the Universal Command Set will be marked with a (*).

‘B’ Button Emulation

This command allows access to the internal keyboard handling of the MAS7.1, and is very hardware depen­dent. Button values returned by the MAS7.1 may and most likely will be different than button values returned by other Zektor devices.
Each button generates a value upon being pressed, and a different value upon release. The Power toggle button also generates a unique value when held for 4 seconds, which is used to enter the
setup mode. Other combinations may also generate unique codes. This command allows the controller to detect front panel button pr esses even when the front p anel is disabled .
This allows the controller very tight control over the MAS7.1. By disabling the front panel (see:
Settings (*)” on page 21), and by then processing the front panel button presses of the MAS7.1, the user can
redefine the operations of the MAS7.1. When used in combination with the “Read Last IR Code” command, eve n IR commands can be hand led by the
user, outside the MAS7.1’s firmware. Because of the tight link between this command and the MAS7.1’s firmware, there are some caveats when
using this command. The Zektor firmware expects a button press code to always be followed by a button release code. Sending these codes out of logical order will not harm the MAS7.1, but may result in unpredict­able behavior (buttons codes ignored, or unexpected state changes).
B b1,bn... Send one or more button codes to the MAS7.1. B ? Query for any buffered button presses. B Query for any buffered button presses.
‘XS’ Control
Response String:
=B b1,bn...
Where:
b1,bn.. = A variable number of button codes (1 to 16 codes per command).
In the Master / Slave mode, only the last 16 button presses will be logged between queries, after that, new but­ton presses overwrite the old ones in the internal buffer and will be lost to the controller.
The maximum number of button codes that can be sent is 16. If more than 16 button codes are sent a “param­eter count error” will be returned and only the first 16 button codes will be accepted.
10
MAS7.1 Suplemental Guide, Rev 1.1, 9/28/07
Loading...
+ 22 hidden pages