240 likes | 331 Views
Overview of Charge Time Measurement Unit (CTMU). Agenda. What is CTMU? CTMU Features and applications How CTMU is used for Cap Touch Sensing Resources CTMU LAB. What is CTMU. CTMU stands for “Charge Time Measurement Unit” CTMU can be used for variety of applications:
E N D
Agenda • What is CTMU? • CTMU Features and applications • How CTMU is used for Cap Touch Sensing • Resources • CTMU LAB
What is CTMU • CTMU stands for “Charge Time Measurement Unit” CTMU can be used for variety of applications: • Capacitive Touch Sensing • Precise Time measurement • Time Domain Reflectometry (TDR) • Temperature measurement • Humidity measurement • Absolute and relative capacitance measurement
Key features of CTMU • Constant current source • Ranges: 0.55uA, 5.5uA and 55uA source • Trim-able up to +/- 62% on each range • Works in conjunction with ADC • High precision Time measurement asynchronous to the system clock • Triggered by external or internal sources • Timer1, output compare, software trigger • Rising Edge, Falling edge combination of one or two external pins • Precise time delay output
CTMUCON CTMUICON External Edge Trigger Pins Current Source CTMU Control Logic Edge Control Logic A/D Conversion Trigger Current Control Timer1 Pulse Generation Logic OC1 A/D Converter Comparator 2 Output CTMU Block Diagram Pulse Output Pin Comparator 2 Input
CTMU Current Source Trim-able current source Range : 0.55uA, 5.5uA and 55uA • Current Source • Trigger Starts/Stops Current Source Discharge CTMU To A/D Converter • Current Source charges: • Capacitive Touch circuitry • A/D Converter Cap
Current Source A/D Conversion Trigger CTMU CTMU Interface to ADC PIC A/D with CTMU Sensor 0 CA/D Sensor 15 A/D Converter
CTMUCON SFR Upper Byte Analog Current Source Control CTMU Enable CTMU In Idle mode Edge Enable Time Generation Enable Edge Sequence Enable Trigger Output Enable
CTMUCON SFR Lower Byte Edge 2 Polarity selection Edge2 Source select Edge 1 Polarity selection Edge 1 Source select Edge 2 Event Status Edge 1 Event Status
CTMUICON SFR Current source Trim bits +/- 62% Current source range selection 0.55uA, 5.5uA, 55uA Lower byte not used
CTMU for Cap Touch Application EE101 basics: • Instantaneous Current in a capacitor i = C · dV/dt • If i = constant current, thenI = C · V/t I · t = C · V • If I and t are held constant, as C increases, V must decrease
CF CP Capacitive Touch Theory • PCB pad is a sensor • Introduction of finger produces a parallel capacitance with PCB pad
CSW CF CTMU Touch Circuit Components V __ · I = C t Current Source Trigger CP = CAD + CCIR + CSW = 30pF CF = 7pF Discharge CTMU VAD CAD CCIR A/D Converter
· t I V ____ __ · I = C = V C t • I = 5.5µA • t = 10µS • CP = 30pF V = 1.833 • I = 5.5µA • t = 10µS • C = CP+ CF= 37pF V = 1.486 Sample Calculations When un touched When touched CP = CAD + CCIR + CSW = 30pF CF = 7pF
Five Basic Steps • Discharge Circuit to ensure a start from 0 Volts • Turn on Current Source to charge touch circuit • Wait for a fixed time period • Turn off Current Source to stop charging touch circuit • Perform A/D conversion to read voltage present on touch circuit
CTMU Full Waveform A/D Conversion End Charge Discharge Begin Charge
Untouched & Touched Not Touched Touched
PIC24F256GB110 Family - 16 Channels (12 parts) PIC24F256GA110 Family - 16 Channels (9 Parts) PIC18F45J11/J50 - 9 Channels More to follow in PIC24F and PIC18F families… New KA parts and low pin count J parts will have CTMU channels Parts with CTMU
PICDEM Touch Sense2 • mTouch Diagnostic GUI • For customizing the • Capacitive Touch Solution
Lab on CTMU What is already done: • CTMU is initialized • Key thresholds set • USB stack is added • GUI interface is in place
Lab on CTMU What you need to do: • Find where the CTMU channels are scanned • Enable the current source • Wait for 2uSec • Tip: Clock running at 32MHz, • Use NOPs or a delay loop • Turn off the current source • Trigger ADC to start conversion • Wait for ADC conversion to complete