DM163035+TEFLCST3 Microchip Technology, DM163035+TEFLCST3 Datasheet - Page 51

no-image

DM163035+TEFLCST3

Manufacturer Part Number
DM163035+TEFLCST3
Description
KIT, PICDEMLAB+FLOWCODE-HOME BUNDLE/
Manufacturer
Microchip Technology
Datasheet

Specifications of DM163035+TEFLCST3

Kit Contents
Component Kit, PICDEM Lab Development Board, PICkit 2 Programmer/ Debugger, CD Containing User Guide
Svhc
No SVHC (15-Dec-2010)
Development Tool Type
Hardware / Software - Dev
Silicon Manufacturer
Microchip
Core Architecture
PIC
Core Sub-architecture
PIC10, PIC12, PIC16
Silicon Core Number
PIC10F, PIC12F, PIC16F
Silicon Family Name
PIC10F2xx, PIC12F6xx, PIC16F6xx
Rohs Compliant
Yes
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
© 2009 Microchip Technology Inc.
Mechanical switches play an important and extensive role in practically every
computer, microprocessor and microcontroller application. Mechanical switches are
inexpensive, simple and reliable. However, switches can be very noisy electrically. The
apparent noise is caused by the closing and opening action that seldom results in a
clean electrical transition. The connection makes and breaks several, perhaps even
hundreds, of times before the final switch state settles. The problem is known as switch
bounce. This results in a period of time where the state of the I/O pin connected to the
push button will change states high/low numerous times before this bouncing subsides.
Some of the intermittent activity is due to the switch contacts actually bouncing off each
other. Also, switch contacts are not perfectly smooth. As the contacts move against
each other, the imperfections and impurities on the surfaces cause the electrical con-
nection to be interrupted. The result is switch bounce. The consequences of uncor-
rected switch bounce can range from being just annoying to catastrophic. The classic
solution involved filtering, such as through a resistor-capacitor circuit, or through
table
in material, installation and board real estate. Debouncing in software eliminates these
additional costs.
One of the simplest ways to debounce a switch is to sample the switch until the signal
is stable or continue to sample the signal until no more bounces are detected. How long
to continue sampling requires some investigation. However, 5mS is usually adequate,
while still reacting fast enough that the user won’t notice it.
As an example, in this application the pin connected to the push button is pulled low
using a 10 KΩ resistor tied to V
that the pin state will remain low whenever the push button is released, eliminating
state transitions due to noise. Once the push button is pressed, the pin is shorted to
V
bouncing at the push button to settle. After the delay, the firmware once again checks
the pin state. If the state is still high then a push button press is confirmed and the firm-
ware reacts accordingly. Otherwise, the push button is deemed “Not Pressed”.
2.4.4.3
1. Create a new project in Flowcode using steps 1 through 9 from GPIO_Lab1
2. Create the Initialize block using the Calculation component and create/ini-
3. Immediately following the Initialize block, add the loop component to
DD
saving the project as GPIO_Lab4.fcf in the
C:\PICDEM_Lab\flowcode\GPIO_Labs\GPIO_Lab4 directory.
tialize the LED_Output variable as per the previous labs initializing data to all
0’s (0b00000000). Create/initialize an additional 8-bit variable named direc-
tion to ‘0’ as well.
implement the Infinity loop discussed in the previous labs.
The flowchart should now resemble Figure 2-43.
resulting in a high state. The firmware then implements a 5 mS delay to give any
shift registers. These methods are still effective, but they involve additional cost
PROCEDURE
General Purpose Input/Output Labs
SS
(refer to Figure 2-42). The pull-down resistor ensures
DS41381A-page 47
reset-

Related parts for DM163035+TEFLCST3