The Amulet system has two different ways of interfacing with an external processor using UART or USB. One method has the Amulet LCD module as the master and the external processor as the slave. The other method has the external processor as the master and the Amulet as the slave. Both methods can be run concurrently on the same GEMstudio page.
To set the Amulet as the master, the GEMstudio page needs to have href commands that start with Amulet:UART(port) or Amulet:USB where port can be (comm) or (prog). If no (port) is specified, then it defaults to (comm). The Amulet will send out the href command at an interval based upon the updateRate specified within that particular object. The Amulet expects a response from the external processor within 200ms, by default.
The Amulet does not need to be configured to be a slave. If the external processor chooses to be the master, it can send a valid Amulet message to the Amulet at any time or on any page and the Amulet will become the slave for that message. If the Amulet has any further master messages, it will once again become the master until the external processor chooses to be the master.
When the Amulet is the slave, the external processor can read and write to "virtual dual-port" RAM which resides on the Amulet side. The Amulet has 256 byte variables, 256 word variables, 256 26-character string variables and a 6 byte deep RPC buffer. Amulet Widgets can have href commands that start with Amulet:InternalRAM to access these "virtual dual-port" RAM variables.
The command opcodes are the same, regardless of who is the master or who is the slave. This means that a "Get byte variable" command sent to the Amulet looks exactly like a "Get byte variable" command sent to the external processor. The one difference is the slave ID, which is the first byte of every message. If the host is sending a master message to the Amulet processor, the message will start with the Amulet ID. If the Amulet is sending a master message to the host processor, the message will start with the Host ID.
Responses start with the same ID as the original message, so if the Amulet sends a master message to the host, the message from the Amulet processor will start with the Host ID and the response from the host will also start with the Host ID. Conversely, if the external processor sends a master message to the Amulet processor, the message will start with the Amulet ID and the response from the Amulet processor will also start with the Amulet ID.
Amulet can use either an ASCII-based or a CRC-based communication protocol between the Amulet LCD module and your embedded device (external processor). New GEMstudio projects default to using the CRC protocol, which is very similar in structure to Modbus RTU. The external processor must be capable of RS-232 serial communications. Amulet master messages are initiated either by timer events or by user input from the touch panel. Amulet master messages are derived from compiled GEMstudio code stored in the data flash on the Amulet module.
See Appendix A for a sample implementation of the Amulet protocol on an external processor.
Note: Amulet now defaults to using a much more secure CRC-based communication protocol. The ASCII protocol has been in use since 2000 and is still supported, but new projects are encouraged to use the newer CRC protocol.
For more information on ASCII Protocol, click here.
For more information on CRC Protocol, click here.