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 support@ccsinfo.com

Measuring infrared pulses

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







Measuring infrared pulses
PostPosted: Wed Mar 26, 2003 2:51 am     Reply with quote

Hi there

I've seen the posting on "Measuring a pulse with 1us resolution", but Acetoel only want to measure one single pulse. I want to measure the successive pulses from the infrared reciever to decode the signal. Can somebody give me some direction how to do that. My infrared remote control transmits a signal with different pulse width indicating '0' or '1'. (Tested on digital scope)

Thanks
Willie
___________________________
This message was ported from CCS's old forum
Original Post ID: 13071
Tomi
Guest







Re: Measuring infrared pulses
PostPosted: Wed Mar 26, 2003 3:14 am     Reply with quote

Maybe you don't need to measure the pulse width. Just wait for a rising edge then wait [("0" pulse width + "1" pulse width)/2] time then check the input line. If it is (already) "0" then the bit is 0. If it is (still) "1" then the bit is 1.


:=Hi there
:=
:=I've seen the posting on "Measuring a pulse with 1us resolution", but Acetoel only want to measure one single pulse. I want to measure the successive pulses from the infrared reciever to decode the signal. Can somebody give me some direction how to do that. My infrared remote control transmits a signal with different pulse width indicating '0' or '1'. (Tested on digital scope)
:=
:=Thanks
:=Willie
___________________________
This message was ported from CCS's old forum
Original Post ID: 13072
Willie Erasmus
Guest







PostPosted: Wed Mar 26, 2003 3:45 am     Reply with quote

<font face="Courier New" size=-1></font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 13075
Sherpa Doug
Guest







Re: Measuring infrared pulses
PostPosted: Wed Mar 26, 2003 8:00 am     Reply with quote

Perhapse I can rephrase what Tomi said:
Let x be the length of a short pulse ("0").
Let y be the length of a long pulse ("1").
Assume pulses are active high.
1) Wait for the start of a pulse.
2) Wait (x+y)/2. By now a short pulse will have ended, but a long pulse will not have ended.
3) Test the input. If it is low it must have been a short pulse. If it is still high it must have been a long pulse.
4) Wait for the start of the next pulse....

SherpaDoug

:=Maybe you don't need to measure the pulse width. Just wait for a rising edge then wait [("0" pulse width + "1" pulse width)/2] time then check the input line. If it is (already) "0" then the bit is 0. If it is (still) "1" then the bit is 1.
:=
:=
:=:=Hi there
:=:=
:=:=I've seen the posting on "Measuring a pulse with 1us resolution", but Acetoel only want to measure one single pulse. I want to measure the successive pulses from the infrared reciever to decode the signal. Can somebody give me some direction how to do that. My infrared remote control transmits a signal with different pulse width indicating '0' or '1'. (Tested on digital scope)
:=:=
:=:=Thanks
:=:=Willie
___________________________
This message was ported from CCS's old forum
Original Post ID: 13085
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