Explore the limitless possibilities of advanced TMR angle sensing technology, revolutionizing applications from automotive safety to robotics precision
A
A
Hardware Overview
How does it work?
TMR Angle Click is based on the TLE5501, an analog TMR-based angle sensor from Infineon Technologies for any kind of angular position sensing from Infineon, and the MCP3204, a converter with SPI serial interface from Microchip. Regarding the TLE5501, the application fields range from steering angle applications with the highest functional safety requirements to motors for wipers, pumps and actuators and electric motors in general. TLE5501 is dedicated to any automotive but also industrial and consumer applications like robotics or gimbal. Some of its key features include large output signals of up to 0.37 V/V for easy analog value readout, discrete bridge with differential sine and cosine output, a very low supply current < 2.5 mA, a magnetic field range 20 mT to 100 mT and a typ. angle error < 1.0° (over the whole temperature and lifetime profile). It has been primarily designed for safety. One major benefit of the Infineon TMR technology is its
high sensing sensitivity coming with a high output voltage. So unlike other technologies, a TMR based sensor does not require any additional internal amplifier. Thus the sensor can be connected directly to the microcontroller without any further amplification – saving costs for the end customer. There is yet another cost saving aspect of Infineon’s TMR technology. TMR shows a very low temperature drift reducing external calibration and compensation efforts. In addition, the TMR technology is also well known for its low current consumption. When it comes to reading the output analog value, the MCP3204 is used – a 4-Channel A/D converter with SPI serial interface, from Microchip, it is ideally suited for sensor interface, process control, data acquisition and battery operated systems. It has a 12-bit resolution, and it is programmable to provide two pseudo-differential input pairs or four single-ended inputs. Configuration is done as part of the serial
command before each conversion begins. When used in the pseudodifferential mode, each channel pair (i.e., CH0 and CH1, CH2 and CH3 etc.) On this Click board™ the output sin and cos signals are wired as a pseudo-differential input signals to the MCP3204. Communication with the devices is accomplished using a simple serial interface compatible with the SPI protocol. The devices are capable of conversion rates of up to 100 ksps. The MCP3204/3208 devices operate over a broad voltage range (2.7V - 5.5V). This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used as a reference for further development.
Features overview
Development board
PIC32MZ Clicker is a compact starter development board that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It comes with an onboard 32-bit PIC32MZ microcontroller with FPU from Microchip, a USB connector, LED indicators, buttons, a mikroProg connector, and a header for interfacing with external electronics. Thanks to its compact design with clear and easy-recognizable silkscreen markings, it provides a fluid and immersive working experience, allowing access anywhere and under
any circumstances. Each part of the PIC32MZ Clicker development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the PIC32MZ Clicker programming method, using USB HID mikroBootloader, or through an external mikroProg connector for PIC, dsPIC, or PIC32 programmer, the Clicker board also includes a clean and regulated power supply module for the development kit. The USB Micro-B connection can provide up to 500mA of current, which is more than enough to operate all onboard
and additional modules. All communication methods that mikroBUS™ itself supports are on this board, including the well-established mikroBUS™ socket, reset button, and several buttons and LED indicators. PIC32MZ 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

Architecture
PIC32
MCU Memory (KB)
1024
Silicon Vendor
Microchip
Pin count
64
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
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 TMR Angle Click driver.
Key functions:
tmrangle_init_sensor_data
- Function read and stores negative and positive, sine and cosine parameters datatmrangle_calibration_find_param
- This function will extract the maximum, minimum voltage levels, amplitude, offset, and orthogonalitytmrangle_get_calib_angle
- Function calculates the calibrated angle in degrees and this structure holds the current sensor calibration parameters.
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 TMRAngle Click example
*
* # Description
* This application collects data from the sensor, calculates it, and then logs
* the results.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes driver, and also write log.
*
* ## Application Task
* Reads angle value in degrees.
* Results are being sent to the Usart Terminal where you can track their changes.
* All data logs write on usb uart changes for every 1 sec.
*
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "tmrangle.h"
// ------------------------------------------------------------------ VARIABLES
static tmrangle_t tmrangle;
static log_t logger;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
tmrangle_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.
tmrangle_cfg_setup( &cfg );
TMRANGLE_MAP_MIKROBUS( cfg, MIKROBUS_1 );
tmrangle_init( &tmrangle, &cfg );
}
void application_task ( void )
{
float angle;
trigonometry_t trig_set;
tmrangle_calib_data_t calibration_store_params;
tmrangle_init_sensor_data( &tmrangle );
trig_set.max_diff_sin = TMRANGLE_MAX_DIFF_SIN;
trig_set.max_diff_cos = TMRANGLE_MAX_DIFF_COS;
trig_set.min_diff_sin = TMRANGLE_MIN_DIFF_SIN;
trig_set.min_diff_cos = TMRANGLE_MIN_DIFF_COS;
trig_set.sin_45 = TMRANGLE_SIN_45;
trig_set.cos_45 = TMRANGLE_COS_45;
trig_set.sin_135 = TMRANGLE_SIN_135;
trig_set.cos_135 = TMRANGLE_COS_135;
tmrangle_init_calib_data( &tmrangle, &calibration_store_params, &trig_set );
tmrangle_calibration_find_param( &tmrangle, &calibration_store_params );
angle = tmrangle_get_calib_angle( &tmrangle, &calibration_store_params );
log_printf( &logger, "Angle is %f deg\r\n", angle );
Delay_ms ( 1000 );
}
int main ( void )
{
/* Do not remove this line or clock might not be set correctly. */
#ifdef PREINIT_SUPPORTED
preinit();
#endif
application_init( );
for ( ; ; )
{
application_task( );
}
return 0;
}
// ------------------------------------------------------------------------ END