Calculates the absolute angular position of a permanent magnet
A
A
Hardware Overview
How does it work?
Angle 6 Click is based on the MAQ470GQE, 12-bit PWM output angle sensor that detects the absolute angular position of a permanent magnet, typically a diametrically magnetized cylinder on a rotating shaft from Monolithic Power Systems. It allows users to read angle position information and detect the speed or direction of magnet rotation. Fast data acquisition and processing provide accurate angle measurement from 0 to 60,000 rpm. It supports many magnetic field strengths and spatial configurations, with both end-of-shaft and off-axis (side-shaft mounting) supported configurations. The MAQ470GQE features magnetic field strength detection with programmable thresholds to allow sensing of the magnet position relative to the sensor to create functions such as sensing axial movements or diagnostics. It can operate over a wide magnetic field range from 30mT to 150mT (60mT typical) with 5mT accuracy.
Eight magnetic field thresholds are programmable in approximate 15mT steps allowing the detection of changes in the distance between the magnet and the sensor. On-chip non-volatile memory provides storage for configuration parameters, including the reference zero angle position and magnetic field detection thresholds. The magnetic field is detected with integrated Hall devices in the sensors' center. The angle is measured using the Spinaxis™ method, based on phase detection generating a sinusoidal signal with a phase representing the angle of the magnetic field. The angle is then obtained by a time-to-digital converter, representing output from the front end to the digital conditioning block, which measures the time between the zero-crossing of the sinusoidal signal and the edge of a constant waveform. This output delivers a digital number proportional to the angle of the magnetic field at the rate of 1MHz in
a straightforward and open-loop manner. The Angle 6 Click communicates with MCU using the standard SPI serial interface for angle reading and register programming, which supports SPI Mode 0 and 3 and operates at clock rates up to 25 MHz. It also has the magnetic flags used to indicate when the sensor position's magnetic field is out of range, defined by the lower and upper magnetic field thresholds, routed on the RST and INT pins of the mikroBUS™ socket labeled as MGH and MGL. This Click board™ can only be operated with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. However, the Click board™ comes equipped with a library containing functions and an example code that can be used as a reference for further development.



Features overview
Development board
UNI Clicker is a compact development board designed as a complete solution that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It supports a wide range of microcontrollers, such as different ARM, PIC32, dsPIC, PIC, and AVR from various vendors like Microchip, ST, NXP, and TI (regardless of their number of pins), four mikroBUS™ sockets for Click board™ connectivity, a USB connector, LED indicators, buttons, a debugger/programmer connector, and two 26-pin headers for interfacing with external electronics. Thanks to innovative manufacturing technology, it allows you to build
gadgets with unique functionalities and features quickly. Each part of the UNI Clicker development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the UNI Clicker programming method, using a third-party programmer or CODEGRIP/mikroProg connected to onboard JTAG/SWD header, the UNI Clicker board also includes a clean and regulated power supply module for the development kit. It provides two ways of board-powering; through the USB Type-C (USB-C) connector, where onboard voltage regulators provide the appropriate voltage levels to each component on the board, or using a Li-Po/Li
Ion battery via an onboard battery connector. All communication methods that mikroBUS™ itself supports are on this board (plus USB HOST/DEVICE), including the well-established mikroBUS™ socket, a standardized socket for the MCU card (SiBRAIN standard), and several user-configurable buttons and LED indicators. UNI Clicker is an integral part of the Mikroe ecosystem, allowing you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping 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)
128
Silicon Vendor
Microchip
Pin count
100
RAM (Bytes)
32768
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
1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support
Library Description
This library contains API for Angle 6 Click driver.
Key functions:
angle6_write_register
This function writes a data byte to the selected register by using SPI serial interface.angle6_read_register
This function reads a data byte from the selected register by using SPI serial interface.angle6_read_angle
This function reads raw angle data and converts it to degrees.
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 main.c
* @brief Angle6 Click example
*
* # Description
* This example demonstrates the use of Angle 6 click board by reading and displaying
* the magnet's angular position in degrees.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes the driver and performs the click default configuration which
* sets the rotation direction to clockwise.
*
* ## Application Task
* Reads the magnet's angular position in degrees and displays the results on the USB UART
* approximately every 100ms.
*
* @author Stefan Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "angle6.h"
static angle6_t angle6;
static log_t logger;
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
angle6_cfg_t angle6_cfg; /**< Click config object. */
/**
* 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.
angle6_cfg_setup( &angle6_cfg );
ANGLE6_MAP_MIKROBUS( angle6_cfg, MIKROBUS_1 );
if ( SPI_MASTER_ERROR == angle6_init( &angle6, &angle6_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( ANGLE6_ERROR == angle6_default_cfg ( &angle6 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
float angle = 0;
if ( ANGLE6_OK == angle6_read_angle ( &angle6, &angle ) )
{
log_printf ( &logger, " Angle: %.2f Deg \r\n\n", angle );
Delay_ms ( 100 );
}
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END