How does it work?
Magneto 8 Click is based on the AS5601, 12-bit programmable contactless encoder IC from AMS-AG. The AS5601 is a Hall-based rotary magnetic position encoder that converts the magnetic field component vertical to the surface of the chip into a voltage, which is used to produce incremental A/B outputs and absolute position indication. The analog signals from the Hall sensor are first amplified and filtered (before being converted by the ADC into binary data), and then are processed by the CORDIC block to compute the angle and magnitude of the magnetic field vector. The angle values provided by the CORDIC algorithm are used by the internal logic to generate the incremental quadrature signals A and B.
Additionally, the AS5601 implements a pushbutton detection function that indicates sudden airgap changes between the AS5601 and magnet, and drives the PUSH output pin high when the AS5601 detects a fast increase of the magnetic field and vice versa. The AS5601 communicates with MCU using the standard I2C 2-Wire interface with the maximum SCL frequency of 1 MHz. I2C communication interface supports several different modes. In addition to the modes such as Standard, Fast, and Fast-Plus mode there are 3 additional modes like Random/Sequential read, Byte/Page write, and Automatic increment relating to the ANGLE register.
The AS5601 can be powered from a 5V supply using the on-chip LDO regulator, or it can be powered directly from a 3.3V supply. The selection can be done by positioning SMD jumpers labeled as VCC SEL to an appropriate position. In this case, there are two voltage selection jumpers because the power pins of the AS5601 require a different configuration in the case of 3.3V and 5V power supply. In 5V operation, the second power pin needs to be connected to the ground via a decoupling capacitor C2. Otherwise, in 3.3V operation, the two pins must be tied together. Note that all the jumpers must be placed to the same side, or else the Click board™ may become unresponsive.
This Click Board™ uses the I2C communication interface with both 3.3V and 5V. The onboard SMD jumper labeled as VCC SEL allows voltage selection for interfacing with both 3.3V and 5V MCUs. More information about the AS5601’s functionality, electrical specifications, and typical performance can be found in the attached datasheet. However, the Click board™ comes equipped with a library that contains easy to use functions and a usage example that may be used as a reference for the development.
Specifications
Type
Magnetic
Applications
Can be used for a angular position measurement solutions, encoder replacement, contactless magnetic position sensors, and more.
On-board modules
Magneto 8 Click is based on the AS5601, 12-bit programmable contactless encoder IC from AMS-AG.
Key Features
High reliability and durability, low power consumption, simple programming, and more.
Interface
GPIO,I2C
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Magneto 8 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
JP1 | VCC SEL | Right | Power Supply Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2 | MODE SEL | Right | Second Power Pin Configuration Selection 3V3/5V: Left position 3V3, Right position 5V |
Magneto 8 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | -0.3 | – | 6.1 | V |
A/B output resolution | 8 | – | 2048 | positions |
I2C clock frequency | – | – | 1 | MHz |
Operating Temperature Range | -40 | – | +125 | °C |
Software Support
We provide a library for the Magneto 8 Click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library contains basic functions to perform the control of the Magneto 8 click board.
Key functions:
uint16_t magneto8_get_angle_data ( void )
– Gets Angle datauint16_t magneto8_get_magnitude ( void )
– Gets magnitude datauint8_t magneto8_get_status ( void )
– Gets status data
Examples description
The application is composed of three sections :
- System Initialization – Initialize the I2C module and all necessary GPIO pins
- Application Initialization – Initializes driver init and starts config module for measurement
- Application Task – Reads angle and magnetic data. Logs data every 2 seconds
void application_task ( ) { uint16_t angle; uint16_t mag; char demo_text[ 20 ]; mag = magneto8_get_magnitude( ); IntToStr( mag, demo_text ); mikrobus_logWrite( "Magnetic: ", _LOG_TEXT ); mikrobus_logWrite( demo_text, _LOG_LINE ); angle = magneto8_get_angle_data( ); IntToStr( angle, demo_text ); mikrobus_logWrite( "Angle : ", _LOG_TEXT ); mikrobus_logWrite( demo_text, _LOG_LINE ); mikrobus_logWrite( "----------------------", _LOG_LINE ); Delay_ms( 2000 ); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C Library
- UART Library
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.