I’m trying to capture hi low pulse timing & save them in a binary form.
I have attached my drawing that how the pulse streams are coming. In every stream the timing is T & 2T length of pulses.
If the high pulse is 2T then the binary must be 11
If the high pulse is T then the binary must be 1
If the low pulse is 2T then the binary must be 00
If the low pulse is T then the binary must be 0
I want to arrange like above format. Any idea how to do. No need code just tell me the idea. Do not suggest capture modules. Want to do it from a general I/O pin with a timer.
Seems simple.... Since T is the normL length the count every T if it's high the OR in a 1 and shift left if it's low AND in a 0 and shift left. If u do this in every T u will get everything correct
Hi for everybody thanks for the support you all giving.
The input pulses varying from 200uS to 2000uS.For example T=450uS,2T=900uS so the whole string goes with those two values.On next string it can start from T=550,2T=1100uS.
First you wait for a mark pulse.When mark pulse detected turn on the TMR0.Wait until space pulse & when space pulse detect save the "Mark_Time" & reset TMR0.Wait until next mark pulse,when next mark pulse save the "Space_Time".
Now we have two values."Mark_Time" & "Space_Time".
Now subtract “Mark_Time” from "Space_Time". Check the carry bit status & arrange the result registers. Likewise on every after Period subtract “Mark_Time” from "Space_Time & arrange the result registers.
The problem with my method is when both the mark & spaces equal the result will be wrong.
How many bits are involved in a transmission?
Is the line low between bytes/words?
Is there a change that signifies the start of a byte or could a zero (or two?) come first?
Does a byte/word always contain 00,11,01&10 sequences?
How many bits are involved in a transmission?
Is the line low between bytes/words?
Is there a change that signifies the start of a byte or could a zero (or two?) come first?
Does a byte/word always contain 00,11,01&10 sequences?
*Per transmission they are about 25-30 bits.
*Those are not bytes those are just high low pulses.
*The start of a string always 1(T) or 11(2T)
To detect end of the frame I'm checking the "space time" has gone above 2000uS.because the maximum T is 2000uS.So I can identify the frame is end or not.
Mike as you understand lets assume you get 2T “Mark Time” & a 2T “Space Time” on start of the frame. According to my method if I just subtract “Mark Time” from “Space Time” It will be “10” format. But it should be “1100”.Now see the error. I think you understood now.
I think you need to capture the whole data stream as a series of time values and look for the shortest pulse to work out the "baud" rate. If you are not guaranteed that the stream will contain a single T pulse then you will have to assume that the time for the shortest pulse that you received is a single T and see how many bits you have. If the bit count is less than 25 then recalculate with T=T/2.
I think you need to capture the whole data stream as a series of time values and look for the shortest pulse to work out the "baud" rate. If you are not guaranteed that the stream will contain a single T pulse then you will have to assume that the time for the shortest pulse that you received is a single T and see how many bits you have. If the bit count is less than 25 then recalculate with T=T/2.
I'm trying to make a universal Infrared Remote Decoder.I need to store particular remote incoming data & compares the same remote code is coming on next time.
I'm ignoring start bit & the first space time.After that only I'm capturing incoming data.If you study all remote codes based on T & 2T format.
Many will tell that you can't make a UIR decoder.But at least I can make a one working for many remotes but not for all.