ssi. Object
The ssi. object implements up to four serial synchronous interface (SSI) channels on the general-purpose I/O (GPIO) lines of your Tibbo BASIC/C-programmable device. Examples of such interfaces are:
- I²C (http://en.wikipedia.org/wiki/I2C) — and YES, the ssi. object can handle the acknowledgment bit automatically. The TPP2(G2), TPP3(G2), EM2000, and EM2001 can use the i2c. object from TiOS V4.1.0.
- SPI (http://en.wikipedia.org/wiki/Serial_peripheral_interface).
- Clock/data (example: go to http://www.maxim-ic.com and search for MAX7219 display driver IC).
- Numerous variations on the above.
You can typically get all the necessary data from the IC to which you want to interface. Note that some interface designs may not be free to use (e.g., they are patented, etc.).
The common denominator among these interfaces is the presence of the clock line that "paces" data transmission on the data line(s) — with each clock cycle on the clock line, one bit of data can be transmitted over the data line(s). In contrast, UARTs (managed by the ser. object) are not synchronous — there is no clock line to synchronize two devices and this is why there is an "A" ("asynchronous") in "UART."
SSI interface links have masters and slaves. The master's role is to generate the clock pulses that slaves will use to synchronize themselves to the master. Only one device can be the master at any given time. The ssi. object can only work as the master. That is, it generates the clock for others to use.
Of course, it is possible to communicate with SSI devices by manipulating the GPIO lines of your device directly. This is known as "bit-banging" or "bit-blasting." The advantage of the ssi. object is in speed — the same data exchange will often complete hundreds of times faster compared with bit-banging.
A particular channel to work with is selected through the ssi.channel property. All other properties and methods apply to the currently selected channel.
The ssi.enabled property defines if the channel is disabled or enabled. Necessary configuration of the communication channel can only be performed when ssi.enabled = 0 — NO. Actual data exchange is possible only when ssi.enabled = 1 — YES.
If you are going to talk to an I²C device, be sure to check out More on I²C topic.