Skip to content

Commit 371f717

Browse files
Gabriel UrsGabriel Urs
authored andcommitted
MPAE-20124: Implement TW review
1 parent d502a8b commit 371f717

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

.main-meta/main.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"metaDataVersion": "1.3.0",
66
"name": "com.microchip.mcu8.mplabx.project.pic18f56q71-mtch9010-dynamic-cfg-change",
77
"version": "1.0.2",
8-
"displayName": "MTCH9010 Dynamic Configuration Change Using the PIC18F56Q71 Microcontroller with MCC Melody",
8+
"displayName": "MTCH9010 Dynamic Configuration Change Using the PIC18F56Q71 Microcontroller With MCC Melody",
99
"projectName": "pic18f56q71-mtch9010-dynamic-cfg-change",
1010
"shortDescription": "This repository contains two MPLAB X projects demonstrating dynamic configuration changes for MTCH9010 using Enhanced Configuration mode or configuration input pins, with the PIC18F56Q71 microcontroller as the host device.",
1111
"ide": {

Enhanced_Configuration_Mode/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</picture>
99
</a>
1010

11-
# MTCH9010 Dynamic Enhanced Configuration Change Using the PIC18F56Q71 Microcontroller with MCC Melody
11+
# MTCH9010 Dynamic Enhanced Configuration Change Using the PIC18F56Q71 Microcontroller With MCC Melody
1212

1313
This MPLAB® X project shows how to dynamically change the configuration for MTCH9010 using the Enhanced Configuration mode. The PIC18F56Q71 microcontroller is used as a host device and the configuration is realized using the Universal Asynchronous Receiver Transmitter (UART) peripheral.
1414

@@ -38,17 +38,17 @@ To program the Curiosity Nano board with this MPLAB X project, follow the steps
3838

3939
## Concept
4040

41-
In Enhanced Configuration mode, the MTCH9010 device can be configured using the UART communication protocol. To enter in this configuration mode, the following settings should be done on the MTCH9010 configuration pins:
41+
In Enhanced Configuration mode, the MTCH9010 device can be configured using the UART communication protocol. To enter in this configuration mode, the following settings must be done on the MTCH9010 configuration pins:
4242
- The SYS_LK pin should be set to high (disabled)
4343
- The CFG_EN pin should be set to low (enabled)
4444

4545
A Reset of the device is needed after the pins are configured to enter the configuration mode. This can be done using the RESET pin by making it low for a period of time (10 ms are used in this example) and then restore it to high.
4646

47-
After the Reset operation, the device will send the firmware version on the serial port and then wait for the configuration commands. Each command sent should be followed by a validation key (with the ASCII code equal to 0x0D in hexadecimal system). After a command is sent, the device will respond with ACK (Acknowledge, 0x06 in hexadecimal system) or NAK (Negative Acknowledge, 0x15 in hexadecimal system) followed by the validation key. If a NAK signal is received, the command must be sent again until it is validated by the device with an ACK signal.
47+
After the Reset operation, the device will send the firmware version on the serial port and then wait for the configuration commands. Each command sent will be followed by a validation key (with the ASCII code equal to 0x0D in hexadecimal system). After a command is sent, the device will respond with ACK (Acknowledge, 0x06 in hexadecimal system) or NAK (Negative Acknowledge, 0x15 in hexadecimal system) followed by the validation key. If a NAK signal is received, the command must be sent again until it is validated by the device with an ACK signal.
4848

49-
In this code example, the `MTCH9010.h` and `MTCH9010.c` files contains the implementation of the functions used to configure the device in Enhanced Configuration mode. The `mtch9010_config_t` structure is used to simply define the parameters of the configuration that need to be sent. The `MTCH9010_Config(mtch9010_config_t configData)` function can be used to configure the device. This function sets the pins for configuration mode, reset the device and then send the configuration parameters using the UART1 peripheral. The function also implements a mechanism that verifies if each command is validated by the ACK signal. If it is validated, the program continues with the next command in the same way. If it is not validated, the program repeats the transmission. Each command is repeated for a maximum number of five times. After that the function returns an error code and the program blocks in an infinite loop. A message about the error code is also displayed on serial port using the UART2 peripheral.
49+
In this code example, the `MTCH9010.h` and `MTCH9010.c` files contains the implementation of the functions used to configure the device in Enhanced Configuration mode. The `mtch9010_config_t` structure is used to simply define the parameters of the configuration that need to be sent. The `MTCH9010_Config(mtch9010_config_t configData)` function can be used to configure the device. This function sets the pins for the configuration mode, resets the device and then sends the configuration parameters using the UART1 peripheral. The function also implements a mechanism that verifies if each command is validated by the ACK signal. If it is validated, the program continues with the next command in the same way. If it is not validated, the program repeats the transmission. Each command is repeated for a maximum number of five times. After that, the function returns an error code and the program blocks in an infinite loop. A message about the error code is also displayed on the serial port using the UART2 peripheral.
5050

51-
This example contains two configurations of the MTCH9010. The user can switch between configurations using the on-board button of the PIC18F56Q71 Curiosity Nano. An Interrupt-on-Change (IOC) is generated on the negative edge of the button input. After the interrupt occurs, a debouncing mechanism is implemented using TMR0 peripheral. The button state is verified after a 20ms delay, triggered by the TMR0 overflow interrupt, to ensure that the pressed state is maintained. The parameters of the two configurations are shown below:
51+
This example contains two configurations of the MTCH9010. The user can switch between configurations using the on-board button of the PIC18F56Q71 Curiosity Nano. An Interrupt-on-Change (IOC) is generated on the negative edge of the button input. After the interrupt occurs, a debouncing mechanism is implemented using the TMR0 peripheral. The button state is verified after a 20 ms delay, triggered by the TMR0 overflow interrupt, to ensure that the pressed state is maintained. The parameters of the two configurations are shown below:
5252
- Configuration 1:
5353
- SYS_LK: Enabled
5454
- CFG_EN: Disabled
@@ -109,7 +109,7 @@ The following peripheral and clock configurations are set up using the MPLAB Cod
109109
- Timer Enable: Disabled
110110
- Clock Source: LFINTOSC
111111
- Prescaler: 1:4
112-
- Requested Period: 20ms
112+
- Requested Period: 20 ms
113113
- TMR Interrupt Enable: Enabled
114114
<br><img src="images/mcc-tmr0.png" width="600">
115115

Input_Pins_Configuration_Mode/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</picture>
99
</a>
1010

11-
# MTCH9010 Dynamic Input Pins Configuration Change Using the PIC18F56Q71 Microcontroller with MCC Melody
11+
# MTCH9010 Dynamic Input Pins Configuration Change Using the PIC18F56Q71 Microcontroller With MCC Melody
1212

1313
This MPLAB® X project shows how to dynamically change the configuration for MTCH9010 using the configuration input pins. The PIC18F56Q71 microcontroller is used as a host device and the configuration is realised using the Digital-to-Analog Converter (DAC) and Operational Amplifier (OPA) peripherals.
1414

@@ -38,14 +38,14 @@ To program the Curiosity Nano board with this MPLAB X project, follow the steps
3838

3939
## Concept
4040

41-
MTCH9010 can be configured using the configuration input pins. These input pins are read when the device is started, meaning that, for changing the configuration, these pins should be configured accordingly with the desired parameters and then a Reset operation should be done to configure the device with the new parameters. To use this configuration mode, the System Lock pin should be set high (disabled).
41+
MTCH9010 can be configured using the configuration input pins. These input pins are read when the device is started, meaning that, for changing the configuration, these pins must be configured accordingly with the desired parameters and then a Reset operation must be done to configure the device with the new parameters. To use this configuration mode, the System Lock pin must be set high (disabled).
4242

4343
The Operation Mode, Extended Output, Enhanced Configuration mode and System Lock inputs are
4444
set by connecting the pin to VDD or to GND. The Sleep Period and Liquid Detection Threshold inputs are set by applying a voltage level to the respective configuration pin. These voltages are generated using the DAC1 and DAC2 peripherals. The PIC18F56Q71 microcontroller can use only one output pin for all the DAC peripherals meaning that is not possible to generated the desired voltage for Threshold and Sleep on two output pins using only the DAC peripherals. The solution implemented uses the DAC1 peripheral for Threshold voltage and its output is directly connected on the `RA2` pin. For the Sleep time voltage, the DAC2 peripheral is used to generate the desired voltage as the internal positive input for the OPA2 peripheral. The OPA2 is used in Unity Gain Buffer mode and the output is connected to the `RB1` pin.
4545

46-
In this code example, the `MTCH9010.h` and `MTCH9010.c` files contain the implementation of the functions used to set the parameters of the desired configuration. The mtch9010_config_t structure is used to simply define these parameters. The MTCH9010_Config(mtch9010_config_t configData) function can be used to configure the device: this function sets the pins and the output voltage for DAC1 and DAC2 and resets the device to change its configuration.`
46+
In this code example, the `MTCH9010.h` and `MTCH9010.c` files contain the implementation of the functions used to set the parameters of the desired configuration. The mtch9010_config_t structure is used to simply define these parameters. The MTCH9010_Config(mtch9010_config_t configData) function can be used to configure the device: this function sets the pins and the output voltage for DAC1 and DAC2 and resets the device to change its configuration.
4747

48-
This example contains two configurations of the MTCH9010. The user can switch between configurations using the on-board button of the PIC18F56Q71 Curiosity Nano. An Interrupt-on-Change (IOC) is generated on the negative edge of the button input. After the interrupt occurs, a debouncing mechanism is implemented using TMR0 peripheral. The button state is verified after a 20ms delay, triggered by the TMR0 overflow interrupt, to ensure that the pressed state is maintained. The parameters of the two configurations are shown below:
48+
This example contains two configurations of the MTCH9010. The user can switch between configurations using the on-board button of the PIC18F56Q71 Curiosity Nano. An Interrupt-on-Change (IOC) is generated on the negative edge of the button input. After the interrupt occurs, a debouncing mechanism is implemented using the TMR0 peripheral. The button state is verified after a 20 ms delay, triggered by the TMR0 overflow interrupt, to ensure that the pressed state is maintained. The parameters of the two configurations are shown below:
4949
- Configuration 1:
5050
- SYS_LK: Disabled
5151
- CFG_EN: Disabled
@@ -100,7 +100,7 @@ The following peripheral and clock configurations are set up using the MPLAB Cod
100100
- Timer Enable: Disabled
101101
- Clock Source: LFINTOSC
102102
- Prescaler: 1:4
103-
- Requested Period: 20ms
103+
- Requested Period: 20 ms
104104
- TMR Interrupt Enable: Enabled
105105
<br><img src="images/mcc-tmr0.png" width="600">
106106

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</picture>
99
</a>
1010

11-
# MTCH9010 Dynamic Configuration Change Using the PIC18F56Q71 Microcontroller with MCC Melody
11+
# MTCH9010 Dynamic Configuration Change Using the PIC18F56Q71 Microcontroller With MCC Melody
1212

1313
This repository provides two MPLAB® X projects that show how to dynamically change the configuration for MTCH9010 using the Enhanced Configuration mode or the configuration input pins. The PIC18F56Q71 microcontroller is used as a host device to set the configuration parameters.
1414

0 commit comments

Comments
 (0)