roberto.m

TPM rising edge.

Discussion created by roberto.m on Mar 12, 2012
Latest reply on Mar 15, 2012 by bigmac

I'm using a qe32. I'm measuring a square wave, setting Tpm in input capture mode, rising edge. After i've the mean period, between two edge I disable the channel, just before the new edge I set up for rising edge. In this case I get an interrupt also froma a level and non only for an edge!

 

set off

                TPM1C0SC =  TPM1C0SC_CH0IE_MASK * 0 // disable interrupts
                                    | TPM1C0SC_MS0B_MASK  * 0 // MS=00
                                    | TPM1C0SC_MS0A_MASK  * 0
                                    | TPM1C0SC_ELS0B_MASK * 0 // pin general purpose
                                    | TPM1C0SC_ELS0A_MASK * 0;

 

set on

        TPM1C0SC = ((TPM1C0SC_CH0IE_MASK * 1) // enable interrupts
                       |( TPM1C0SC_MS0B_MASK * 0)  // MS=00 - input capture
                          |( TPM1C0SC_MS0A_MASK * 0)
                         |( TPM1C0SC_ELS0B_MASK * 0) // rising edge
                         |( TPM1C0SC_ELS0A_MASK * 1));

 

Where I'm wrong?

Thank you.

Outcomes