lcd display keypad free sample

The processors that power the Arduino development boards aren"t your granddad"s microcontrollers - they"ve got serious processing power and can be used to monitor and control many types of physical hardware and sensors simultaneously. The XOD graphical programming IDE for Arduino can simplify the task of rapid-prototyping hardware designs, but as a system grows in complexity there"s the issue of user control and information management - how to arrange information about the process being controlled for display and let the user control it in a logical manner. Dedicated buttons and switches work for simple projects but one soon runs out logical ways to arrange them (or places to put them on an enclosure.) Many designs use a display of some type to give this kind of feedback, even a microwave oven usually has a small screen that allows editing settings and entering cook times, and while too much "menu diving" to access obscure settings can compromise user experience, menu-driven interfaces are a fact of life for projects of all kinds.

Software frameworks for developing menu-based interfaces in C or C++ for microcontrollers often have a steep learning curve and can be difficult to make rapid design changes in, as often everything interacts with everything else. The goal of this project was to use the XOD graphical programming environment to provide the ability to rapidly prototype menu-driven interfaces for Arduino-compatible microcontroller projects using a drag-and-drop/WYSIWYG style of interface. The output and input parameters of the generated menu structure are modular and generic and should be able to be used with a wide variety of input sources (switches, buttons, encoders) and produces a sequence of plain text outputs which can be fed to a wide variety of XOD-supported display types, including multi-line text LCD modules as used in this example.

At the right of the patch editing screen in XOD are four nodes connected up in a descending fashion. From top to bottom there"s first an analog input-type node, which is selected to be connected to one the Arduino"s analog input ports. In my tests I"ve been using an Arduino Uno with an ATMega328 8 bit processor, with a 16x2 LCD/keypad shield connected on top of it. The keypad on the shield is connected via the shield pins to the Arduino"s "A0" analog input, and the hardware generates voltages of differing levels to signal to the Arduino which buttons on the pad are depressed.

Other than the "reset" button on the keypad which doesn"t interface to the Arduino sketch directly, this type of display shield provides four directional buttons - up, down, left, and right, a "select" button. The second node down fed by the analog input node contains code which reads the differing voltage levels and outputs pulse-type triggers depending on which button is pressed. A "timeout" input is provided so an XOD developer can adjust the debounce timeout of the LCD shield keypad to avoid false triggering, adjusted to a particular application"s button or switch type.

As currently implemented it accepts a single Number-type input which can be any parameter the user can change from an external control, say a potentiometer or dial on a control panel which represents some parameter that can be changed. When a given leaf-type menu is selected by the menu-controller receiving a pulse to its "Invoke" input, over in the menu tree to the left the node of the screen the user is currently looking at will output a pulse on its own output, and also send out a parameter change. There are also two String inputs which can be used to generate a splash screen on the display when the Arduino powers up.

Following that node is a stock 16x2 LCD controller module from the XOD environment standard library, but any type of display that a module is available for can be used to display the output text here.

Selecting "invoke" when a "branch"-type menu is displayed descends into its associated sub menu group, rather than generating an output as a leaf-type menu does. Sub-sub menus, sub-sub-sub menus, etc. are possible! Complex structures can be implemented, limited primarily by the available RAM and Flash memory resources of a particular Arduino model"s processor.

Four-line displays are supported by the menu controller node but the leaf-type menu interface with four lines of text input hasn"t been written, yet. A good amount of effort has been put into reducing the memory overhead of this utility but the way the XOD transpiler currently stores constant strings isn"t optimal for very low RAM overhead, and menu-based interfaces tend to have a lot of text. For this project a work-around was developed and a set of flash-string type nodes added in the patch to ensure longer strings did not consume precious program RAM.

The "ID" input of leaf and branch nodes doesn"t have a function, yet. The thought is it would be good for each set of sub-menus to have associated ID numbers arranged in order so the user can keep track of their position in a set of displays but it will require some more thought on how to code this in C++ to happen automatically.

lcd display keypad free sample

