DM164120-2 Microchip Technology, DM164120-2 Datasheet - Page 28

BOARD DEMO PICKIT 2 44PIN

DM164120-2

Manufacturer Part Number
DM164120-2
Description
BOARD DEMO PICKIT 2 44PIN
Manufacturer
Microchip Technology
Type
MCUr
Datasheets

Specifications of DM164120-2

Contents
3 Boards (1 Populated, 2 Bare)
Processor To Be Evaluated
PIC16F
Silicon Manufacturer
Microchip
Kit Contents
PIC16F Device, 2 PCB Boards
Features
Small Surface Mount Prototype Area, Two Bare PCB Boards
Development Tool Type
Hardware - Daughter Card
Rohs Compliant
Yes
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
PIC16F887
Lead Free Status / Rohs Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
DM164120-2
Manufacturer:
Microchip Technology
Quantity:
135
44-Pin Demo Board User’s Guide
DS41296B-page 24
One of the simplest ways to switch debounce 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, 5 mS is usually plenty
long, while still reacting fast enough that the user won’t notice it.
Lesson 6 shows how to sample the line at a 1 mS rate waiting for a number of sequen-
tial state changes, which is a simple matter of counting to 5, then resetting the counter
every time it’s still in the original unchanged state.
The Switch on the 44-Pin Demo Board doesn’t bounce much, but it is good practice to
debounce all switches in the system.
FIGURE 3-6:
3.2.7
Lesson 7 combines Lessons 5 and 6 using the button to reverse the direction of rotation
when the button is pressed and adjusting the potentiometer to control the speed of
rotation.
The program needs to keep track of rotation direction and new code needs to be added
to rotate in the other direction.
Lesson 5 rotates right and checks for a ‘1’ in the Carry bit to determine when to restart
the sequence. In Lesson 7, we’ll also need to rotate left and check for a ‘1’ in bit 7 of
the display. When the ‘1’ shows up in bit 7 of the display, insert it into the bit 0 position.
Lesson 7: Reversible Variable Speed Rotate
Increment Counter
Reset Counter
Change State
Is Counter = 5?
SIMPLE SWITCH DEBOUNCE PROGRAM FLOW
Yes
Yes
changed states?
Delay 1 mS
Switch has
No
Reset Counter
No
© 2007 Microchip Technology Inc.

Related parts for DM164120-2