AS5040 / AS5140 Demoboard OPERATION MANUAL Application note 1 General Overview The AS5X40 is a contactless magnetic rotary encoder for accurate angular measurement over a full turn of 360. It is a system-on-chip, combining integrated Hall elements, analog front end and digital signal processing in a single device. To measure the angle, only a simple two-pole magnet, rotating over the center of the chip, is required. The magnet may be placed above or below the IC. The absolute angle measurement provides instant indication of the magnets angular position with a resolution of 0.35 = 1024 positions per revolution (AS5X40). This digital data is available as a serial bit stream and as a PWM signal. Furthermore, a user-programmable incremental output is available, making the chip suitable for replacement of various optical encoders. An internal voltage regulator allows the AS5X40 to operate at either 3.3 V or 5 V supplies. 2 The AS5X40 Demoboard The AS5X40 demoboard is a complete rotary encoder system with built-in microcontroller, USB interface, graphical LCD display, incremental indicators, commutation indicators and PWM output LED. The board is USB powered or externally supplied with a 9V battery for standalone operation. LCD display (for standalone mode) Knob with D5x2.5mm 9V battery connector diametral magnet, (standalone only) 2mm over the AS5X40 SiLabs C8051F320 microcontroller USB cable to the PC J6: External Encoder SSI Connector Quadrature A/B and Index output signal External (left) Onboard Onboard AS5x40 output signals connector and indicators: (right) encoder selection switch SW1 Figure 1: AS5X40 Demoboard hardware with mounted magnet knob 3 Operating the AS5X40 Demoboard The AS5X40 demoboard can be used in several ways: As standalone unit supplied by a 9V battery Connect a 9V battery to the battery connector on the top right side of the board. No other connections are required. As standalone unit supplied by an USB port Connect the demoboard to a PC using a USB/USB cable (included in demoboard shipment). The board is supplied by the 5V supply of the USB port. No other connections are required. As input device for the AS5000 Programmer GUI software This configuration uses the same USB hardware connection as above, but additionally the AS5000 Programmer GUI software is running. The LCD display will be turned off and the Angle/Multiturn/AGC will be displayed on the PC screen. Some extra features as pole pair, zero position or AGC programming can be achieved. The parameters will not be permanently programmed. All the parameters will be lost when the demoboard is shut down. For a permanent device programming, the AS5000 Programmer hardware should be used. Revision 1.0, 29.January 2009 Page 1 of 12 www.austriamicrosystems.com AS5X40 Demoboard OPERATIONAL MANUAL 3.1 Hardware Indicators and Connectors 3.1.1 Graphic LCD display The LCD display shows the realtime absolute angle position of the magnet with a resolution of 0.35 = 1024 positions per revolution (AS5X40) and the absolute value of the angle. Turning the knob clockwise will increase the angle value until 359,6 then 0. The magnet status indicator is related to the magnet position. If the magnet is too close to the encoder, Magnet too close will be displayed. If the magnet is too far away from the encoder, Magnet out of range will be displayed. Magnet indicator: Absolute angle value - OK (distance OK) 10 bit resolution: 0 to 1023 - Magnet out of range Bargraph representation of Magnet angle value: the angle (0 to 359.6) From 0 to 359.6 Figure 2: LCD display in standalone mode (9V battery or USB powered without GUI) 3.1.2 PWM LED This LED is connected to the PWM output of the AS5X40. The PWM output is a pulse width that is proportional to the angle of the magnet. The pulse width varies from 1s to 1024s with a repetition rate of 1.0 kHz. Viewing the PWM signal on the LED results in brightness, that is proportional to the angle of the magnet. When the angle of the magnet is at 0, the LED is almost dark, as it is 1s on and 1023s off. Turning the knob clockwise towards higher angles increases the brightness of the PWM LED, since the ON-pulse becomes longer and the OFF-pulse becomes shorter. Likewise, the PWM output can be used as an analog output proportional to the angle, when the PWM signal is filtered by a RC (or active) lowpass filter. The PWM signal (0 ~ 3V3) can be directly taken from the connector J4. 3.1.3 Incremental quadrature AB-Index LED The phase shift between channel A and B indicates the direction of the magnet movement. Channel A leads channel B at a clockwise rotation of the magnet (top view) by 90 electrical degrees. Channel B leads channel A at a counter clockwise rotation. One Index pulse (3V3) is generated at the angle 0 (see AS5X40 datasheet Figure 9) The AB-Index LEDs are directly connected to the A B Index outputs of the AS5X40. These quadrature signals (0 3V3) are available on connector J7. 3.1.4 MagINCn and MagDECn MagINCn and MagDECn are the magnetic field change indicators (magnetic field strength increase or decrease through variation of the distance between the magnet and the device). These outputs can be used to detect the valid magnetic field range. If both indicators lit simultaneously (MagINCn = 0 and MagDECn = 0), the magnet is out of range, the airgap between the encoder and the magnet is too high or too low. In that case, Magnet out of range will be displayed on the LCD display. Revision 1.0, 29-Jan-2009 www.austriamicrosystems.com Page 2 of 12