[5]
(MASTER/SLAVE) CFG mode
A falling edge on the RUN pin will cause the Click board™ to enter CFG mode. The RUN pin is pulled up by an internal
resistor.
While in the CFG sub-mode, the Click board™ stops its current operation, expecting a configuration command string. The
parsing method is the same as in the RUN sub-mode. However, the input buffer length is fixed to 9 bytes while in CFG
mode. Therefore, each command must be exactly 9 bytes long. After the ninth byte has been successfully received, the
received command will be parsed. There are several different configuration commands available that will be covered in the
Configuration commands
section in this manual.
The RUN LED indicator will be turned OFF while in the CFG sub-mode.
After the received command has been successfully parsed (and/or executed), the Click board™ will trigger an interrupt.
Also, a UART string will be transmitted over the TX pin, containing the received command, along with the status message:
-
If the command was recognized, the Click board™ will respond with the "OK" message (terminated by the <cr><lf>
sequence).
-
If the command was not recognized, the Click board™ will respond with the "ERR" message (terminated by the
<cr><lf> sequence) and the STAT LED will remain lit until a valid command is received or until the sub-mode is
changed.
NOTE: All commands are case-sensitive and no <cr> or <lf> control characters should be used when sending a command.
The parser will treat them as regular values, causing a misalignment of the input buffer. Any buffer misalignment can be
resolved with a short HIGH pulse on the RUN pin (while in CFG sub-mode).
DMX Start Code
The DMX Start Code must always be transmitted in any DMX-compliant system. It will be transmitted automatically
(MASTER mode) and it will be automatically inserted at the beginning of the received string (SLAVE mode). DMX Click
is developed with lighting applications in mind and in this case, the Start Code should be always equal to 0 (Null Start Code,
NSC). However, the application developer is free to choose whether to use it or not. The value of the Start Code can be
configured while the Click board™ is operated as MASTER. Its value is 0 by default.
Configuration
commands
Commands structure
The Click board™ offers a set of different commands over the UART interface. The command strings typically start with
the "@" character, a four-letter command mnemonic, a comma, and a three-digit command parameter. The command
parameter must be entered along with the leading zeroes (e.g. "003", "221", "015"). The entire command string must always
be of a fixed size (9 bytes), with no control characters added, as mentioned before.
If the command is not recognized, or if its parameter is outside the allowed range, an error condition will be signaled, as
explained in the
(MASTER/SLAVE) CFG mode
section. Special commands starting with the "!" sign, use no parameters and
are executed as soon as they are parsed.