SPLat Logo

SEXI: Serial I/O Expansion via Xwire Interface

NOTICE: Our web site is being updated, but is currently experiencing extreme slowness due to host issues. Please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map
SPLat will be shut down for the Christmas Holiday season from Friday 20 December 2024 through Tuesday 7 January 2025. We will check emails periodically and will continue to process orders but at a slower pace. Santa hat

SEXI: Serial I/O Expansion via Xwire Interface

 Introduction

SEXI is an easy way of expanding the I/O of any 32 bit SPLat controller.  Using SEXI allows the master controller to treat I/O on slave controllers as if it were physically on the master itself.

Here are the digital and analogue windows of SPLat/PC with an HMI430 connected.  We see the HMI430 has 9 digital I/O's (8 I/O + beeper), 2 analogue inputs and 1 analogue output:

 HMI430

Here they are again but this time the HMI430 has added a DA8 as a SEXI slave device.  Now the HMI430 has 12 digital I/O, 10 analogue inputs and 3 analogue outputs:

Both the analogue and digital I/O on the DA8 have been appended to the HMI430's I/O.  All this I/O is controlled via the usual SPLat I/O instructions, eg:

 

Programming

Master

SEXI is activated when the master controller executes an XwireMaster instruction with special SEXI entries in the Xwire table.

Normal Xwire table entry:


NV0Byte <SlaveAddress>, <TXBufferAddr>, <TXLength>, <RXBufferAddr>, <RXLength>

SEXI Xwire table entry


NV0Byte <SlaveAddress>, 255, <NofDigitalInputs>, <NofDigitalOutputs>, <NofAnalogueInputs>, <NoAnalogueOutputs>, <TXBufferAddr>, <TXLength>, <RXBufferAddr>, <RXLength>

As you can see, a SEXI entry is identified by the second byte of "255" (a value that is not legal in a normal Xwire entry).  Then follows the NumberOF (nof) I/O points that are available on the SEXI slave.

The <TXBufferAddr>, <TXLength>, <RXBufferAddr>, <RXLength> values are still present but are typically set to 0.  However their presence allows you to have a custom application running the the SEXI slave that's exchanging other information with you application running on the master.

Examples


;Addr, SEXI=255, Din, Dout, Ain, Aout, TXBuf, TXLen, RXBuf, RXLen
NV0Byte ADDR, 255, 16, 16, 2, 0, 0, 0, 0, 0 ;DT16/CC18, 16 din, 16 dout, 2 ain, 0 aout

NV0Byte ADDR, 255, 4, 4, 8, 2, 0, 0, 0, 0 ;DA8, 4 din, 4 dout, 8 ain, 2 aout

NV0Byte ADDR, 255, 6, 10, 0, 0, 0, 0, 0, 0 ;UI420, 6 din, 10 dout, 0 ain, 0 aout

NV0Byte ADDR, 255, 7, 4, 0, 0, 0, 0, 0, 0 ;UI216, 7 din, 4 dout, 0 ain, 0 aout

NV0Byte ADDR, 255, 4, 8, 0, 0, 0, 0, 0, 0 ;DR8, 4 din, 8 dout, 0 ain, 0 aout

NV0Byte ADDR, 255, 8, 8, 0, 0, 0, 0, 0, 0 ;DR240, 8 din, 8 dout, 0 ain, 0 aout

NV0Byte ADDR, 255, 8, 8, 4, 1, 0, 0, 0, 0 ;DR240A, 8 din, 8 dout, 4 ain, 1 aout

NV0Byte ADDR, 255, 5, 5, 1, 0, 0, 0, 0, 0 ;DW2, 5 din, 5 dout, 1 ain, 0 aout


Here's a working application that adds 2 DA8's to the master:


XwireMaster pMaster ;start Xwire

_Forever
Goto _Forever ;spin our wheels

NVEM0

pMaster
;Addr, SEXI=255, Din, Dout, Ain, Aout, TXBuf, TXLen, RXBuf, RXLen
NV0Byte 0, 255, 4, 4, 8, 2, 0, 0, 0, 0 ;first DA8 (all DIP switches off), 4 din, 4 dout, 8 ain, 2 aout
NV0Byte 1, 255, 4, 4, 8, 2, 0, 0, 0, 0 ;second DA8 (only DIP switch 1 on), 4 din, 4 dout, 8 ain, 2 aout
;EndOfTable=255
NV0Byte 255 ;End of Master Xwire table

Here's another example, this time with a single UI216.  Note the Xwire table includes an entry that sends OBLCD text to the LCD via Xwire:


NVEM0

pMaster
;LCD=249, FirstChar, NofChars (max 32), Zero, Zero
NV0Byte 249, 0, 32, 0, 0 ;LCD chars 0 thru 31

;Addr, SEXI=255, Din, Dout, Ain, Aout, TXBuf, TXLen, RXBuf, RXLen
NV0Byte 10, 255, 7, 4, 0, 0, 0, 0, 0, 0 ;UI216, 7 din, 4 dout, 0 ain, 0 aout

;EndOfTable=255
NV0Byte 255 ;End of Master Xwire table

Slave

The interesting news about SEXI Slaves is they can be ANY SPLat controller, both 8 bit and 32 bit controllers can be a SEXI Slave.  On the slave the SEXI protocol is implemented in SPLat.  We've published default applications for the controllers later on this page which you are welcome to modify.  You may, for example, decide to convert an analogue input to temperature in the slave application.  Thus, when the master reads that "analogue input" it gets the temperature that has already been calculated by the slave.

Slave Applications

Here are the SEXI applications we've published for a range of SPLat controllers.  Let us know if there's one we've missed.

Caveats