Electronic Components Datasheet Search
  New Zealand  ▼
ALLDATASHEET.CO.NZ

X  

AN1250 Datasheet(PDF) 5 Page - Microchip Technology

Part # AN1250
Description  Microchip CTMU for Capacitive Touch Applications
PDF  22 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

AN1250 Datasheet(HTML) 5 Page - Microchip Technology

  AN1250 Datasheet HTML 1Page - Microchip Technology AN1250 Datasheet HTML 2Page - Microchip Technology AN1250 Datasheet HTML 3Page - Microchip Technology AN1250 Datasheet HTML 4Page - Microchip Technology AN1250 Datasheet HTML 5Page - Microchip Technology AN1250 Datasheet HTML 6Page - Microchip Technology AN1250 Datasheet HTML 7Page - Microchip Technology AN1250 Datasheet HTML 8Page - Microchip Technology AN1250 Datasheet HTML 9Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 5 / 22 page
background image
© 2009 Microchip Technology Inc.
DS01250A-page 5
AN1250
EXAMPLE 2:
CTMU AND A/D CONVERTER SETUP FOR PIC18F
In the case of the PIDEM Touch Sense 2 Demo Board,
all 16 A/D channels are used for capacitive touch. Read-
ing of each of the sensor channels (A/D channels) is
controlled by Timer1. Timer1 is setup to fire at a 1 ms
interval. Each time that the Timer1 interrupt handler
runs, it increments the channel number of the A/D and
the capacitive sensor connected to that channel is read.
After all 16 touch sensors have been read, the Timer1
interrupt handler sets a flag called, “dataReadyCTMU”,
and the main routine uses this flag to know when to
process the new data just gathered from all 16 capacitive
touch sensors.
//setup CTMU
//CTMUCON
CTMUCONHbits.CTMUEN = 0;
//make sure CTMU is disabled
CTMUCONHbits.CTMUSIDL = 0;
//CTMU continues to run in idle mode
CTMUCONHbits.TGEN = 0;
//disable edge delay generation mode of the CTMU
CTMUCONHbits.EDGEN = 0;
//edges are blocked
CTMUCONHbits.EDGSEQEN = 0;
//edge sequence not needed
CTMUCONHbits.IDISSEN = 0;
//Do not ground the current source
CTMUCONHbits.CTTRIG = 0;
//Trigger Output is disabled
CTMUCONLbits.EDG2POL = 0;
CTMUCONLbits.EDG2SEL = 0x0;
//Edge2 Src = ECCP2 (don’t care)
CTMUCONLbits.EDG1POL = 1;
CTMUCONLbits.EDG1SEL = 0x1;
//Edge1 Src = ECCP1 pin (don’t care)
//CTMUICON
CTMUICON = 0x03;
//55uA
CTMUICON.ITRIM = 0;
//Nominal - No Adjustment
//setup A/D converter
ANCON0bits.PCFG = 0x00;
ANCON1 = 0x0000;
ADCON0bits.CHS = 0x00;
//select the analog channel 0
ADCON1bits.ADFM = 0x00;
//right justified result
ADCON1bits.ADON = 1;
//Turn On A/D
CTMUCONHbits.CTMUEN = 1;
//Enable CTMU



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com