You may have used an electronic device with a small Liquid Crystal Display (LCD) which has a textual hierarchical menu system for setting device configuration parameters. If you have tried writing menu code for your Arduino projects, you will recognise the challenge in developing a generic menu system for an open prototyping platform. This is because there are many input and display devices available, and a generic menu system must be independent of whichever input and display devices you wish to use. With our Arduino menu library, this independence is achieved by having the menu manager code use callback methods for handling user input and rendering the menu display.

To keep things simple, all coding examples have been targeted to work with an R3 Arduino Uno/Leonardo/Mega2560, and an LCD keypad shield similar to one illustrated above. There are numerous manufacturers of LCD keypad shields that have the same or similar pin connections, and you must ensure that the sample menu code uses the pin connections that are right for your shield. If the keypad buttons of your shield give different analog readings, you’ll need to make changes to file LcdKeypad.h. Bear in mind that the analog readings are not always consistent, which can lead to the occasional misreporting of a button press. Once you become familiar with the menu library, adapting it for use with other input and display devices should be straight-forward.

You can use the downloaded sample Arduino project as a starting point for your own coding requirements. You will need to write your own code in the body of method processMenuCommand(byte cmdId) to determine what must be done when a menu item is selected. The cmdId parameter is the Id you associate with a menu item in your menu Xml file. Callback method getNavAction() handles user input, and callback method refreshMenuDisplay(byte refreshMode) renders the menu. To work with other input and display devices you’ll need to re-write the code in these methods. Some LCD keypad shields are not suited for hardware PWM backlight control, and as such the coding example uses a soft PWM alternative.

The Select button on the LCD shield starts/stops a timer, with a long press resetting the timer. A long press of Up enters the menu. Up/Down/Right buttons are for navigating the menu, and Select for choosing a menu item. When an item is selected, Up/Down are used for changing values. When the Reset menu item is displayed, a long press of Select loads default configuration values. Digital pin 2 is used for activating a beeper for the alarm. Examining the source should give you good insight for using the menu system in your own projects. If you find this Arduino menu library guide useful, please share it.

lcd display keypad free sample

The 16x2 LCD And Keypad Shield is very simple to use because it"s fully compatible with the Arduino "LiquidCrystal" library. You can initialise the LCD and display messages on it with just a few lines of code, but it also gives you the flexibility to do more advanced projects such as display menu items and select them using the buttons.

The LCD & Keypad Shield requires a good 5V power supply to ensure the backlight fully illuminates and the display contrast is high, and if you power your Arduino from USB with the LCD Shield attached you may experience a voltage drop over the USB cable. If you have trouble with display contrast or backlight brightness, try attaching a power supply of around 7 to 9Vdc to the 2.1mm DC jack on the Arduino. A typical symptom in an undervoltage situation is that one line of the LCD will show pale rectangles in place of the characters, and the other line will show nothing at all. The Arduino may even continue running normally because it"s quite happy at just 4V or so, but the LCD & Keypad Shield won"t function.

All the hard work of interfacing with the LCD Shield is handled by the LiquidCrystal library, which is included as part of the official Arduino distribution. You can check whether you have it installed by starting up the IDE and looking under Files -> Examples -> LiquidCrystal. If it exists, you"re good to go.

The LCD Shield includes 5 buttons designed for use as navigational or control input. The buttons are arranged in a handy pattern and referred to as UP, DOWN, LEFT, RIGHT, and SELECT, but of course it"s totally up to your sketch to decide what to do when any particular button is pressed.

The extensive example below combines a number of techniques to demonstrate how to show messages on the LCD, read from the buttons, and change the display message depending on which buttons are pressed.

lcd display keypad free sample

In this case, D500 is the MRR that the OIT has been configured to poll once every 200 milliseconds. When input coil X1 is activated, the controller puts the decimal number 30 into the MRR. The OIT then sees the number 30 in the MRR and Displays Screen #30

Maple Systems OITs can be programmed to send the number representing the screen currently Displayed on the OIT to a register in the controller called the Current Message Register (CMR). The CMR can be used by the controller to determine which screen is currently being Displayed on the OIT, whether Displayed due to MRR, Set Point Limit, Function Key, etc. This might be used to determine which screen an OIT operator sees in a chained sequence.

