TC input capture event polarity

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everybody!

 

TC input capture has a special feature, it can store “event polarity” with counter value. This can set by PER register B15 bit (set to 0).

But I do not found reference what is this event polarity.

 

For example if input pin changed form 0 to 1, then TC input capture event generated. But in this case CC register hold polarity 0 (old state) or polarity 1 (new state) together with counter value?

 

Other words the CC event carry the new polarity or the old polarity together with counter value?

 

Thanks for any advise.

This topic has a solution.
Last Edited: Sun. Jul 9, 2017 - 09:24 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From the XMEGA-AU Manual:

 

 

XMEGA AU Manual

Greg Muth

Portland, OR, US

Atmel Studio 7.0 on Windows 10

Xplained/Pro/Mini Boards mostly

 

 

Last Edited: Sun. Jul 2, 2017 - 10:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you.

 

But what does mean "polarity of the I/O pin edge"?

If 0->1 then 1. If 1->0 then 0?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kzsolt2 wrote:
If 0->1 then 1. If 1->0 then 0?

Don't the last two sentences of the quoted datasheet passage explain that?

 

[As I read it, it is "interesting" that the edge can only be determined if less than half of the capture register is exhausted.  So in a general case where you want to look at the edge, and the high bit is 1, how do you know whether that bit indicates the edge or the timer count value?]

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Wed. Jul 5, 2017 - 03:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry you are right, but the description need to cross-translate!

This mean: event store new status of input captured pin (if I understand well).  

 

About your question.

At setup the TC maximum value determined.

If it is more or equal than 0x8000, then CC (event) contain only the captured count value.

If it is less than 0x8000, then CC (event) contain captured count value and edge (new status of input captured pin).