<<>> Introduction This document is the theory of operation for the SBus board portion of the spread spectrum digital radio communications link. It assumes that the reader has the schematics available and directly references signal and cell names within them. The majority of this document describes the design of the logic contained within the Xilinx field programmable gate array. Additional sections describe the physical implementation, both wirewrapped and pcb, simulation test suite, development software, and areas to investigate. The SBus board has three basic functions: data handling, transmitter enable, and receive code synchronization. The data handling is complicated somewhat by the receive code synchronization which requires that 0101 sequences appear frequently in the received data stream. To accomplish this an 8-10 code is used so that such sequences appear with a guaranteed minimum frequency, independent of packet length. There are three sources of time in the design, the SBus clock and the receive and transmit crystals. However, there are four synchronous timing domains in the design: SBus, main clock, receive code generation, and transmit code generation. The vast majority of the logic is run by the 5 MHz main clock, which is the 20 MHz receive clock divided by 4. The receive and transmit code generation clocks only clock the flip-flops in the respective code generators. The SBus clock only clocks the control path from nSel combined with nAS to Ack. No simulation or timing analysis has been performed to guarantee that all of the combinatorial paths inside of the Xilinx will meet the setup times required by the flip-flops. However the clock is so slow for the vast majority of the logic that it seems extremely unlikely that this is a source of difficulty and, in any case, no problems which could be ascribed to timing failures have been noticed. Cell Descriptions Cell SSCtl is the top level schematic for the logic which is contained within the Xilinx. Cell PCB contains the board level schematics. The theory behind the small amount of circuitry contained on the PCB is covered in the Receive cell description. Bits are numbered high order to low order in all cells except the PCB cell, where they are numbered low order to high order. SSCtl This cell forms the basic decomposition of the design between the bus interface, transmit logic, and receive logic. The ErrorGen cell was grafted on later to allow the capture of errors in which the transmitter sends a byte but the receiver fails to recognize the start pattern. This does not catch the other dominant failure mode, which is proper start pattern recognition followed by corrupted data. It would be fairly straightforward to further distort the division between transmit and receive so that this other failure mode is caught. All of the public signals flowing into the SBusInterface are synchronous to the SBus clock. RegAdr is also synchronous to the SBus clock, although its setup and hold times relative to the other internal interface signals are so large and its usage is such that this distinction can safely be ignored. All of the remaining signals are synchronous to CK, except as noted below. The next section provides a functional pin description of the Xilinx as programmed for this application. The SBus interface signals are not documented here. The reader should refer to the SBus Specification Rev A for their documentation. The signals specific to the Xilinx are also not documented; refer to the Xilinx programmable gate array data book. Non SBus pins TxClock (input) - nominally a 10 MHz clock. It actually must be slightly less than 10 MHz, e.g. 9.99981 MHz. Actual acceptable range for this clock has yet to be determined, see the Areas to Investigate section. TxCode (output) - pseudorandom code used to spread the transmit signal. Synchronous with TxClock. For details look in the CodeGen cell description. TxData (output) - transmit data. Note that this is synchronous with CK, which is divided down from the receive clock, not the transmit clock. TxEnb (output) - transmit enable. Error (output) - loopback error. Single pulse one CK period long each time transmit start is asserted without a matching receive start. For details look in the ErrorGen cell description. ToInt (output) - to integrator. Single pulse one CK period long each time an invalid pair of transitions is detected. RxCode (output) - pseudorandom code used to despread the received signal. RxClock (input) - nominally a 20 MHz clock. It actually must be slightly more than 20 MHz, e.g. 20.00036 MHz. Actual acceptable range for this clock has yet to be determined, see the Areas to Investigate section. RxData (input) - receive data. Synchronous with the RxClock of whichever transmitter has currently captured the receiver. Random noise if there is no such transmitter. SlipEnb (input) - slip enable. When high this allows the clock generating the receive code to have half cycles deleted so that it can be synchronized with the transmit code of the current transmitter. When low no such deleteions can occur. This is useful when adjusting the integrator threshold. CodeLock (input) - this is the output of the thresholded integration node. AmpLock (input) - lock detection output from receiver. SamClk (output) - phase lock loop clock. SamData (output) - phase lock loop data. SBusInterface Mostly this block simply buffers the SBus data and address wires into the internal logic. It also provides the control signals necessary for byte reads and writes. The control path is an open-ended shift register style sequencer. Each time a falling edge on nAS is detected while nSel is asserted a one is shifted into the beginning of the sequencer. This one is synchronized with CK and then, if the bus size is correct, asserts either RegRead or RegWrite for approximately one CK cycle. The trailing edge of this CK synchronous timing pulse is then synchronized back into the SBus clock timing domain and the proper acknowledgement is generated. At the bottom of the cell there is a shift register which has a constant one as its input. Its purpose is to ensure that the nAck wires are not asserted during the startup transient which occurs directly after programming the Xilinx. It is extremely important that the delay from CK to nAck tristate enable be as short as possible. To accomplish this the tristate controls are mapped into a specific CLB and the path from them to the pad tristate enables are marked as critical. Another approach, not implemented here, is to bracket the time periods during which the nAck wire is transitioning with tristate enable and then merely toggling the data inputs of the tristate devices. The combination of nBG and nReset is used to produce a known zero without using Gnd as the source. The tristate devices to which this known zero is tied must be present so that the Xilinx software won't assign these pads to some random flip-flop when the pads are physically attached to the corresponding SBus signals. Using Gnd as the known zero causes the Xilinx software to toss out the tristate devices as obviously useless. AckFlop This cell controls the tristate enables for acknowledgement. The A, B, and D inputs combine the bit shifting through the sequencer with the size information and startup transient suppression to enable the driver. The E input turns off the tristate enable two SBus clock cycles after enabling it. The K input must be the SBus clock. Transmit Both data and control are combined in this cell. The data path takes the byte presented by the buffered SBus data wires, combinatorially recodes it into 10 bits and then drops it into a shift register. The first bit of the the output shift register is broken out into discrete gates because otherwise the Xilinx software complains about the first SerialIn bit being set to a constant. The wires between the encoder and the shifter are reversed so that the bit pattern can be read off of an oscilloscope trace, left to right, most significant bit first. The controller is a closed loop shift register style sequencer. After device programming all flip-flops are set to zero. One flip-flop in the sequencer is surrounded by inverters so that the initial zero appears as a one. This sequencer shifts at the bit rate, rather than at the basic CK rate, so all the flip-flops have enables which are asserted once per bit time. Writing a byte into the output shift register also causes a request for transmission to be posted in the transmit busy flip-flop. When a request is posted, and the idle pattern has been sent for at least 10 bits, and the last bit sent was a one, then the controller sends the start of packet sequence, which consists of 4 additional ones. After the controller has sent the start of packet sequence it transmits the 10 bits of the current byte and then returns to sending the idle pattern. SBus register reads are implemented by chaining multiplexors rather than using tristate drivers. This is done because the Xilinx architecure and place and route software does not work well with tristate drivers. This block has a single register which can be read. The high order bit is the transmit busy bit. The next bit is the transmit enable bit. Only the transmit enable bit can be directly written. ShiftOutBit This cell implements a standard parallel load shift register with load and shift controls. It is CLBMapped in an effort to help the placement software find a good solution quickly. CodeGen This cell generates a pseudorandom sequence which is used for spreading and despreading the transmitted signal. It is a maximal length sequence for 6 bits, or 63. The illegal state, which is all zeroes, is detected and a one injected, to start the sequence generator. Encode8to10 and Decode10to8 In order to guarantee that 0101 sequences occur sufficiently often to allow loss of lock to be detected, the transmitted byte is recoded from 8 bits into 10 bits. The table below shows the mapping between the 8 bit and 10 bit codes. The first column lists the 8 bit patterns taken in to be transmitted or to be produced after reception. The second column lists the 10 bit patterns which are actually transmitted and received by the radio. The third and fourth columns are similiar but they list exceptions to the general rule stated in the first two columns. Primary Exception 8 bits 10 bits 8 bits 10 bits Bit number 0123 4567 0123 4567 89 0123 4567 0123 4567 89 00ab cdef 0101 abcd ef 0001 abcd 1bac 0010 1d 01ab cdef a010 1bcd ef 0110 1010 0101 0101 00 10ab cdef ab01 01cd ef 1001 abcd ab00 cd01 01 11ab cdef abc0 101d ef 11a0 1bcd ab11 cd01 01 In general the 10 bit codes of the form 0101 01xx xx are reserved to perform channel control. Currently only two such codes are implemented. Idle indicates when no data is being transmitted. Start indicates the start of a packet. Currently a packet contains only one data byte. Additional codes: 0123 4567 89 Idle 0101 0101 01 Alternate Idle 1010 1010 10 Start 0101 0111 11 Of course none of this recoding matters with the current design. Only with long packet lengths and transmit/receive clock frequencies that are dramatically different will this recoding become important. Receive This block, in combination with a small amount of external circuitry, has three basic functions: synchronize the receive code to the receive data, recover clock and data from the receive data, and implement three SBus registers. Receive code synchronization is accomplished by looking for rising edge transitions of the receive data which are too close together and slipping the phase of the receive code generator by 180 degrees each time too many such transitions occur quickly. The raw receive data coming in on RxData is synchronized and passed throught a filter which produces a one for each rising edge which appears as a clean 0011 sequence. This filter eliminates rising edges which are just one clock tick wide noise bursts. There is a six bit counter which measures the time from the last rising edge. This counter value is compared with a 6 bit register accessible to the SBus. If the counter value is smaller than the SBus register value then a pulse of length 5 CK cycles (1 microsecond) is emitted. This circuit is essentially a retriggerable one shot, so that if illegal transitions occur continuously then the ToInt output will be a constant one. Conversely, if no illegal transitions are detected, then ToInt will be a constant zero. CodeLock is the integration and threshold of ToInt. The integration is performed by a simple RC network with a time constant of approximately 50 microseconds. Thresholding is accomplished with a voltage comparator setup with a slight amount of hysterisis. AmpLock is a signal produced by the receiver to ShiftInBit SlipClock Lock Assemble ResetEnableCounter and ResetCounter Mux2, SR, RegBitD, CtlSynch, RegBit, MuxEnbFF ErrorGen Physical Implementation Wirewrapped Implementation Idiosyncrasies - DAC, PROM socket, additional 393 circuit on one, reset button PCB Implementation One 1736 not enough for 3090. Simulation <> <> <> <> <> Software <> <> <> <> <> <> <> <> <> <> Areas to Investigate Filter going to illegal counter is this really necessary, would a better one improve things significantly? 1736 vs. byte-wide prom forth code starts at 0 Xilinx program at top end Tx and Rx Clock Ranges Longer Packets Still program I/O but byte buffer DMA Adaptive Locking Acquisition Time Reduction