austriamicrosystems AG
is now
ams AG
The technical content of this austriamicrosystems application note is still valid.
Contact information:
Headquarters:
ams AG
Tobelbaderstrasse 30
8141 Unterpremstaetten, Austria
Tel: +43 (0) 3136 500 0
e-Mail:
ams_sales@ams.com
Please visit our website at
www.ams.com
AS5045 / AS5145 Demoboard
1 General Overview
Operation Manual
Note: AS5145A/B are pre-programmed versions of AS5145. It provides 10bit (A) or 12bit (B) incremental output.
2 The AS5045/AS5145A/B Demoboard
The AS5x45 demoboard is a complete rotary encoder system with built-in microcontroller, USB interface, graphical LCD
display 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
diametral magnet,
2mm over the AS5x45
J6: External Encoder
SSI Connector
ch
ni
c
3 Operating the AS5045/AS5145A/B Demoboard
The AS5x45 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
Te
Revision 1.3, 22-Jul-2009
www.austriamicrosystems.com
am
al
co s
A
nt G
en
ts
til
lv
9V battery connector
(standalone only)
SiLabs C8051F320
microcontroller
USB cable to the PC
External (left) – Onboard (right)
encoder selection switch SW1
Onboard AS5x45 output signals connector and indicators
MagINCn, MagDECn (J7) and PWM (J4) only are available with AS5045 and AS5145
Figure 1: AS5x45 Demoboard hardware with mounted magnet knob
Page 1 of 12
The AS5045/AS5145A/B 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 magnet’s angular position with a resolution of
0.0879° = 4096 positions per revolution. This digital data is available as a serial bit stream and as a PWM signal.
An internal voltage regulator allows the AS5045/AS5145A/B to operate at either 3.3 V or 5 V supplies
al
id
AS5X45/AS5145A/B Demoboard OPERATIONAL MANUAL
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/Status bits will be displayed on the PC screen.
Some extra features as zero position 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.
3.1
Graphic LCD display
The LCD display shows the realtime absolute angle position of the magnet with a resolution of 0.09° = 4096 positions
per revolution (AS5045/AS5145A/B) and the absolute value of the angle.
Turning the knob clockwise will increase the angle value until 359.9° (value 4095), then 0°.
The magnet status indicator is related to the magnet position. If the magnet is too close or too far away from the
encoder, “Magnet out of range” will be displayed.
Bargraph representation of
the angle (0° to 359.9°)
Figure 2: LCD display in standalone mode (9V battery or USB powered without GUI)
3.2
PWM LED
The PWM LED is connected to the PWM output of the AS5045/AS5145A/B. The PWM output is a pulse width that is
proportional to the angle of the magnet.
The pulse width varies from 1µs to 4096µs with a repetition rate of 244Hz. 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 1µs on and 4095µs 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 (digital 0 ~ 3.3V) can be directly taken from the connector J4.
3.3
MagINc 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.
Te
Revision 1.3, 22-Jul-2009
ch
ni
c
am
al
co s
A
nt G
en
ts
til
lv
Magnet angle value
from 0° to 359.9°
www.austriamicrosystems.com
Page 2 of 12
Magnet indicator:
- Distance OK
- Magnet out of range
Absolute angle value
12 bit resolution: 0 to 4095
al
id
3.4
Encoder selection switch
The switch SW1 selects the encoder which communicates with the microcontroller through the SSI bus:
1.
2.
Right position (default):
Onboard AS5045/AS5145A/B
Left Position:
External AS5045/AS5145A/B connected on J6
The signals of the synchronous serial interface (DO, CLK, CSn, PROG) and the power supply (3.3V,
GND) of an external device can be connected directly to J6. In this configuration, the data of the serial
interface are displayed on the GUI or the LCD.
•
In standalone mode, regardless to the demoboard type (AS5045, AS5145A/B), AS5045 and AS5145A/B
can be attached to J6 and evaluated. See figure 3.
•
If the GUI is used for operation, additional devices AS5040, AS5140, AS5043 and AS5143 can be
connected to J6 and evaluated. In that case, the correct encoder must be selected instead of “Autoselect” in
the Device list of the PC software, see chapter 4.2 figure 4.
Te
Revision 1.3, 22-Jul-2009
www.austriamicrosystems.com
ch
ni
c
am
al
co s
A
nt G
en
ts
til
lv
Demoboard switched to external
encoder mode
Figure 3: external AS5045/AS5145A/B connection to the demoboard
Page 3 of 12
al
id
4 AS5000 Programmer GUI software
4.1
Installing the GUI on the PC
The preliminary software is developed for a Microsoft Windows XP operating system with Service Pack 2. In addition
the dotnet (.NET) framework version 2.0 or more must be installed on the PC. This package can be downloaded free of
charge from the Microsoft webpage:
http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en
Following Procedure is recommended before starting the GUI:
4.2
The Home tab
Figure 3 shows the main window of the GUI. On the top left corner, board information’s as firmware (FW) version and
demoboard name declaration can be found.
By default the GUI is in the auto detection mode. Any connected austriamicrosystems demoboard and programming tool will
be automatically detected and the device type is displayed in the right top corner of the main window. The GUI is divided into
three main sections HOME, SSI and OTP.
Te
Revision 1.3, 22-Jul-2009
www.austriamicrosystems.com
ch
ni
c
am
al
co s
A
nt G
en
ts
til
lv
Device selection list:
Change the encoder type if a different encoder type is
connected externally on J6 and SW1 on left position
Figure 4: AS5000 GUI has detected the AS5045 Demoboard
Page 4 of 12
al
id
1.
2.
3.
4.
check on your PC if Service Pack 2 is installed
install the mentioned .NET package to your computer
execute setup.exe
Finally start the GUI using the shortcut in the start menu or desktop.