Clear Alarm is monitored by the OIT to allow the controller to clear the currently Displayed alarm. When the controller sets this coil, the OIT cancels the alarm in progress.

The controller"s discrete and register memory can be monitored, Displayed, and updated by the OIT. This can be done by configuring the OIT"s screens to Display the controller"s discrete and register memory as embedded data fields (register monitors). When the OIT Displays a screen containing a register monitor, the OIT reads the specified memory address in the controller and then Displays the data. If the register monitor has been configured as read/write, when the operator changes the data in the register monitor on the OIT"s Display, the OIT writes the change to the controller"s memory.

lcd display keypad free sample

Honeywell’s 6150RF keypad Fixed Language Integrated Keypad/Transceiver is a wireless technology to any installation which offers the unbeatable combination of attractive, convenient features and competitive value in a single, quick-install package.

lcd display keypad free sample

2-line LCD display with up to 32 character point, user, and area namesSimple menu-style user interface with dedicated function buttons for common commands, including status indicationSituation sensitive on-screen help makes system operation simple and easyHighly visible on (arm)/alarm, ready to turn on (arm), power and gas alarm indicatorsSimple installation with self-locking base and chassis design, plus built-in bubble level

Provides up to 48 points using a combination of hardwired or wireless points for installation flexibility and up to 4 areas with perimeter and interior controlOn-board Ethernet port for Conettix IP alarm communication and remote programming, compatible with modern IP networks including IPv6/IPv4, Auto-IP, and Universal Plug and PlayInstaller-friendly features for simple installation and communications, including plug-in PSTN and cellular communication modulesProgrammable keypad shortcuts, situation sensitive on-screen help, and a bilingual user interface make system operation simple and easy

2-line LCD displayArm/ready to arm, all/part, trouble, and power status indicatorsSeparate mounting plate base and chassis designAvailable with English function keys or icon function keys

Color graphic touch screen display uses a combination of simple icons and text for easy operationBuilt-in presence detector lights the display when user approaches keypadBuilt-in proximity reader allows use of a token or card as replacement for a passcode, or for use with dual authentication for high security areasFour inputs and one output provide cost effective expansionSlim, modern design blends with any decor

Fire keypad with fire function keys: ACK, SILENCE, RESET, and DRILL2-line LCD display with up to 32 character point, user, and area namesSimple menu-style user interface with dedicated function buttons for common commands, including status indicationQuickly identifiable, visual indicators for critical system statusesSimple installation with self-locking base and chassis design, plus built-in bubble level

lcd display keypad free sample

The BOOSTXL-CAPKEYPAD is an easy-to-use evaluation module (EVM) for the MSP430FR2522 capacitive touch sensing microcontroller (MCU) with CapTIvate technology. The BOOSTXL-CAPKEYPAD enables you to extend your LaunchPad design by adding a 12-key capacitive touch numeric keypad with LED backlighting and proximity wake-up. Don’t have a LaunchPad? The BOOSTXL-CAPKEYPAD may be used as a simple CapTIvate technology evaluation module when coupled with the CAPTIVATE-PGMR for interfacing to a host PC running the CapTIvate Design Center. It is even possible to bypass the onboard keypad and connect up to 3 external capacitive sensors to the BOOSTXL-CAPKEYPAD to test out your own sensor design concepts.

Out of the box, the BOOSTXL-CAPKEYPAD powers up as a 12-key numeric keypad capacitive touch interface with proximity wake-up. The status of the keypad may be easily read by a host LaunchPad via a 3-pin I2C-bus interface (SDA, SCL, and IRQ). In addition to the host I2C interface, sensor data streaming is enabled out of the box to the CapTIvate Design Center via the UART interface in the 20-pin CapTIvate programming connector. The BOOSTXL-CAPKEYPAD may also be programmed and debugged via the 20-pin CapTIvate programming connector and the use of a CAPTIVATE-PGMR module.

Power selection jumper for external current measurement or current measurement using EnergyTrace technology. For EnergyTrace support, the BOOSTXL-CAPKEYPAD must be used with a CAPTIVATE-PGMR module.

