PIC18F25J11-I/PT MICROCHIP [Microchip Technology], PIC18F25J11-I/PT Datasheet - Page 382
![no-image](/images/no-image-200.jpg)
PIC18F25J11-I/PT
Manufacturer Part Number
PIC18F25J11-I/PT
Description
28/44-Pin, Low-Power, High-Performance Microcontrollers with nanoWatt XLP Technology
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet
1.PIC18F25J11-IPT.pdf
(528 pages)
- Current page: 382 of 528
- Download datasheet (9Mb)
PIC18F46J11 FAMILY
EXAMPLE 24-4:
DS39932C-page 382
#include "p18cxxx.h"
#define COUNT 500
#define DELAY for(i=0;i<COUNT;i++)
#define OPENSW 1000
#define TRIP 300
#define HYST 65
#define PRESSED 1
#define UNPRESSED 0
int main(void)
{
}
unsigned int Vread;
unsigned int switchState;
int i;
//assume CTMU and A/D have been setup correctly
//see Example 25-1 for CTMU & A/D setup
setup();
CTMUCONHbits.CTMUEN = 1;
CTMUCONLbits.EDG1STAT = 0;
CTMUCONLbits.EDG2STAT = 0;
CTMUCONHbits.IDISSEN = 1;
DELAY;
CTMUCONHbits.IDISSEN = 0;
CTMUCONLbits.EDG1STAT = 1;
DELAY;
CTMUCONLbits.EDG1STAT = 0;
PIR1bits.ADIF = 0;
ADCON0bits.GO=1;
while(!PIR1bits.ADIF);
Vread = ADRES;
if(Vread < OPENSW - TRIP)
{
}
else if(Vread > OPENSW - TRIP + HYST)
{
}
switchState = PRESSED;
switchState = UNPRESSED;
ROUTINE FOR CAPACITIVE TOUCH SWITCH
//@ 8MHz = 125uS.
//Un-pressed switch value
//Difference between pressed
//and un-pressed switch
//amount to change
//from pressed to un-pressed
//storage for reading
// Enable the CTMU
// Set Edge status bits to zero
//drain charge on the circuit
//wait 125us
//end drain of circuit
//Begin charging the circuit
//using CTMU current source
//wait for 125us
//Stop charging circuit
//make sure A/D Int not set
//and begin A/D conv.
//Wait for A/D convert complete
//Get the value from the A/D
© 2009 Microchip Technology Inc.
Related parts for PIC18F25J11-I/PT
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![PIC18F2480](/images/no-image3.png)
Part Number:
Description:
28/40/44-Pin Enhanced Flash Microcontrollers with ECAN Technology, 10-Bit A/D and nanoWatt Technology
Manufacturer:
MICROCHIP [Microchip Technology]
Datasheet:
![PIC18F2682-I/PT](/images/no-image3.png)
Part Number:
Description:
28/40/44-Pin Enhanced Flash Microcontrollers with ECAN Technology, 10-Bit A/D and nanoWatt Technology
Manufacturer:
MICROCHIP [Microchip Technology]
Datasheet:
![MCP4024](/images/no-image3.png)
Part Number:
Description:
Low-Cost NV Digital POT with WiperLock™ Technology
Manufacturer:
MICROCHIP [Microchip Technology]
Datasheet:
![PIC12F1516](/images/no-image3.png)
Part Number:
Description:
28/40/44-Pin Flash Microcontrollers with nanoWatt XLP Technology
Manufacturer:
MICROCHIP [Microchip Technology]
Datasheet:
![PIC12F1822](/images/no-image3.png)
Part Number:
Description:
8/14-Pin Flash Microcontrollers with nanoWatt XLP Technology
Manufacturer:
MICROCHIP [Microchip Technology]
Datasheet:
![PIC12F1840](/images/no-image3.png)
Part Number:
Description:
8-Pin Flash Microcontrollers with nanoWatt XLP Technology
Manufacturer:
MICROCHIP [Microchip Technology]
Datasheet:
![PIC12F635-E/MD](/images/no-image3.png)
Part Number:
Description:
8/14-Pin, Flash-Based 8-Bit CMOS Microcontrollers with nanoWatt Technology
Manufacturer:
MICROCHIP [Microchip Technology]
Datasheet:
![PIC12F683-E/MD](/images/no-image3.png)
Part Number:
Description:
8-Pin Flash-Based, 8-Bit CMOS Microcontrollers with nanoWatt Technology
Manufacturer:
MICROCHIP [Microchip Technology]
Datasheet:
![TC1263](/images/no-image3.png)
Part Number:
Description:
500mA Fixed Output CMOS LDO with Shutdown
Manufacturer:
MICROCHIP [Microchip Technology]
Datasheet:
![TC1268](/images/no-image3.png)
Part Number:
Description:
500mA Fixed Output, Fast Response CMOS LDO with Shutdown
Manufacturer:
MICROCHIP [Microchip Technology]
Datasheet:
![TC4405](/images/no-image3.png)
Part Number:
Description:
1.5A Dual Open-Drain MOSFET Drivers
Manufacturer:
MICROCHIP [Microchip Technology]
Datasheet:
![TC4428](/images/no-image3.png)
Part Number:
Description:
1.5A DUAL HIGH-SPEED POWER MOSFET DRIVERS
Manufacturer:
MICROCHIP [Microchip Technology]
Datasheet:
![MCP41100](/images/no-image3.png)
Part Number:
Description:
Single/Dual Digital Potentiometer with SPI™ Interface
Manufacturer:
MICROCHIP [Microchip Technology]
Datasheet: