DALI Control Gear Mode

The DALI Control Gear mode is configured using the following settings:

When the UART is set into Control Gear mode and the serial port is enabled, the UART begins to monitor for a received forward frame. Frames that are received after the U1P2 wait time expires are detected as a forward frame and are stored in the receive FIFO; if a frame is received before the U1P2 wait time expires, the frame is detected as a backward frame and ignored since a control gear can only receive forward frames. Backward frames from other Control Gear are ignored.

Once the Control Gear receives the last Stop bit of the forward frame, hardware starts a timer to delay the backward frame response by the number of half-bit periods stored in the U1P1 register.

The data received in the forward frame is processed by the Control Gear's application software. If a response is required, the application software writes the backward frame into U1TXB. The frame is held for transmission until the wait time delay expires. If the response is written into U1TXB after the wait time delay expires, the TXMTIF bit is held low, and the response is held in U1TXB until a new forward frame is received and the wait time associated to that frame has expired. If the UART Receive Interrupt Flag (U1RXIF) bit is set before TXMTIF becomes set, it means that a new forward frame was received before the pending backward frame was sent. In this case, the pending backward frame may hold an incorrect response to the new forward frame, therefore, the pending backward frame can be deleted by setting the TXBE bit.