The following software examples are available to run on a variety of host LaunchPads, demonstrating how the BOOSTXL-CAPKEYPAD could be used to extend a LaunchPad design by adding keypad functionality.

Connect the BOOSTXL-CAPKEYPAD to a CAPTIVATE-PGMR module via the 20-pin programming interface connector at the top of the BOOSTXL-CAPKEYPAD, as shown below. Then, connect the CAPTIVATE-PGMR to a host computer with a micro-USB cable. When the board combo is connected to the host computer, the power-good LED should be lit, and the enumeration LED should be blinking. When communication activity is occurring, the red communications LED will illuminate.

With the BOOSTXL-CAPKEYPAD powered up, bring your hand close the BOOSTXL-CAPKEYPAD touch panel. The buttons should transition from dark to illuminated as shown. When you remove your hand from the keypad area, the keypad will time out after a period of inactivity and return to the wake-on-proximity mode. At that point, the LED backlighting will fade off. The AWAKE status LED on the BOOSTXL-CAPKEYPAD will also illuminate when the board is running in active mode.

The wake-on-proximity functionality allows for power savings when the keypad is not used. The electrodes are not lit when no one is near the electrodes, and only the proximity sensor is scanned. When a user is detected close to the panel, all touch electrodes become active.

The BOOSTXL-CAPKEYPAD will pass individual touches on electrodes, but it rejects a palm across the keypad. this feature enables the touch panel area to be cleaned while powered up, without reporting invalid touches. To test this feature, place a palm across the keypad, and note that the DETECT LED does not illuminate.

With the BOOSTXL-CAPKEYPAD and CAPTIVATE-PGMR assembly connected to the host computer via USB, select Communications -> Connect from the menu bar in CapTIvate Design Center to enable target communications. At this point, when you touch a button, the button status is reflected in the CapTIvate Design Center.

Open the keypadSensor customizer by double-clicking the keypadSensor icon on the canvas. The Channel Bar Chart view will open by default. Touch any of the keys on the BOOSTXL-CAPKEYPAD to view the response in the customizer. All sensors on the BOOSTXL-CAPKEYPAD are mutual capacitance sensors. This means that touching a sensor reduces the capacitance of the electrode, causing the conversion result (in charge transfer counts) to increase. The capture below shows the response on button 1 when it is pressed. The default Channel Bar Chart tab is ideal for examining threshold levels.

Close the keypadSensor customizer, and open the proximitySensor customizer by double-clicking it. Then, bring a hand near the keypad area and observe the proximity sensing response. Note that the response increases rapidly as the distance between the hand and the keypad area is reduced. The proximity sensor also doubles as a guard channel. The prox threshold (drawn in orange in the CapTIvate Design Center) is used as the wake-up threshold. The touch threshold (drawn in green) is used as the guard channel threshold. The guard channel is used as a mask to prevent false touch detections from a palm resting on the keypad or a cloth wiping down the keypad.

Before connecting the LaunchPad to the BoosterPack, it is good practice to program it first to ensure that there are no IO assignment conflicts. The LaunchPad software example is stored in the CapTIvate Design Center workspace in the BOOSTXL-CAPKEYPAD project directory. Within the BOOSTXL-CAPKEYPAD project directory, there is a sub folder named hostmcu_demo_src. This contains the LaunchPad example projects. For this demo, the host project is MSP-EXP430FR6989_KeypadHostDemo_SEGLCD. If you are using the default installation directories, this location would be as follows:

C:/Users/USERNAME/CapTIvateDesignCenter_X_XX_XX_XX/CapTIvateDesignCenterWorkspace/BOOSTXL-CAPKEYPAD/hostmcu_demo_src/MSP-EXP430FR6989_KeypadHostDemo_SEGLCD

Next, disconnect the LaunchPad from the USB cable in order to remove power. Then, connect the LaunchPad to the BOOSTXL-CAPKEYPAD to create a 2-board stack, as shown below. This uses headers J1-J4 on the BOOSTXL-CAPKEYPAD, as well as J1-J4 on the LaunchPad. The assembled stack is shown below.

