Electrical – DALI Protocol: Is it valid to include this for manchester decoding convenience

dalimanchester-codingserial

Understanding: DALI uses Async data decoding using 1 start bit and 2 stop bits. The 1 start bit is logical one (1), also encoded during Manchester encoding and the 2 stop bits(Signal is HIGH for long periods, at least 2*833us) designate the idle_signal.

Now, if I am decoding this data using the measured pulse width method or sampling method, I will not have a closing interrupt for last bit "1"!! I am specifically using pulse-width method decoding for Manchester decoding.

I can solve this problem by checking the LSB bit during Manchester encoding. If LSB is 1, I will include a short reset-set signal at the end. I will make sure that I will ignore the rest of the data after I have received my required frame. Anyway, this short reset-set signal will not fall in my long or short range and I can also stop my timer to respond to any other interrupt after the required frame is received!

Question:

  1. Is it valid according to DALI standard?? What could go wrong with my approach?
  2. In general, which method is used for DALI standard? Sampling-based or pulse-width based??
  3. The lack of preamble, does it cause any problems?

Thanks in advance!

PS:

  • I am not sure of the terminology "Asynch data decoding", what I meant is that there is no preamble data involved giving the decoder enough time to sync!
  • Sampling-based [page 7], pulse-width based [page 6] methods are described in this app-note.
  • Image from this source.

EDIT: My logic of Manchester_Decoding is here.

EDIT2: enter image description here

Yeah! It is a clear misunderstanding, as soon as I put the logic on Paper, I got it figured! I was thinking how the last pulse will end if the SIGNAL is high for longer times but as we can see from the figure the last 1 will be decoded before itself.

Still, I wish to know about the general implementation standard for DALI and problems caused by lack of preamble data in DALI context.

Best Answer

There's no need for a preamble, this is a very simple protocol. There is a minimum time between frames which means you can very easily detect when the line is idle. Then, once the line goes low during idle time, you measure to make sure the line is high at 3/4T and you know you've had a start bit.

It's asynchronous because there is only a data line, not clock and data. That's nothing to do with DALI per se, that's just a standard communications term.

If you look at the Atmel apps note you referenced, it talks about two different ways of doing the decoding. Ensure your sampling time is quick enough for your chosen sample based method. Personally, I think the mixture of edge interrupts and timer interrupts is less of an overhead as you're not having so many timer interrupts to ensure your sampling time is fast enough. Which leads nicely on to...

..."how the standard does it". It doesn't specify how it is implemented, just that it must be done in a robust way to ensure it works under all circumstances.