PIC18F45K20-E/P Microchip Technology, PIC18F45K20-E/P Datasheet - Page 34

32KB, Flash, 1536bytes-RAM, 36I/O, 8-bit Family,nanowatt XLP 40 PDIP .600in TUBE

PIC18F45K20-E/P

Manufacturer Part Number
PIC18F45K20-E/P
Description
32KB, Flash, 1536bytes-RAM, 36I/O, 8-bit Family,nanowatt XLP 40 PDIP .600in TUBE
Manufacturer
Microchip Technology
Series
PIC® XLP™ 18Fr

Specifications of PIC18F45K20-E/P

Core Processor
PIC
Core Size
8-Bit
Speed
48MHz
Connectivity
I²C, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, HLVD, POR, PWM, WDT
Number Of I /o
35
Program Memory Size
32KB (16K x 16)
Program Memory Type
FLASH
Eeprom Size
256 x 8
Ram Size
1.5K x 8
Voltage - Supply (vcc/vdd)
1.8 V ~ 3.6 V
Data Converters
A/D 14x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 125°C
Package / Case
40-DIP (0.600", 15.24mm)
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With
DM240313 - BOARD DEMO 8BIT XLPAC164112 - VOLTAGE LIMITER MPLAB ICD2 VPPDM164124 - KIT STARTER FOR PIC18F4XK20
Lead Free Status / RoHS Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18F45K20-E/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
PICkit™ 3 Debug Express
DS41370C-page 30
3.4.2
Mechanical switches are frequently encountered in embedded processor applications,
and are inexpensive, simple and reliable. However, such switches are also often very
electrically noisy. This noise is known as switch bounce, whereby the connection
between the switch contacts makes and breaks several, perhaps even hundreds, of
times before settling to the final switch state. This can cause a single switch push to be
detected as several distinct switch pushes by a fast device, especially with an edge-
sensitive input. Think of advancing the TV channel, but instead of getting the next
channel, the selection skips ahead two or three.
Classic solutions to switch bounce involved filtering out the fast switch bounce
transitions with a resistor-capacitor circuit, or using re-settable logic shift registers.
While effective, these methods add additional cost and increase circuit board real
estate. Debouncing a switch in software eliminates these issues.
A simple way to debounce a switch is to sample the switch until the signal is stable.
How long to sample requires some investigation of the switch characteristics, but
usually 5ms is sufficiently long.
This lesson code demonstrates sampling the switch input every 1mS, waiting for 5
consecutive samples of the same value before determining that the switch was
pressed. Note that the switch on the 44-Pin Demo Board doesn’t bounce much, but it
is good practice to debounce all system switches.
FIGURE 3-21:
3.4.3
Open the lesson source code file 04 Switch Input.c in an editor window if it is not
open already.
Switch Debouncing
Exploring the Lesson 4 Source Code
SWITCH DEBOUNCING PROGRAM FLOW
© 2009 Microchip Technology Inc.

Related parts for PIC18F45K20-E/P