User manual
• 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 funcons within them.
Interfacing to multi-drop RS-485 devices
Several of the SNAP Demonstraon Boards include an RS-232 serial port. The board provides the actual
connector (a DE-9, somemes referred to as 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 communicang over.
Some types of mul-drop serial hardware are an excepon. For these, mulple devices are able to share a single
serial connecon by providing a special hardware signal called TXENA (transmit enable). Normally none of the
connected devices are asserng their TXENA signals. When a device wants to transmit, it first asserts TXENA.
Aer all of the characters have been shied out the serial port, the transming device deasserts TXENA so that
another device can use the connecon.
The following example of three nodes sharing a mul-drop RS-485 bus may make this clearer. You will also
noce that the TXENA signal is acve 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).
The funconality (meaning) of the CTS pin is controlled by the SNAPpy built-in funcon flowControl(). Refer to
the descripon of that funcon in the “SNAPpy – The API” secon of the SNAP Reference Manual.
Encryption between SNAP nodes
Communicaons between SNAP nodes are normally unencrypted. Using the SNAP Sniffer (or some other means
of monitoring radio traffic) you can clearly see the traffic passed between nodes. This can be very useful when
establishing or troubleshoong a network, but provides no protecon for your data from prying eyes. Encrypng
your network traffic provides a soluon for this. By encrypng all your communicaons, you reduce the chances
that someone can intercept your data.
SNAP nodes offer two forms of encrypon. If you have a compable firmware version loaded into your nodes,
you can configure them to use AES-128 encrypon for all their communicaons. You must have a firmware
version that enables AES-128 to be able to do this. You can determine which firmware is loaded into a node by
checking the Node Info pane for the node in Portal. Firmware that supports AES-128 encrypon will include
“AES-128” in the firmware name.
42 SNAP® Network Operang System