|
|||
|
|
|||
|
From ww1.microchip.com
AN1103 Software Handling for Capacitive Sensing Initialization Author: Tom Perme Microchip Technology Inc. To begin, the hardware must be properly initialized. A detailed depiction of the proper settings for the PIC16F88X family is shown in Appendix A: “Register INTRODUCTION Settings for the PIC16F88X Family”. The different families of parts may have slightly different register This application note describes various ways of detect- setting values, but the key bits and signal paths are to ing button presses using capacitive sensing. It be set the same. Therefore, Appendix A: “Register assumes general knowledge of the sensing process, Settings for the PIC16F88X Family” may be used as and it is suggested that AN1101, “Introduction to a guideline for which bits to set in the other families of Capacitive Sensing” be read prior to this application parts where differences in registers occur. note in order to understand the hardware concepts. Below is a short checklist to ensure everything is set Some capacitive sensing solutions on the market offer properly: only a “black box” approach to capacitive sensing, where an IC is purchased and it signals button presses with • Port Direction and Analog/Digital Selection limited configurability. Microchip’s capacitive sensing • Oscillator Signal Paths Enabled solution offers the utmost in flexibility because the soft- • Enable Timers and Set Timer0 Prescalar ware routines to detect a button press can be completely • Enable Interrupts user-written. This is not to say the user must develop their own software routines as Microchip provides Servicing Interrupts capacitive sensing routines which may be used to get started immediately with your capacitive sensing The capacitive sensing is interrupt-based on the solution. Timer0 interrupt signaled by the flag, T0IF. The first thing the Interrupt Service Routine (ISR) should do is INTRODUCTION TO SOFTWARE check if the flagging interrupt is a Timer0 interrupt or another interrupt. If it is a Timer0 interrupt, then the All of the detection schemes described operate on the capacitive sensing must be serviced. same fundamental principle that a drop in frequency If another interrupt vectors program flow to the ISR, the count from the running average indicates a button ISR should service that interrupt, and at the end of the press. The basic physical process to scan buttons is to interrupt routine, it must check that Timer0 did not roll set an oscillator, sensitive to capacitance, to oscillate over during the ISR. If it did, the T0IF flag will be set, and on a button pad for a fixed time period. After the fixed the sample it represents should be assumed as bad. period, measure the frequency and check if the T0IF should then be cleared and the timers restarted to frequency is different than normal. Then, move the take another sample. The sample is bad because the oscillator to the next button pad to scan. Scanning fixed period for measurement, based on Timer0, numerous buttons is accomplished sequentially. becomes variable if not serviced immediately. There are two primary pieces of code which a user must The Products & Services
Fuses protect electrical devices and components from overcurrents and short circuits that occur in improperly operating circuits.
Charge and capacitive signal conditioning modules or systems amplify, attenuate, filter and/or convert a charge signal from an accelerometer, load cell, pressure transducer, displacement transducer or other type of capacitive sensor.
Coordinating measuring machine (CMM) probes are transducers that convert physical measurements into electrical signals, using various measuring systems within the probe structure.
Electrical capacitance sensors detect and measure capacitance, the charge storage capacity of an electronic component.
Capacitive linear position sensors are devices that sense position / displacement using capacitance technology.
Product Announcements
Topics of Interest
AN1104 Capacitive Multibutton Configurations inputs. The third approach creates an expandable Author: Keith Curtis system, which relies on multiplexing additional Microchip Technology Inc. sensors...
(Read More)
AN576 Techniques to Disable Global Interrupts ing this instruction, the program would complete execu- tion of this instruction, and then immediately branch to Author: Mark Palmer the user’s interrupt...
(Read More)
AN1081 Interfacing a 4x4 Matrix Keypad with an 8-Bit GPIO Expander • I/O Direction Register (IODIR): The IODIR Author: Mike Curran register controls the direction of the port pins. A Microchip...
(Read More)
AN1102 Layout and Physical Design Guidelines for Capacitive Sensing FIGURE 1: EXAMPLE PAD SIZES AND Author: Tom Perme SHAPE Microchip Technology Inc. 0.500 x 0.500 INTRODUCTION (12,7 x 12,7) This...
(Read More)
AN1101 Introduction to Capacitive Sensing A SHORT HISTORY Author: Tom Perme Microchip Technology Inc. While capacitive sensing has been around for more than 50 years, it is becoming increasingly...
(Read More)
Technical Articles
Software Handling for Capacitive Sensing
- Microprocessors and Microcontrollers
Use of Non-contact Thin Gap Sensors in Controlling Coater Gap Uniformity
- Linear Position Sensing
|
|