Effortlessly control device states with the ON/OFF button and, when needed, utilize the RESET button to restore settings to default swiftly, ensuring efficient management and seamless operation
A
A
Hardware Overview
How does it work?
Power/Reset Click is based on the QT1011, a digital burst mode charge-transfer sensor capable of detecting proximity or touch from Microchip. This click board™ has two PCB pads to sense touch or proximity events. Besides the two touch-sensitive pads, Power/Reset click has two LEDs for the touch indication. The two touch pads use two separate QT1011 ICs, providing reliable touch-sensing functionality. The AT42QT1011 is a digital burst mode charge-transfer sensor capable of detecting proximity or touch, making it ideal for implementing touch controls. With the proper electrode and circuit design, the self-contained digital IC will project a touch or proximity field to several centimeters through any dielectric like glass, plastic, stone, ceramic, and even most kinds
of wood. It can also turn small metal-bearing objects into intrinsic sensors responsive to proximity or touch. This capability and its ability to self-calibrate can lead to entirely new product concepts. The QT1011 is designed for human interfaces like control panels, appliances, toys, lighting controls, or anywhere a mechanical switch or button may be found. It includes all hardware and signal processing functions necessary to provide stable sensing under various changing conditions. However, this click board™ is designed to serve as a power and reset capacitive switch panel board. Besides the QT1011, this click board™ contains 74LVC1G74 as well. It is a Single D-type flip-flop with set and reset. Because the output of the QT1011 is active-high upon detection, the
74LVC1G74 is triggered by the positive edge of the ON/OFF touchpad. It is wired in a cascade with the QT1011 in a way that ensures holding one logical state until the ON/OFF pad is pressed. Therefore, the ON/OFF pad acts like a switch, while the RESET pad acts like a button, which is suitable for most common purposes. The ON/OFF and RESET pad output signals are wired to the PWM and INT pins on the mikroBUS™, respectively. Besides that, the STAT and RST LEDs are wired parallel to the outputs to ensure a visible indication of the status of the pins. This Click board™ is designed to be operated only with a 3.3V logic level. A proper logic voltage level conversion should be performed before the Click board™ is used with MCUs with logic levels of 5V.
Features overview
Development board
Fusion for PIC32 v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports a wide range of Microchip's PIC32 microcontrollers regardless of their number of pins and a broad set of unique functions, such as the first-ever embedded debugger/programmer over WiFi. The development board is well organized and designed so that the end-user has all the necessary elements, such as switches, buttons, indicators, connectors, and others, in one place. Thanks to innovative manufacturing technology, Fusion for PIC32 v8 provides a fluid and immersive working experience, allowing access anywhere and under any circumstances at any time. Each part of the
Fusion for PIC32 v8 development board contains the components necessary for the most efficient operation of the same board. In addition to the advanced integrated CODEGRIP programmer/debugger module, which offers many valuable programming/debugging options and seamless integration with the Mikroe software environment, the board also includes a clean and regulated power supply module for the development board. It can use a wide range of external power sources, including a battery, an external 12V power supply, and a power source via the USB Type-C (USB-C) connector. Communication options such as USB-UART, USB HOST/DEVICE, CAN (on the MCU card, if
supported), and Ethernet is also included. In addition, it also has the well-established mikroBUS™ standard, a standardized socket for the MCU card (SiBRAIN standard), and two display options for the TFT board line of products and character-based LCD. Fusion for PIC32 v8 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU
![default](https://cdn.mikroe.com/rent-a-product/request-setup/mcu-cards/mcu-card-3-for-pic32-pic32mz2048efh144.png)
Type
8th Generation
Architecture
PIC32
MCU Memory (KB)
2048
Silicon Vendor
Microchip
Pin count
144
RAM (Bytes)
524288
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
![Power/Reset Click Schematic schematic](https://dbp-cdn.mikroe.com/catalog/click-boards/resources/1ee790da-ee95-64ec-8991-0242ac120009/schematic.webp)
Step by step
Project assembly
Track your results in real time
Application Output
After pressing the "FLASH" button on the left-side panel, it is necessary to open the UART terminal to display the achieved results. By clicking on the Tools icon in the right-hand panel, multiple different functions are displayed, among which is the UART Terminal. Click on the offered "UART Terminal" icon.
![UART Application Output Step 1](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed703a-40a0-6b58-88de-02420a00029a/UART-AO-Step-1.jpg)
Once the UART terminal is opened, the window takes on a new form. At the top of the tab are two buttons, one for adjusting the parameters of the UART terminal and the other for connecting the UART terminal. The tab's lower part is reserved for displaying the achieved results. Before connecting, the terminal has a Disconnected status, indicating that the terminal is not yet active. Before connecting, it is necessary to check the set parameters of the UART terminal. Click on the "OPTIONS" button.
![UART Application Output Step 2](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed703a-eb29-62fa-ba91-02420a00029a/UART-AO-Step-2.jpg)
In the newly opened UART Terminal Options field, we check if the terminal settings are correct, such as the set port and the Baud rate of UART communication. If the data is not displayed properly, it is possible that the Baud rate value is not set correctly and needs to be adjusted to 115200. If all the parameters are set correctly, click on "CONFIGURE".
![UART Application Output Step 3](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed703b-7543-6fbc-9c69-0242ac120003/UART-AO-Step-3.jpg)
The next step is to click on the "CONNECT" button, after which the terminal status changes from Disconnected to Connected in green, and the data is displayed in the Received data field.
![UART Application Output Step 4](https://dbp-cdn.mikroe.com/cms/shared-resources/1eed703c-068c-66a4-a4fc-0242ac120003/UART-AO-Step-4.jpg)
Software Support
Library Description
This library contains API for Power/Reset Click driver.
Key functions:
powerreset_get_pwr
- Power Check functionpowerreset_get_rst
- Reset Check function
Open Source
Code example
This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.
/*!
* \file
* \brief Power Reset Click example
*
* # Description
* Reads PWR and RST pin states and performs a control of the timer counter depending on the pressed button.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes device and logger module, prints Initialization done message.
*
* ## Application Task
* Checks the states of the PWR and RST pins and logs every change.
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "powerreset.h"
// ------------------------------------------------------------------ VARIABLES
static powerreset_t powerreset;
static log_t logger;
powerreset_state_t pwr_state;
powerreset_state_t rst_state;
powerreset_state_t new_pwr_state;
powerreset_state_t new_rst_state;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
powerreset_cfg_t cfg;
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
powerreset_cfg_setup( &cfg );
POWERRESET_MAP_MIKROBUS( cfg, MIKROBUS_1 );
powerreset_init( &powerreset, &cfg );
Delay_ms( 100 );
log_printf( &logger, "** Touch Button initialization done **\r\n");
log_printf( &logger, "**************************************\r\n");
}
void application_task ( void )
{
new_pwr_state = powerreset_get_pwr( &powerreset );
new_rst_state = powerreset_get_rst( &powerreset );
if ( new_pwr_state != pwr_state )
{
if ( new_pwr_state == POWERRESET_ACTIVE )
{
log_printf( &logger, "POWER ON\r\n" );
Delay_ms( 100 );
}
else if ( new_pwr_state == POWERRESET_INACTIVE )
{
log_printf( &logger, "POWER OFF\r\n" );
Delay_ms( 100 );
}
pwr_state = new_pwr_state;
}
if ( new_rst_state != rst_state )
{
if ( new_rst_state == POWERRESET_ACTIVE )
{
log_printf( &logger, "Reset occured!\r\n" );
Delay_ms( 100 );
}
rst_state = new_rst_state;
}
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END