CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

dali protocol interrupt routine.

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
apollaa



Joined: 24 Jul 2007
Posts: 3

View user's profile Send private message

dali protocol interrupt routine.
PostPosted: Fri Sep 03, 2010 8:35 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Sep 04, 2010 4:01 am     Reply with quote

does not anybody have a suggestion???
Ttelmah



Joined: 11 Mar 2010
Posts: 19537

View user's profile Send private message

PostPosted: Sat Sep 04, 2010 4:24 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Sep 04, 2010 7:48 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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