Reconnect power to the LaunchPad by reconnecting the USB cable. Then, touch any of the buttons on the BOOSTXL-CAPKEYPAD to see the keystrokes logged onto the LCD. Up to 6 keystrokes may be entered at a time. Touching the enter or cancel keys displays enter or cancel on the LCD display, respectively. If the keypad is not touched for a period of time, it will shut down into is wake-on-proximity mode, and the LCD display will clear.

If the BoosterPack is not responsive after providing power, it may not have the default BOOSTXL-CAPKEYPAD-Demo software programmed on it. This can happen if it was reprogrammed with a different application at some point. If you experience this issue, ensure that the correct demo software is programmed to the BOOSTXL-CAPKEYPAD. Programming the BOOSTXL-CAPKEYPAD requires the use of a CAPTIVATE-PGMR module.

This example demonstrates how to mate the BOOSTXL-CAPKEYPAD to an MSP-EXP430F5529LP LaunchPad as well as a BOOSTXL-K350QVG-S1 3.5” 320x240 QVGA LCD display panel.

Before connecting the LaunchPad to the BoosterPack, it is good practice to program it first to ensure that there are no IO assignment conflicts. The LaunchPad software example is stored in the CapTIvate Design Center workspace in the BOOSTXL-CAPKEYPAD project directory. Within the BOOSTXL-CAPKEYPAD project directory, there is a sub folder named hostmcu_demo_src. This contains the LaunchPad example projects. For this demo, the host project is MSP-EXP430F5529LP_KeypadHostDemo_QVGA. If you are using the default installation directories, this location would be as follows:

C:/Users/USERNAME/CapTIvateDesignCenter_X_XX_XX_XX/CapTIvateDesignCenterWorkspace/BOOSTXL-CAPKEYPAD/hostmcu_demo_src/MSP-EXP430F5529LP_KeypadHostDemo_QVGA

Next, disconnect the LaunchPad from the USB cable in order to remove power. Then, connect the LaunchPad to the top of the BOOSTXL-CAPKEYPAD to create a 2-board stack. This uses headers J1-J4 on the BOOSTXL-CAPKEYPAD, as well as J1-J4 on the LaunchPad. Once the keypad and LaunchPad are connected, attach the QVGA LCD BoosterPack on top of the LaunchPad, creating a 3-board stack. The assembled stack is shown below.

Reconnect power to the LaunchPad by reconnecting the USB cable. Then, touch any of the buttons on the BOOSTXL-CAPKEYPAD to see the keystrokes logged onto the LCD!

If the BoosterPack is not responsive after providing power, it may not have the default BOOSTXL-CAPKEYPAD-Demo software programmed on it. This can happen if it was reprogrammed with a different application at some point. If you experience this issue, ensure that the correct demo software is programmed to the BOOSTXL-CAPKEYPAD. Programming the BOOSTXL-CAPKEYPAD requires the use of a CAPTIVATE-PGMR module.

This example demonstrates how to mate the BOOSTXL-CAPKEYPAD to an MSP-EXP430F5529LP LaunchPad in order to implement a 12-key numeric keypad with USB HID connectivity. The final completed BOOSTXL-CAPKEYPAD + MSP-ESP430F5529LP stack will enumerate on a host computer as a USB keyboard. Then, you can use the BOOSTXL-CAPKEYPAD to enter numbers into any running application on your host computer that takes keystrokes.

Before connecting the LaunchPad to the BoosterPack, it is good practice to program it first to ensure that there are no IO assignment conflicts. The LaunchPad software example is stored in the CapTIvate Design Center workspace in the BOOSTXL-CAPKEYPAD project directory. Within the BOOSTXL-CAPKEYPAD project directory, there is a sub folder named hostmcu_demo_src. This contains the LaunchPad example projects. For this demo, the host project is MSP-EXP430F5529LP_KeypadHostDemo_USBNumPad. If you are using the default installation directories, this location would be as follows:

C:/Users/USERNAME/CapTIvateDesignCenter_X_XX_XX_XX/CapTIvateDesignCenterWorkspace/BOOSTXL-CAPKEYPAD/hostmcu_demo_src/MSP-EXP430F5529LP_KeypadHostDemo_USBNumPad

