TPM channel 1 Problem  - QG4

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TPM channel 1 Problem  - QG4

1,039 Views
Amey
Contributor I


Hello All,

I am using QG4 device in my Universal IR receiver project. During the learn mode i capture incoming waveform and write it to flash memory. In action mode i capture any incoming waveform; compare it with stored one, and if it is same as of learned one i toggle one port pin.

Since every protocol has different frame duration and repeatability i use one universal timeout;say 60msec.  I receive multiple frames of some protocols(SIRC) which has repeatabilty less than my timeout. I then sperate out one frame by finding TPMCNT larger than usual. e.g. 10msec(bcoz no protocol has pulse greater than 10msec duration). And if some protocols are having frame period greater than my timeout; i simply quit receiving(after reaching max space avlble to store periods).

Now the problem i am facing is very strange. I could receive almost all protocols correctly everytime. But receiving SIRC(which has repetablity after 25msec) is a problem. The protocol is received correctly after every alternate time.(e.g. Correct-Incorrect-Correct-Incorrect--so on). I saw in BDM; my TPM channel receives wrong values for alternate receptions(mostly for low to high INTR). And this happens with SIRC only every other protocol is receiving correctly.

kindly help
Thanks
Amey

Message Edited by NLFSJ on 2009-04-02 10:39 AM
Labels (1)
0 Kudos
2 Replies

334 Views
BV_BV
Contributor III

I just had to get an idea of SIRC.

I found something here: http://www.sbprojects.com/knowledge/ir/sirc.htm

 

It seems quite straightforward. 

You isolate positive pulses by doing (fall timestamp - rise timestamp)

Pulse > 2,4 ms ? Reset code

Pulse < 0,9 ms ? Write "0"

Pulse (>0,9 <1,5 ms) ? Write "1"

 

Got 12 bits ? Process them.

 

Be sure timer period is long, say 15ms

Message Edited by BV_BV on 2009-04-04 09:05 AM
Message Edited by BV_BV on 2009-04-04 09:06 AM
0 Kudos

334 Views
bigmac
Specialist III

Hello Amey,

 

I assume that you would be using a TPM channel, in input capture mode, to acquire the waveform timing.  Without seeing your code, there might potentially be problems in a number of areas.

 

Are you attempting to capture on either edge, or one edge at a time?  The latter method would be recommended for better control of the capture process.

 

What is the overflow period of the timer?  If any time interval should exceed this period, the coding will need to be significantly more complex to take this into account. Assuming that you store the results as a sequence of periods (in TPM clock cycles), see whether any of the longer delay periods is being interpreted as a much shorter period.

 

When you do a comparison of two sequences, there may be some mismatch, firstly by a capture measuremant uncertainty of one count for each time period within the protocol.  There will be additional uncertainty because the timing intervals associated with two different generating devices may exhibit differences, dependent on the specified timing tolerances for the particular IR protocol.  The timing of pulses may also be dependent, to some extent, on the level of signal reaching the IR receiver.  These uncertainties will need to be taken into account, if not already so.

 

Regards,

Mac

 

0 Kudos