TIDUE73A April 2018 – November 2024
When implementing a CLB design, first visualizing the required CLB behavior using waveforms can be helpful. To do this, first consider an an example transaction. Recall a BiSS-C transaction consists of the MA signal plus the encoder's response. A transmission can be broken up into FRAME_STATEs as shown in Figure 2-11. The first step is to map each element of the transaction to a CLB submodule. An example mapping is shown in Table 2-4.
Transaction Behavior | CLB Mapping |
---|---|
Track the FRAME_STATE | Finite State Machine (FSM): transitions to a new state given the previous state and current inputs. |
Generate two clock signal of a specific width: one for MA and one for the SPI clock. | For each signal, this requirement maps to a COUNTER. Leverage the match values to generate the timing for the rising/falling edges. A LUT (Lookup Table) then generates the actual edges based on this timing. |
Transmit a specific number of clock pulses for MA and for SPI clock. | For each clock, this maps to a COUNTER. On the edge of the clock the COUNTER increments and a MATCH indicates when the number is reached. |
Align the SPI clock with the encoder's response | The COUNTER generating the SPI clock can be configured such that the edge transition is properly aligned with the encoder's response. |
Only allow the SPI to be clocked when receiving the encoder's response | A LUT blocks the clock when the clock is not needed |
During the BiSS timeout, hold the MA signal high or low (CDM bit) | Using GPREG input, the C28 can tell the CLB if the CDM must be high or low. This combined with a LUT then hold the value on MA after the specific number of clocks have been transmitted. |
Control the TxEN | For BiSS-C, the TxEN is held low. The CLB output LUT can apply a constant "0" to an output. |
Tell the CLB to start the transaction by sending MA | The C28x configures the COUNTER and SPI for the transaction. The CLB GPREG allows the C28x CPU to directly change a CLB input to start a transaction. |
The next step is visualization of the specific submodule behavior. Start with a quick sketch and then add additional detail as the design develops. Figure 2-12 shows an example waveform that was generated using the CLB SystemC simulation model with a custom input as the encoder's response. While Figure 2-12 was generated by the actual design, the figure's detail is similar to a preliminary sketch.
Markers 1 - 4 in Figure 2-12 are used in the following sections to describe specific behavior of the design with respect to that marker. The markers are:
During IDLE there is no activity on the interface. The C28x must initiaite the transaction by:
Refer to: Figure 2-12, marker (1).
START_OPERATION remains high for one CLB_CLOCK because the CLB's rising edge filter is enabled for that input. At marker (1) the main state machine (FSM1 on Tile4) responds by moving FRAME_STATE from IDLE to the TRANSMIT_MA state.
During TRANSMIT_MA:the encoder interface sends the MA signal to the encoder. This signal is a clock with a specific duty cycle and defined number of clock cycles. The number of cycles depends on the resolution of the encoder. While clocking MA, the CLB monitors the SL line for an encoder response.
Refer to: Figure 2-12, marker (2).
To detect the encoder's response, the CLB monitors SL for a rising edge. The rising edge corresponds to the START bit after the ACK. The time required to detect the response can be any number of clocks and depends on the state of the encoder and the cable length. In addition, if the encoder requires extra time to respond, the ACK state is extended.
When the encoder's START bit is detected, the FRAME_STATE transitions to send MA and receive SL.
Refer to: Figure 2-12, marker (3).
The CLB starts clocking the SPI peripheral to receive the response.
Refer to: Figure 2-12, marker (4).