Next, disconnect the LaunchPad from the USB cable in order to remove power. Then, connect the LaunchPad to the top of the BOOSTXL-CAPKEYPAD to create a 2-board stack. This uses headers J1-J4 on the BOOSTXL-CAPKEYPAD, as well as J1-J4 on the LaunchPad.

Reconnect power to the LaunchPad by reconnecting the USB cable. Then, touch any of the buttons on the BOOSTXL-CAPKEYPAD to see the keystrokes logged on a running computer. To prevent corruption of any open documents, it’s a good idea to open up a blank text editor such as Notepad before running this demo. That way, test keystrokes from the BoosterPack go into Notepad and not into any other open files!

If the system is not responsive after providing power, it may not have the default BOOSTXL-CAPKEYPAD-Demo software programmed on it. This can happen if it was reprogrammed with a different application at some point. If you experience this issue, ensure that the correct demo software is programmed to the BOOSTXL-CAPKEYPAD. Programming the BOOSTXL-CAPKEYPAD requires the use of a CAPTIVATE-PGMR module.

The BOOSTXL-CAPKEYPAD hardware contains many connection options to enable various LaunchPad use-cases and CapTIvate evaluation use-cases. This section describes hardware configuration.

The BOOSTXL-CAPKEYPAD consists of a 4-layer, 1.6mm thick FR4 printed circuit board with a 3mm acrylic overlay material bonded to the PCB using 3M 467MP adhesive. The 3mm overlay represents a typical product overlay thickness. LED illumination is provided from the bottom side of the board through LED through holes in the PCB. Graphics are applied in between the PCB and the acrylic overlay.

The BOOSTXL-CAPKEYPAD features 40-pin BoosterPack standard headers (J1-J4). These headers are top-side only, meaning that the BOOSTXL-CAPKEYPAD is intended to be used at the bottom of a LaunchPad stack. This allows LCD displays on LaunchPads to be visible while using the keypad. The BoosterPack header pinout is shown below.

When powering the BOOSTXL-CAPKEYPAD from a CAPTIVATE-PGMR module via header J5, it is possible to use either a clean LDO-regulated supply or the EnergyTrace supply for measuring supply current from Code Composer Studio. The default position is the LDO-regulated supply. To use the EnergyTrace supply, move jumper J8 to the ‘ET’ position. This jumper has no effect when a LaunchPad is connected instead of a CAPTIVATE-PGMR module. In that case, the LaunchPad supplies V+ directly via pin 1 of J1 (the BoosterPack supply point).

This section describes the software examples that are available for the BOOSTXL-CAPKEYPAD. In the case of this BoosterPack, these software examples run on the MSP430FR2522 device that exists on the BOOSTXL-CAPKEYPAD itself. This is different from other BoosterPacks, where the software examples are for a host LaunchPad MCU only. Several host LaunchPad software examples are also provided for use with the BOOSTXL-CAPKEYPAD-Demo project. See the Getting Started section for more information on the available host LaunchPad demonstrations.

Import, build, and program the specific example that you are using onto the MSP430FR2522 target MCU on the BOOSTXL-CAPKEYPAD module. Follow these steps to load and run generated firmware projects. Example project locations are described below. The BOOSTXL-CAPKEYPAD module ships pre-programmed for the BOOSTXL-CAPKEYPAD-Demo software example.

During the CapTIvate™ Design Center installation process, example CapTIvate Design Center projects and BOOSTXL-CAPKEYPAD MSP430FR2522 firmware projects are placed in the user’s home directory under “CaptivateDesignCenter/CaptivateDesignCenterWorkspace”. On Windows 7, this would be:

The BOOSTXL-CAPKEYPAD project is the out-of-box demonstration software project. This is the software that comes pre-programmed from TI on the BOOSTXL-CAPKEYPAD. It is also the software that enables the LED backlighting features and I2C slave host processor interface.

