Knowledge Base

Xwire: Instruction summary

Xwire is controlled by the following instructions, available in dialect 20 and later in boards that support them:

XwireMaster pppp

Make this controller the Xwire master and use the configuration data table stored at address pppp in NVEM page 0.

XwireSlave pppp

Make this controller an Xwire slave and use the configuration data stored at address pppp in NVEM page 0.

XwireSetAddr

Use the value in X as the Xwire address of this controller. Pops X. Meaningless if this is not an XWire slave. The legal address range is 0 to 253. The master does not have an address.

XwireGetJumpers

Some boards (notably CC18) contain jumpers intended for setting the Xwire address. This instruction reads the jumpers into X.

Note 1: The connection between the jumpers and the address is purely via the XwireSetAddr instruction. It is not automatic.

Note 2: If the jumpers are not used for setting the Xwire address they can be used for anything else. Your simply need to use XwireGetJumpers to read them as they do not appear as regular inputs.

XwireGetErrCount

In the master, push the error count into X and reset the count. This will give a count of how many transmission errors have been detected since the previous time this instruction was executed.

Boards with dialect 23 or later support the following additional instructions:

XwireStop

In an Xwire master executing this instruction will turn off Xwire activity at the completion of the current Xwire transaction.

XwireIdlePoll

Test if Xwire polling has ceased following an XwireStop instruction

XwireGetPollCnt

Determine the level of Xwire activity. A slave can check if it is being polled. A master can find out how frequently it is polling.