PIC18F27J53T-I/SO Microchip Technology, PIC18F27J53T-I/SO Datasheet - Page 434

no-image

PIC18F27J53T-I/SO

Manufacturer Part Number
PIC18F27J53T-I/SO
Description
28-pin, USB, 128KB Flash, 4KB RAM, 12 MIPS, 12-bit ADC, NanoWatt XLP 28 SOIC .30
Manufacturer
Microchip Technology
Series
PIC® XLP™ 18Fr
Datasheets

Specifications of PIC18F27J53T-I/SO

Core Processor
PIC
Core Size
8-Bit
Speed
48MHz
Connectivity
I²C, LIN, SPI, UART/USART, USB
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
22
Program Memory Size
128KB (64K x 16)
Program Memory Type
FLASH
Ram Size
3.8K x 8
Voltage - Supply (vcc/vdd)
2.15 V ~ 3.6 V
Data Converters
A/D 10x10b/12b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
*
Processor Series
PIC18F
Core
PIC
Data Bus Width
8 bit
Data Ram Size
3.8 KB
Interface Type
I2C, SPI, USART
Maximum Clock Frequency
48 MHz
Number Of Programmable I/os
16
Number Of Timers
8
Operating Supply Voltage
2.15 V to 3.6 V
Maximum Operating Temperature
+ 85 C
Mounting Style
SMD/SMT
Minimum Operating Temperature
- 40 C
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-
Lead Free Status / Rohs Status
 Details
PIC18F47J53 FAMILY
EXAMPLE 27-4:
DS39964B-page 434
#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
Preliminary
 2010 Microchip Technology Inc.

Related parts for PIC18F27J53T-I/SO