The sensor configuration for the out-of-box experience described here. The MSP430FR2522 target MCU has 8 touch sensing IOs. 5 are used as RX’s, and the remaining 3 are used as TX’s. The keypad sensor is implemented as a 4 RX x 3 TX mutual capacitance matrix. The proximity and guard channel utilizes a dedicated RX channel, but it re-purposes the three TX channels from the keypad electrodes and merges them to act as one large TX when in proximity/guard mode. The TX timing is shown in the figure below.

The current operating state is determined by the 3 control bits in the system control word (managed by the host LaunchPad over I2C), as well as the current status of the keypad. The BOOSTXL-CAPKEYPAD will power up in active mode, scanning all electrodes, with LED backlighting on. If no touch is detected within 300 samples (4-5 seconds typical) then wake-on-proximity mode will be entered. If a proximity event is detected, then the system will revert back to active mode automatically. Shutdown mode is only entered or existed if a host MCU manipulates the shutdown bit in the system control word.

The BOOSTXL-CAPKEYPAD-EMC software example implements a noise-tolerant 12-key numeric keypad by configuring the CapTIvate software library to utilize its noise immunity features. When running this software example, the BOOSTXL-CAPKEYPAD can pass an IEC 61000-4-6 conducted noise immunity test at stress level 2 (3Vrms) with noise coupled directly into the DC power supply.

The keypad consists of a 4-RX, 3-TX mutual capacitance matrix. Two buttons are measured at a time (in parallel), thus a total of 6 measurement slots are needed. For each measurement slot, the electrodes are measured at 4 different conversion frequencies 2 different times, for a total of 8 conversions per measurement slot. Thus, the actual number of conversion measurement slots that run per refresh is 48. This can be seen in the logic capture below.

As can be seen in the figures above, the total conversion and post-processing time for all 12 keys in the keypad is 15-16ms. Thus, as scanning window of 20ms is selected to leave 4ms-5ms of reserve time for handing deviations in measurement time due to temperature shifts and touch events.

The BOOSTXL-CAPKEYPAD-Prototyping software example provides a way to “wire in” prototype sensors that were created externally. This enables copper-tape prototyping for up to 3 electrodes.

The BOOSTXL-CAPKEYPAD-Demo firmware that is pre-programmed on the BOOSTXL-CAPKEYPAD from the factory provides an I2C slave interface composed of an SDA (data) pin, SCL (clock) pin, and IRQ (interrupt) pin. All three pins are open-drain type signals at V+ logic level (3.3V typical). The purpose of this I2C interface is enabling low power communication with a host LaunchPad MCU. At power-up, the BOOSTXL-CAPKEYPAD-Demo example provides a simple register-based I2C interface that enables a host processor to read the current status of the keypad. It also provides some control to the LaunchPad to be able to manipulate the configuration of the keypad to optimize for response time or low power. The accessible registers are described below.

The shutdown bit resets to 0 at power-up. Setting the shutdown bit places the BOOSTXL-CAPKEYPAD into its lowest power state. In shutdown mode, the capacitive touch keypad is not updated and the LED backlighting is disabled. The only way to wake up the keypad is to clear the shutdown bit or reset the keypad.

The wake-on-proximity enable bit resets to 1 at power-up. When set, the BOOSTXL-CAPKEYPAD will enter a wake-on-proximity mode after a period of inactivity. When no touches have been detected for several seconds, the LED backlighting will fade to off and the CapTIvate keypad will only measure the proximity sensor. In this mode, no IRQ requests are sent to the host processor while the proximity sensor is being scanned. If a proximity detection occurs, the keypad will wake up and transition to active mode, reporting all samples to the host MCU via the IRQ pin. If this bit is cleared, the BOOSTXL-CAPKEYPAD will remain in active mode all of the time. This means that the LED backlighting will remain active, and after every new touch sample is acquired the host will be notified via the IRQ pin.

The UART enable bit resets to 1 at power-up. When set, the BOOSTXL-CAPKEYPAD transmits sensor and element packets via the UART interface when in active mode. The UART interface is located in the 20-pin CAPTIVATE-PGMR header at the top of the BoosterPack. This interface enables the CapTIvate Design Center to view real time sensor data from the BOOSTXL-CAPKEYPAD when a CAPTIVATE-PGMR module is attached between the BOOSTXL-CAPKEYPAD and a host computer. Clearing BIT2 disables this UART interface, and allows the BOOSTXL-CAPKEYPAD to run in a lower power state because the UART baud rate clock is not required. Thus, if a host LaunchPad wants to communicate with the BOOSTXL-CAPKEYPAD, but use of CapTIvate Design Center is not needed, the UART enable bit may be cleared to conserve power.

