+ Post New Thread
Results 1 to 8 of 8
  1. #1
    Advanced Member level 5
    Points: 32,316, Level: 43
    Achievements:
    7 years registered

    Join Date
    Sep 2008
    Location
    cambridge
    Posts
    6,734
    Helped
    488 / 488
    Points
    32,316
    Level
    43

    The nature of bytes sent with DALI comms protocol?

    Hello,
    Our software engineer has failed to get our DALI comms system working for our lamps. (The DALI libraries etc are just too complex). Therefore we are now asking him to just do software “bit-bashing” of the DALI signal, which is just 2 bytes, as attached.
    However, he is asking if there is a variable delay between the two bytes? (the bytes are Manchester encoded). Also, as you can see, there is a transition every 400us or 800us. Will these timings always exist with DALI? (or will they vary widely).

    •   AltAdvertisement

        
       

  2. #2
    Super Moderator
    Points: 76,224, Level: 67
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,457
    Helped
    3513 / 3513
    Points
    76,224
    Level
    67

    Re: The nature of bytes sent with DALI comms protocol?

    Hi,

    Maybe start to read DALI specifications.
    At least this is where I would start.

    As next step you could read through the datasheet of the device that sends out your DALI signals.

    Klaus


    1 members found this post helpful.

  3. #3
    Advanced Member level 5
    Points: 32,316, Level: 43
    Achievements:
    7 years registered

    Join Date
    Sep 2008
    Location
    cambridge
    Posts
    6,734
    Helped
    488 / 488
    Points
    32,316
    Level
    43

    Re: The nature of bytes sent with DALI comms protocol?

    Thanks, the DALI manual on page 19 says its 1.2bits/sec, but this cant be right...
    DALI manual
    http://www.dali-ag.org/fileadmin/use...anual_engl.pdf

    ..unfortunately the manual says nothing clearly about the timings or time gap between the two bytes.

    - - - Updated - - -

    As next step you could read through the datasheet of the device that sends out your DALI signals.
    Thanks our DALI sender is a Philips "LLC7240 9137 003 608", and there is no datasheet for this, it is philips IP.

    Their apps guy visits us and just tells us it is ok for us, that it will send DALI, and thats that.
    (We prized it apart and noticed there are electrolytic capacitors in it. If we had known this we would have looked for something else, but it seems they all have 'lytics in them.)



    •   AltAdvertisement

        
       

  4. #4
    Super Moderator
    Points: 80,462, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,188
    Helped
    4404 / 4404
    Points
    80,462
    Level
    69

    Re: The nature of bytes sent with DALI comms protocol?

    DALI is specified as 1200 bits per second and according to Wikipaedia, 30 bit data packets. I do not have (or can afford!) the full specification I'm afraid.

    1200 bits per second means one bit lasts 1/1200 S = 833uS

    Each bit has a high and a low half so the transitions should occur every ~416uS or 833uS. I can't tell from the image how well the waveform complies with that.

    I doubt there should be any delay between bytes but your scope trace only shows 16 bits, I suspect it is missing some of the pre-amble, post-amble or maybe CRC checking. It seems too short but without knowing the full packet structure I can't tell which bit is missing. The only reference to the structure without reverse engineering existing code I can find is in document DRM004 from NXP which states 16 bits and two stop bits are needed.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.


    1 members found this post helpful.

  5. #5
    Advanced Member level 1
    Points: 977, Level: 7
    Achievements:
    7 years registered
    hexreader's Avatar
    Join Date
    Apr 2011
    Location
    England
    Posts
    490
    Helped
    190 / 190
    Points
    977
    Level
    7

    Re: The nature of bytes sent with DALI comms protocol?




  6. #6
    Super Moderator
    Points: 80,462, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,188
    Helped
    4404 / 4404
    Points
    80,462
    Level
    69

    Re: The nature of bytes sent with DALI comms protocol?

    Well spotted Hexreader!

    So it is 16 bits + 2 stop bits and the first bit is a request for a reply from the client device.
    So by my counting, at least one bit is missing from the stream shown in post #1 so it isn't a valid DALI message.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



  7. #7
    Advanced Member level 5
    Points: 32,316, Level: 43
    Achievements:
    7 years registered

    Join Date
    Sep 2008
    Location
    cambridge
    Posts
    6,734
    Helped
    488 / 488
    Points
    32,316
    Level
    43

    Re: The nature of bytes sent with DALI comms protocol?

    Thanks Brian, i will check what we sent it with. I know it was a USB plugged device ("thing" to us) , which we plugged into our PC, and also had a DALI 15V power supply wired to the USB "thing", and then the DALI wires went from the DALU PSU box to our lamp.
    The "USB thing" communicates with an App on the PC called "Terminal Deploy".

    We type the bytes to be sent into terminal deploy.....eg type "0xFE" into the LHS dialog box and "0x07" into the RHS dialog box and it sends that, or at least we though it did..."0xFE" means "dim to a level", and the "0x07", means dim to 7/255 *max.

    - - - Updated - - -

    0xFE is always the first byte for us....the top post shows the sending of 0xFE then 0x0F.. or we hoped it did.
    Last edited by treez; 24th June 2017 at 11:02.



    •   AltAdvertisement

        
       

  8. #8
    Super Moderator
    Points: 80,462, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,188
    Helped
    4404 / 4404
    Points
    80,462
    Level
    69

    Re: The nature of bytes sent with DALI comms protocol?

    Might I suggest you persuade your boss to part with a modest sum of money and buy a Saleae logic analyzer. They are tiny boxes with a USB interface on one side and probe wires on the other. You can hook it up to your DALI data and set it's decode to "Manchester" and it should not only show the waveform but decode what it carries as confirmation your software is correctly producing it. It can also measure the exact data rate and bit widths to confirm the bit-banging is working as expected.

    I have no connection with Saleae but their devices and the software behind them is really first class. It's saved my skin several times!

    www.saleae.com

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



--[[ ]]--