|
|
View previous topic :: View next topic |
Author |
Message |
apollaa
Joined: 24 Jul 2007 Posts: 3
|
dali protocol interrupt routine. |
Posted: Fri Sep 03, 2010 8:35 am |
|
|
I want to design a receiver which is using dali communication protocol. But pic does not contain dali module. So I can not handle any data with dali hardware interrupt. I browsed some software about dali interrupt code (one or two internal or external interrupt combination was used) but I couldn't understand clearly.
Do you have any suggestion that how can I write a dali receive interrupt routine?
Thanks in advance for your help. |
|
|
apollaa
Joined: 24 Jul 2007 Posts: 3
|
|
Posted: Sat Sep 04, 2010 4:01 am |
|
|
does not anybody have a suggestion??? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19537
|
|
Posted: Sat Sep 04, 2010 4:24 am |
|
|
You cannot 'write interrupt routines', for something where the interrupt hardware is not present, so your question as posted, is basically 'unanswerable'. Hence the silence....
You could potentially write DALI receive routines (not interrupt routine), using
an edge interrupt to detect the first bit, then a timer interrupt to poll the bits. remember though you are going to have to start by receiving the data, and buffering it down to a voltage level that the PIC can handle. before this.
You would need to use a falling edge detection interrupt, and when this occurs, load the timer, with the value for 1/4 bit time. When the timer interrupts, sample the bit, and reload the timer with the value for 1/2 bit time. Whenever the falling edge interrupt triggers, again reload the 1/4 bit value. This keeps the sampling synchronized to the falling edges. If you get six successive timer interrupts without a falling edge, this is the end of packet marker. The value received, is determined by comparing successive half bit samples (Manchester encoding).
Routines for Manchester decoding have been published here, and one of these, might provide a starting point.
However I must admit, the last time I implemented DALI receive, I did it in a simple hardware gate array, so the processor didn't have to do anything. Examples of this are probably on the web.
Best Wishes |
|
|
apollaa
Joined: 24 Jul 2007 Posts: 3
|
|
Posted: Sat Sep 04, 2010 7:48 am |
|
|
Ttelmah wrote: | You cannot 'write interrupt routines', for something where the interrupt hardware is not present, so your question as posted, is basically 'unanswerable'. Hence the silence.... |
Yes l know cannot write. Actually l want to say some kind of "Software lnterrupt Routines or Interrupt combination (e.g. extInt+timerInt as you said)". l couldn't understand sampling with timer Int issue in example source codes that l browsed before. So your answer is enough for me in this respect.
Thanks for your help. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|