This bit indicates the current user interface state. ‘1’ corresponds to ACTIVE mode. In ACTIVE mode, the BOOSTXL-CAPKEYPAD is scanning all electrodes, reporting new samples to the host via the IRQ pin, and LED backlighting is enabled. ‘0’ corresponds to Wake-on-Prox mode. In Wake-on-Prox mode, the BOOSTXL-CAPKEYPAD is only scanning the proximity sensor, IRQ signals to the host are deactivated, and LED backlighting is disabled. The BOOSTXL-CAPKEYPAD will automatically transition between ACTIVE and Wake-on-Prox states when the Wake-on-Prox enable bit is set in the control word register.

Below are sample I2C transactions between the BOOSTXL-CAPKEYPAD running the BOOSTXL-CAPKEYPAD-Demo software (the I2C bus slave) and a host LaunchPad MCU (the I2C bus master).

Below is an example of performing an I2C write transaction to set the lower control word of the BOOSTXL-CAPKEYPAD to a value of 0x02. The control word resides at address 0x00. The BOOSTXL-CAPKEYPAD I2C address is 0x11. Thus, to perform a bus write, the master sets up a write to 0x11, writes the register (0x00), and writes the value (0x02).

Below is an example of performing an I2C read transaction to obtain the current and last status words of the BOOSTXL-CAPKEYPAD. The I2C bus master, in this case, waits for the IRQ high-to-low transition before reading. The IRQ pin indicates that a new sample is now available. That sample will be valid until the IRQ pin transitions back high, indicating that the next sample is being measured.

In this example, the current status word lower byte (0x02) and the previous status word lower byte (0x04) both have just one bit set- the active bit. This bit indicates that the BOOSTXL-CAPKEYPAD is in its active scanning mode, testing all 12 buttons, with backlighting on.

The power consumption of the BOOSTXL-CAPKEYPAD depends on two factors: the operating configuration (set by the control word) and the status of the user interface (wake-on-proximity vs. active). Below is a list of typical average currents in the various operating modes.

The BOOSTXL-CAPKEYPAD powers up with UART enabled. This allows for communication between the BOOSTXL-CAPKEYPAD and a host computer running CapTIvate Design Center. In order for the UART to be functional, the MSP430FR2522 must sleep in low power mode 0 (LPM0) so that the baud rate clock is functional. This adds approximately 350uA to the average power consumption. For applications where the BOOSTXL-CAPKEYPAD is used only with a LaunchPad, and not the CapTIvate Design Center, the UART can be disabled by clearing the SYSTEM__CTRL_UART_ENABLE bit. This will allow LPM4 to be used in wake-on-proximity mode, dropping the average current to less than 10uA in wake-on-proximity mode. The UART interface can be disabled via the I2C interface from a host processor- it is not necessary to re-program the MCU.

When running the BOOSTXL-CAPKEYPAD-EMC demo software, the BOOSTXL-CAPKEYPAD is capable of tolerating 3Vrms conducted noise coupled directly into its DC power supply. The plot below shows the results of a conducted noise immunity test in which the noise frequency was swept from 300kHz to 80 MHz while a continuous touch was applied to the electrode under test. The post-processed data, raw data, and measured noise level is shown. Note that while individual frequencies in the raw data are affected by conducted noise currents, the overall post-processed result rejects the noise-affected frequency to maintain correct operation.

The plot below shows two consecutive touches on the electrode under test while in the presence of constant conducted noise at 4 MHz. In the BOOSTXL-CAPKEYPAD-EMC software demonstration, the base charge transfer frequency is 4 MHz. The plot shows the clearly corrupted raw data at the base conversion frequency, but the 3 alternate frequencies are unaffected. It is this principle that enables reliable touch detection in the presence of conducted noise.