In a system with Xwire master and one or more slaves, you need a policy and a technique for allocating addresses to the slaves. In this context the address is what is used by the master to distinguish one slave from another. Every slave must have an address (even if you only have one slave), each slave must have a different address, and the master must be pre-programmed with the correct addresses.
What addresses to allocate
Xwire slaves can be either SPLat controllers (typically a CC18) that you have programmed to be an Xwire slave, or dedicated Xwire peripheral boards that we have made to be Xwire slaves, for example SX10500. Legal Xwire slave addresses are 0 through 253. The master does not have an address. Within that range you can allocate addresses however you see fit consistent with any constraints that may exist within individual slaves (i.e. not all slaves are readily able to take on all addresses).
Xwire peripheral products
If you are using an Xwire peripheral, you should first read up on its documentation to determine available addresses for that particular product. For example, the SX10500 has 8 possible legal addresses, and it has 3 jumpers for selecting one of those addresses.
SPLat controller programmed to be a Xwire slave
If you are using a SPLat controller, like the CC18, you must set its Xwire address using a XwireSetAddr instruction. That instruction takes whatever number is in the X register and makes it the Xwire address of the board.
How that number gets into X is a separate issue. There are several possibilities for the instruction preceding the XwireSetAddr:
LoadX 5: LoadX 5
XwireSetAddr
XwireGetJumpers: XwireGetJumpers
XwireSetAddr
InputFM instruction. In this case you would also use an AndM to select the bits being used. For example, say inputs 13 and 14 are used for address selection: InputFM 13 ;Read 8 inputs starting at 13
LoadX %00000011 ;Bit mask to select just inputs 13 and 14
AndM ;Bit-wise And between the inputs and the mask
XwireSetAddr
Note that inputs 13 and 14 are the option jumpers on an MMi202. Note also that they are typically available for use only if there is not a SPice board mounted on the MMi202.