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

Any way to generate an edge with zero latency on trigger?

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







Any way to generate an edge with zero latency on trigger?
PostPosted: Thu Feb 07, 2008 4:50 pm     Reply with quote

Hi all!

As far as I can see there is no way to generate a zero-latency rising or falling edge on a PIC's output pin when an external trigger edge arrives on another pin. Or am I wrong? If there is such a possibility e.g. on a dsPIC please let me know.
I am looking for something like the "zero-latency edge generation" from the CCP module when this is set to compare mode and the corresponding timer reaches a preset value.
If there is no such thing I will have to use an interrupt like int_ext but this means there will be some interrupt latency which can take some time on a PIC18. To measure this interrupt latency exactly I would trigger the CCP module in capture mode and catch the exact position of the timer when the trigger edge arrives. Then when I get into the CCP ISR I will compare the current timer value with the catched timer value. This way I can tell exactly how much time has passed since the external trigger edge arrived. Is this correct?

Best regards and thank you for any help,
Zer0flag
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Thu Feb 07, 2008 7:58 pm     Reply with quote

How about having a PIC pin run to an external AND gate that passes the input to the output when conditions merit?
_________________
The search for better is endless. Instead simply find very good and get the job done.
Zer0flag
Guest







PostPosted: Fri Feb 08, 2008 3:14 am     Reply with quote

Thank you. Actually I was thinking of something like that. I wanted to make sure that there is no PIC-internal way to do it.

SherpaDoug wrote:
How about having a PIC pin run to an external AND gate that passes the input to the output when conditions merit?
kolio



Joined: 06 Feb 2008
Posts: 26

View user's profile Send private message

PostPosted: Fri Feb 08, 2008 4:48 am     Reply with quote

What about using built-in comparator and its output?
Zer0flag
Guest







PostPosted: Sat Feb 09, 2008 4:24 am     Reply with quote

kolio wrote:
What about using built-in comparator and its output?


Thank you for the tip kolio! I will look at that possibility. On the other hand I think it is better to generate my rising edge outside of the PIC when my external trigger arrives and to use the capture module of the PIC to capture the timer value at this point in time. This way I will know exactly when the trigger has fired and will be able to use the compare module in order to generate the falling edge. So I should be able to generate a pulse with exact width.
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