The Difference Between Period Versus Frequency Measurement In Cap Touch

Posted by admin on Aug 31, 2009 in Uncategorized |

In a relaxation oscillator based capacitive touch system, the capacitance shift due to the user’s touch results in a frequency shift in the output of the relaxation oscillator. The shift is converted into a digital value is one of two ways; either the period of the oscillation is measured, or the frequency of the oscillation is measured. Both use on-chip timer peripherals, and both can generate equivalent resolutions, but there are some significant differences.
Let’s start by examining both systems;
Period measurement uses the output of the relaxation oscillator as a clock source for the first timer in the system. A second 16-bit timer is clocked by a high speed clock source, and gated by the output from the first timer. The first timer counts off a preset number of cycles from the relaxation oscillator, and the second timer counts the number of high frequency clock cycles that occur during the first counters timeout.
For example, let’s assume that the relaxation oscillator is running around 200kHz. Further, let’s assume that the second 16-bit timer is running from a 1MHz clock source. So, to get .1% resolution on the period, the second timer will have to count at least 1000 cycles, and that means that the second timer will have to count down 200 counts of the 200 kHz clock source. 200 counts from a 200 kHz source takes 1 milli-second, and during 1 milli-second, the second counter running from 1 MHz will count 1000 counts.
The frequency based system uses the output of the relaxation oscillator as a clock source for the second 16-bit timer and a fixed clock source for the first timer. In this case, .1% resolution requires a count of 1000 clock cycles by the second timer. That requires 5 milli-seconds and the first timer will have to be configured to provide a timeout for the 5 milli-seconds sample period.
As you can see, the period measurement system has some pretty significant advantages for moderate to low frequency oscillators, 1 milli-second versus 5 milli-seconds to determine a value of the same resolution. While this may seem like a clear cut advantage, there are some tradeoffs involved; One, the period measurement system requires a high frequency clock to drive the second 16-bit timer, while the frequency measurement system only requires a 5 milli-second gating signal to make its measurement. Two, the size of the timer driven by the relaxation oscillator output will affect the amount of noise energy passed through the timer to the final digital output value.
The clock speed required is an important issue, if the current consumption of the system is to be minimized. The period measurement system requires a 1 MHz, or higher, clock to provide a good resolution at the higher conversion rate. The frequency measurement system only requires a 200Hz clock (5 milli-second). If the 200 Hz signal is generated by the system Watch Dog Timer (WDT), then the current consumption, for just the first timer, will be 2-3 orders a magnitude lower just because the clock is significantly lower. In addition, using the WDT allows the system to perform frequency measurements while the system is in sleep mode.
The noise attenuation of a timer is due to the averaging nature of the timer. If a clock has edge jitter, dividing the clock by 2 will retain the same absolute jitter, but the period of the clock is 2x the original, so the overall percentage phase noise, is ½. In the period measurement system the devisor is 200 and in the frequency measurement system the devisor is 1000, so the frequency measurement system has 5 times more averaging which will attenuate phase noise by 5:1 over the period measurement system.
This gives us the basic trade off between the two systems;
1. Period measurement is faster, for the same resolution.
2. Frequency measurement has better noise filtering characteristics, and it is significantly lower power.
Choosing between the two methods is then determined by the requirements of the system, either low power/noise or higher scan rated for more responsive buttons.

1 Comment


[...] Notes from the Lab » Blog Archive » The Difference Between Period Versus Frequency Measurement In … blog.notesfromthelab.com/?p=254 – view page – cached An embedded design discussion about human interface applications * Home * About * Bios — From the page [...]


 

Reply

You must be logged in to post a comment.

Copyright © 2010 Notes from the Lab All rights reserved. Theme by Laptop Geek.