Electronic – DALI Slave not responding to short address


I'm creating customized DALI Master from scratch. The problem is, that no matter what I do, none of the devices responds to short addressing.

Let's start from the beginning.

  • After connecting single device to DALI bus, it works as expected for all commands if using BROADCAST addressing (first byte equal to 0xFF). Transmission goes both ways reliably, including 'direct arc', 'off' and 'query status' commands. As expected the device responds with dec 64 for 'query status', which means no short address is set.
  • In the next step I tried performing binary search sequence, to assign short address to the device:
    • Initialize command is sent (x2) – 0b10100101 0b00000000
    • Randomise commands is sent (x2) – 0b10100111 0b00000000
    • Binary search is performed, device is detected as expected.
    • Program short address is sent (x1) 0b10110111 0b00000001 (to set short address 0)
    • Verify short address returns 'YES', Query short address returns 0b00000001. Works like charm.
    • Terminate command is sent (x1) – 0b10100001 0b00000000
  • After trying to execute any command with short address (for example querying status) using 0b00000001 0b10010000 device won't respond.
  • What is even more interesting, if broadcast is used again, device responds to 'query status' with status 0, meaning that short address is set…
  • What is more interesting again, sending this command to all short addresses gives no response to any of them.

I already tried 2 different DALI slaves from different manufacturer, both with exactly same result.

Best Answer

In the end I found a solution myself.

There was a bug in start-bit generation procedure.

// 0 ... 0 bits - 0 ... 1 menchester bits - start bits
if(MenchesterBitIndex <= 2)
    return true != MenchesterInverted;

The <= instead of < caused 3 bits to be generated as start bits. For all commands starting with bit 1 this made no difference, so the whole addressing sequence was ok. For normal short addressing the first bit was 0 which generated invalid menchester code.