[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-690214-105":59,"doc-detail-690214-en":130,"doc-similar-690214":149},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","capacitive-multibutton-configurations-document-an1104","Capacitive Multibutton Configurations - Document AN1104","","Application note AN1104 explains how to scan and detect button presses using more than four capacitive touch buttons on Microchip PIC16F616, PIC16F690, and PIC16F887 microcontrollers. It reviews a baseline approach that multiplexes up to four buttons via on-chip 4-to-1 analog multiplexers feeding comparator inputs, then expands to ten sensors and an expandable design using an external analog multiplexer. Software guidance focuses on interrupt-driven measurement, per-button arrays for raw/averaged values, individual thresholds, and sensor-by-sensor channel switching.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/capacitive-multibutton-configurations-document-an1104/690214/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/capacitive-multibutton-configurations-document-an1104/690214.png","ImageObject",300,407,{"name":92,"@type":93},"Asher","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-18","2026-11-08",true,{"@type":102,"interactionType":103,"userInteractionCount":19},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"Which microcontroller families are targeted by AN1104?","Question",{"text":112,"@type":113},"The application note targets the PIC16F616 family, PIC16F690 family, and PIC16F887 family of microcontrollers.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How many capacitive buttons can the default multiplexed comparator approach scan?",{"text":117,"@type":113},"With comparator modules capable of capacitive sensing, the internal multiplexor can scan up to four buttons by selecting channels for the comparator inputs.",{"name":119,"@type":110,"acceptedAnswer":120},"What is the core timing mechanism for measuring and scanning buttons?",{"text":121,"@type":113},"A Timer0 overflow interrupt triggers the ISR to perform measurements when each button is ready, while the user may also handle other interrupts to coexist with the fixed Timer0 time base.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},690214,1794156662,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":19,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":52,"language":139,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":67,"update_tm":129,"read_time":143,"preview_page_count":8,"preview_urls":144},687197207639,"https://ap-avatar.wpscdn.com/davatar_a8503ba1806abce46bf441b54a3ca4cd","AN1104  \nCapacitive Multibutton Configurations  \nAuthor: Keith Curtis  \nMicrochip Technology Inc. Tom Perme  \nMicrochip Technology Inc.  \nINTRODUCTION  \nThis application note describes how to scan and detect button presses on more than 4 capacitive buttons. The target devices of this application note are the PIC16F616 family, PIC16F690 family and the PIC16F887 family of microcontrollers. It assumes knowledge of the general concept for capacitive sensing described in application note AN1101, “Introduction to Capacitive Sensing,”and it is recommended to have read AN1101 prior to this application note.  \nThis application note will discuss three different approaches to implementing multiple touch buttons using Microchip microcontrollers. The first approach creates a simple 4 sensor system using the on-chip 4-to-1 analog multiplexers tied to the inputs of the comparator module. The second approach expands the 4 sensor system of the first approach, into a 10 sensor system by combining pairs of the original 4  \ninputs. The third approach creates an expandable system, which relies on multiplexing additional sensors through an external analog multiplexer.  \nUSING DEFAULT CAPACITY  \nBy default, PIC® microcontrollers with a comparator module capable of capacitive sensing*, may use the internal multiplexor to the comparator inputs to scan up to four buttons. The internal MUX is controlled by the channel select bits, C1CH\u003C1:0> of CM1CON0 and C2CH\u003C1:0> of CM2CON0 . The channel must be set the same for both comparators.  \nA simplified block diagram from the data sheet for the PIC16F887 family is shown in Figure 1 . It depicts the proper paths required for capacitive sensing as highlighted. The channel of select must be the same on each interanl multiplexer. So, when switching buttons from one to the next, ensure that they are the same. They must be the same because the basic sensing oscillator circuit requires the voltage on the capacitor tobe compared to the upper and lower limit C1IN+ and C2IN+ . If the negative inputs were different, the circuit would not oscillate and would be stuck either high or low.  \nFIGURE 1: COMPARATOR C1 SIMPLIFIED BLOCK DIAGRAM  \n0  \nNote 1: When C1ON = 0 , the C1 comparator will produce a‘0’output to the XOR Gate.  \n2: Q1 and Q3 are phases of the four-phase system clock (FOSC) .  \nC1OUT  \nC1  \nC1IN+  \nFixedRef  \nCVREF  \nC1RSEL  \n1  \n C1OUT (to SR Latch)  \n0  \nMUX  \n1  \n3: Q1 is held high during Sleep mode.  \n* Comparator modules capable of touch sense as described must have the SR-latch option.  \n© 2007 Microchip Technology Inc. DS01104A-page 1  \nAN1104  \nFIGURE 2: COMPARATOR C2 SIMPLIFIED BLOCK DIAGRAM  \n\n| \u003Cbr>\u003Cbr>|\n| --- |\n| Note 1: When C1ON = 0 , the C2 comparator will produce a‘0’output to the XOR Gate.\u003Cbr>2: Q1 and Q3 are phases of the four-phase system clock (FOSC) .\u003Cbr>3: Q1 is held high during Sleep mode. |\n\nTo handle scanning four buttons is straightforward in software when using C code. It is easiest to handle the buttons’measured raw and average data as arrays, where each entry is a button’s value. It is also nice to have individual trip thresholds for each button, in the event different buttons behave differently. In plain C, these variables would be declared as follows:  \nunsigned int average [4];  \nunsigned int trip [4];  \nNote: A simple trip threshold will be assumed for purposes of discussion. Application note AN1103, “Software Handling of Capacitive Sensing,” contains more detail on various methods of detecting button presses. Averaging is fundamental to all methods.  \nThe array variable average holds the average values for each button, indexed 0 to 3. Likewise,the mostrecent reading may be stored in an array for viewing orto aid design, but this raw data does not need to be stored since it is measured at the end of a scan when a decision for pressed or not pressed is made in the Interrupt Service Routine (ISR) .  \nTo set the big picture before going into further detail, the basic operation is","cbCaikvv8bdiEpQf","https://ap.wps.com/l/cbCaikvv8bdiEpQf","pdf",340872,"English","# Introduction\n# Using default capacity\n# Software approach for multiple buttons\n# Example ISR workflow\n# Sensor indexing and comparator channel switching","[{\"question\":\"Which microcontroller families are targeted by AN1104?\",\"answer\":\"The application note targets the PIC16F616 family, PIC16F690 family, and PIC16F887 family of microcontrollers.\"},{\"question\":\"How many capacitive buttons can the default multiplexed comparator approach scan?\",\"answer\":\"With comparator modules capable of capacitive sensing, the internal multiplexor can scan up to four buttons by selecting channels for the comparator inputs.\"},{\"question\":\"What is the core timing mechanism for measuring and scanning buttons?\",\"answer\":\"A Timer0 overflow interrupt triggers the ISR to perform measurements when each button is ready, while the user may also handle other interrupts to coexist with the fixed Timer0 time base.\"}]","Capacitive Multibutton Configurations - Document AN1104 | PDF",25,[145],{"page_no":8,"url":146,"width":147,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/5e43c555c25d5b6682a5708ab76de3be.webp",983,1272,{"list":150,"token":66},[151,157,163,170,176,182,188,194,200,206],{"doc_id":152,"doc_title":153,"file_type":137,"home_preview_img_url":154,"slug":155,"view_count":19,"category_name":30,"create_tm":156},700158,"Cypress PSoC 4 Microcontrollers - Your Problem-Solver on Chip - Differentiation Dilemma","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012013507/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109779&Signature=szzzRUXxlfX5BGUzkpJk8jpTh78%3D","cypress-psoc-4-microcontrollers-your-problem-solver-on-chip-differentiation-dilemma",1794516276,{"doc_id":158,"doc_title":159,"file_type":137,"home_preview_img_url":160,"slug":161,"view_count":19,"category_name":30,"create_tm":162},720395,"ATmega16U4/ATmega32U4 - 8-bit Microcontroller Datasheet - USB Controller","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230023673509/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109779&Signature=u5LXf89ppne7jazXjlRdq7ie6to%3D","atmega16u4atmega32u4-8-bit-microcontroller-datasheet-usb-controller",1795037091,{"doc_id":164,"doc_title":165,"file_type":137,"home_preview_img_url":166,"slug":167,"view_count":168,"category_name":30,"create_tm":169},465496,"ADS111x Ultra-Small, Low-Power, I2C-Compatible, 860SPS, 16-Bit ADCs with Internal Reference, Oscillator, and Programmable Comparator - Data Sheet","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229926225729/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109779&Signature=0vNqa8%2BBXCiTbLRrettEaEXGdqk%3D","ads111x-ultra-small-low-power-i2c-compatible-860sps-16-bit-adcs-with-internal-reference-oscillator-and-programmable-comparator-data-sheet",12,1790769689,{"doc_id":171,"doc_title":172,"file_type":137,"home_preview_img_url":173,"slug":174,"view_count":39,"category_name":30,"create_tm":175},562524,"Capacitive Touch Sensor Design Guide - AN2934 - Application Note - Design Overview","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229947682994/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109779&Signature=Oj5%2BOtzta%2BxzSIQsNbWdpcst2s4%3D","capacitive-touch-sensor-design-guide-an2934-application-note-design-overview",1791808833,{"doc_id":177,"doc_title":178,"file_type":137,"home_preview_img_url":179,"slug":180,"view_count":29,"category_name":30,"create_tm":181},690268,"PSoC 4 - PSoC 4200M Datasheet - Overview","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002607525/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109779&Signature=u8j59oKYo7OU7G8Swh%2Ba1Mn%2Bs%2Bw%3D","psoc-4-psoc-4200m-datasheet-overview",1794160152,{"doc_id":183,"doc_title":184,"file_type":137,"home_preview_img_url":185,"slug":186,"view_count":34,"category_name":30,"create_tm":187},692058,"PSoC™ 4200M - Datasheet - English","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002893516/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109779&Signature=gv6hMhQzSQVv2Pgk0jKlkgxX4so%3D","psoc-4200m-datasheet-english",1794178064,{"doc_id":189,"doc_title":190,"file_type":137,"home_preview_img_url":191,"slug":192,"view_count":24,"category_name":30,"create_tm":193},700149,"CY8C40xx PSoC™ 4000S MCU - General description and Features","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012013366/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109779&Signature=Ae45%2Bh3cvtCz9xvgOXiUGNW3GBM%3D","cy8c40xx-psoc-4000s-mcu-general-description-and-features",1794516209,{"doc_id":195,"doc_title":196,"file_type":137,"home_preview_img_url":197,"slug":198,"view_count":34,"category_name":30,"create_tm":199},699736,"Analog and Interface Product Solutions - “Makes a Measurement” Function Pack Design Guide - Devices for use with Sensors","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011771785/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109779&Signature=HEHMsz8O3QxZgwon5X5S%2FMzWCVk%3D","analog-and-interface-product-solutions-makes-a-measurement-function-pack-design-guide-devices-for-use-with-sensors",1794493036,{"doc_id":201,"doc_title":202,"file_type":137,"home_preview_img_url":203,"slug":204,"view_count":52,"category_name":30,"create_tm":205},700197,"S124 Microcontroller Group - Datasheet - Rev.1.40","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012016722/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109779&Signature=nQe6vf5IHg3N%2BxY%2FgNxXvzzTCfg%3D","s124-microcontroller-group-datasheet-rev140",1794516763,{"doc_id":207,"doc_title":208,"file_type":137,"home_preview_img_url":209,"slug":210,"view_count":19,"category_name":30,"create_tm":211},690212,"74HC/HCT4067 - 16-Channel Analog Multiplexers/DeMultiplexers - Features","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002579466/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109779&Signature=gPKLcIhvPGEldWaYmRAdMoaYqg8%3D","74hchct4067-16-channel-analog-multiplexersdemultiplexers-features",1794156653]