Specifications
For examples of using the new SNAPpy I
2
C functions to interface to external devices, look at the
following scripts that are bundled with Portal:
• i2cTests.py – This is the overall I
2
C demo script
• synapse.M41T81.py – Example of interfacing to a clock/calendar chip
• synapse.CAT24C128.py – Example of interfacing to an external EEPROM
Script i2cTests.py imports the other two scripts, and exercises some of the functions within them.
Interfacing to multi-drop RS-485 devices
Many of the SNAP Demonstration Boards include an RS-232 serial port. The board provides the
actual connector (typically a DB-9), and the actual RS-232 line driver. SNAP Engine UARTS only
provide a logic level serial interface (3 volt logic).
RS-422 and RS-485 are alternate hardware standards that can be interfaced to by using the appropriate
line driver chips. In general, the SNAP Engine does not care what kind of serial hardware it is
communicating over.
Some types of multi-drop serial hardware are an exception. For these, multiple devices are able to
share a single serial connection by providing a special hardware signal called TXENA (transmit
enable). Normally none of the connected devices are asserting their TXENA signals. When a device
wants to transmit, it first asserts TXENA. After all of the characters have been shifted out the serial
port, the transmitting device deasserts TXENA so that another device can use the connection.
The following example of three nodes sharing a multi-drop RS-485 bus may make this clearer. You
will also notice that the TXENA signal is active low.
Device #1 TXENA --_____----------_____------------------------------------
Device #1 TX ---CMD------------CMD-------------------------------------
Device #2 TXENA ----------_____-------------------------------------------
Device #2 TX -----------RSP--------------------------------------------
Device #3 TXENA ------------------------_____-----------------------------
Device #3 TX -------------------------RSP------------------------------
As of version 2.2, SNAP can interface to this type of hardware (SNAP can provide the needed
TXENA signal). The TXENA signal is output on the pin normally used for Clear To Send (CTS).
3
3
Note that some naming conventions may expect the RTS pin to be considered the output pin, where the TXENA signal
would occur. SNAP has standardized on the naming convention used by our earliest hardware platform, which has CTS as
an output and RTS as an input.
SNAP Reference Manual Document Number 600-0007K Page 39 of 202