|
| 1 | +<!-- Please do not change this logo with link --> |
| 2 | + |
| 3 | +<a target="_blank" href="https://www.microchip.com/" id="top-of-page"> |
| 4 | + <picture> |
| 5 | + <source media="(prefers-color-scheme: light)" srcset="images/microchip.png" width="350"> |
| 6 | + <img alt="Microchip Technologies Inc." src="https://www.microchip.com/content/experience-fragments/mchp/en_us/site/header/master/_jcr_content/root/responsivegrid/header/logo.coreimg.100.300.png/1605828081463/microchip.png"> |
| 7 | + </picture> |
| 8 | +</a> |
| 9 | + |
| 10 | +## MTCH9010 Enhanced Configuration Using PowerShell®-Compatible Scripts |
| 11 | + |
| 12 | +This repository contains two PowerShell®-compatible scripts for configuring the MTCH9010 through the Enhanced Configuration mode via a serial communication: |
| 13 | +- `send_param_basic.ps1`: Basic Configuration Script |
| 14 | +- `send_param_enh.ps1`: Enhanced Configuration Script |
| 15 | + |
| 16 | +## Prerequisites |
| 17 | +- PowerShell 5.1 or newer |
| 18 | + |
| 19 | +## Hardware Used |
| 20 | +- [MTCH9010 Evaluation Kit](https://www.microchip.com/en-us/development-tool/EV24U22A?utm_source=GitHub&utm_medium=TextLink&utm_campaign=MCU8_mtch9010&utm_content=mtch9010-configuration-scripts-github&utm_bu=MCU08) |
| 21 | + <br><img src="images/ev-kit.png" width="400"> |
| 22 | + |
| 23 | + ## Concept |
| 24 | + Two PowerShell®-compatible scripts for configuring the MTCH9010 are provided in this repository: |
| 25 | + - `send_param_basic.ps1` - this script transmits a predefined configuration to the MTCH9010 |
| 26 | + - `send_param_enh.ps1` - this script allows the user to transmit the desired configuration parameters |
| 27 | + ## Usage |
| 28 | +Open a PowerShell terminal. From the command prompt, go to the directory where the scripts are |
| 29 | +located. Run one of the following commands, depending on which script you are using: |
| 30 | + |
| 31 | + `.\send_param_basic.ps1` or `.\send_param_enh.ps1` |
| 32 | + ## Configuration |
| 33 | + Before running the scripts, the device must be configured in Enhanced Configuration mode through the corresponding slide switch. The following configuration must be made on the MTCH9010: |
| 34 | +- <b> ECFG </b> configured to <b> ON </b> |
| 35 | +- <b> LOCK </b> configured to <b> OFF </b> |
| 36 | + |
| 37 | + <br><img src="images/mtch-config.png" width="400"> |
| 38 | + |
| 39 | +To ensure proper communication with the hardware, verify the COM port assigned to the device before running the script, as incorrect port settings can lead to connection failures. The specific COM port for the MTCH9010 Evaluation Kit can be identified by checking the Ports section in Windows Device Manager. |
| 40 | + |
| 41 | +The COM port used in these examples is COM37. Additionaly, the coresponding serial port must be configured as it is shown below. |
| 42 | + |
| 43 | +`$port = New-Object System.IO.Ports.SerialPort COM37, 38400, None, 8, 1` |
| 44 | + - 38400: Baud rate of 38400 bits/second |
| 45 | + - None: No parity bit |
| 46 | + - 8: Eight data bits |
| 47 | + - 1: One stop bit |
| 48 | + |
| 49 | +## Scripts Functionality |
| 50 | +`send_param_basic.ps1` transmits a predefined configuration to the MTCH9010. The following |
| 51 | +parameters are set in this example: |
| 52 | +- `Operation Mode`: Conductive (option `1`) |
| 53 | +- `Sleep period`: Four seconds (option `3`) |
| 54 | +- `Extended output mode`: Serial data enabled (option `1`) |
| 55 | +- `Extended output format`: Standard measurement and delta (option `2`) |
| 56 | +- Confirm the `reference value` provided (option `0`) |
| 57 | +- Provide the `threshold value`: `800` |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +`send_param_enh.ps1` allows the user to enter the desired parameters. A reset is needed to start configuring the device. After the configuration is done, the script displays a message, followed by the measurements made by MTCH9010. The configured parameters can be saved in the Nonvolatile Memory (NVM) and restored at every start-up. To enable this functionality, configure the MTCH9010 as follows : |
| 62 | + |
| 63 | +- <b> LOCK </b> configured to <b> ON </b> |
| 64 | +- <b> ECFG </b> configured to <b> OFF </b> |
| 65 | + |
| 66 | +The following table describes the available options when it comes to configuring application |
| 67 | +parameters through the Enhanced Configuration mode: |
| 68 | + |
| 69 | + |
| 70 | +| Parameter | Value | Configuration | |
| 71 | +|:------------------------------------------:|:-----: |:-------------------------------------------------: | |
| 72 | +| Operation Mode | 0 | Capacitive | |
| 73 | +| | 1 | Conductive | |
| 74 | +| Sleep Time | 0 | Wake-up on request | |
| 75 | +| | 1 | 1 second | |
| 76 | +| | 2 | 2 seconds | |
| 77 | +| | 3 | 4 seconds | |
| 78 | +| | 4 | 8 seconds | |
| 79 | +| | 5 | 16 seconds | |
| 80 | +| | 6 | 32 seconds | |
| 81 | +| | 7 | 64 seconds | |
| 82 | +| | 8 | 128 seconds | |
| 83 | +| | 9 | 256 seconds | |
| 84 | +| Extended Output Moode | 0 | Disabled | |
| 85 | +| | 1 | Enabled | |
| 86 | +| Extended Output Format | 0 | Delta measurement | |
| 87 | +| | 1 | Standard measurement | |
| 88 | +| | 2 | Both standard and delta measurements | |
| 89 | +| | 3 | MPLAB Data Visualizer Data Stream protocol format | |
| 90 | +| Capacitive/Conductive Reference Value | 0 | Set the standard measurement as Reference Value | |
| 91 | +| | 1 | Repeat the capacitive/conductive measurement | |
| 92 | +| | 2 | Set custom Reference Value | |
| 93 | +| Capacitive/Conductive Detection Threshold | 0 | Set custom Detection Threshold | |
| 94 | + |
| 95 | + |
| 96 | +Once the System Lock is enabled, the saved configuration will be used at power-up. The user can view the values acquired with the new configuration after applying a reset. The `send_param_enh.ps1` script will continue running until any key is pressed. |
| 97 | + |
| 98 | +<b>Note</b>: A reset is required before sending the parameters to the MTCH9010 in both scenarios. |
| 99 | + |
| 100 | +## Demo |
| 101 | +The next demonstation GIF presents a showcase of how to configure the MTCH9010 using the `send_param_enh.ps1` script. |
| 102 | +<br><img src="images/demo.gif" width="500"> |
| 103 | + |
| 104 | +## Summary |
| 105 | +These PowerShell®-compatible scripts are used for configuring the MTCH9010 through the Enhanced Configuration mode via a serial communication. |
| 106 | + |
| 107 | +## Menu |
| 108 | +- [Back to Top](#mtch9010-enhanced-configuration-using-powershell®-compatible-scripts) |
| 109 | +- [Back to Prerequisites](#prerequisites) |
| 110 | +- [Back to Hardware Used](#hardware-used) |
| 111 | +- [Back to Concept](#concept) |
| 112 | +- [Back to Usage](#usage) |
| 113 | +- [Back to Concept](#concept) |
| 114 | +- [Back to Configuration](#configuration) |
| 115 | +- [Back to Scripts Functionality](#scripts-functionality) |
| 116 | +- [Back to Demo](#demo) |
| 117 | +- [Back to Summary](#summary) |
0 commit comments