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
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
Click board™ Schematic
Step by step
Project assembly
Track your results in real time
Application Output via UART Mode
1. Once the code example is loaded, pressing the "FLASH" button initiates the build process, and programs it on the created setup.
2. After the programming is completed, click on the Tools icon in the upper-right panel, and select the UART Terminal.
3. After opening the UART Terminal tab, first check the baud rate setting in the Options menu (default is 115200). If this parameter is correct, activate the terminal by clicking the "CONNECT" button.
4. Now terminal status changes from Disconnected to Connected in green, and the data is displayed in the Received data field.
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
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* \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