AS5045 12-BIT PROGRAMMABLE MAGNETIC ROTARY ENCODER
Revision 1.2, 03-Oct-06 www.austriamicrosystems.com Page 8 of 23
7 Programming the AS5045
After power-on, programming the AS5045 is enabled with
the rising edge of CSn and Prog = logic high. 16 bit
configuration data must be serially shifted into the OTP
register via the Prog pin. The first “CCW” bit is followed
by the zero position data (MSB first) and the Mode
setting bits. Data must be valid at the rising edge of CLK
(see Figure 9).
After writing the data into the OTP register it can be
permanently programmed by rising the Prog pin to the
programming voltage VPROG. 16 CLK pulses (tPROG) must
be applied to program the fuses (Figure 10). To exit the
programming mode, the chip must be reset by a power-
on-reset. The programmed data is available after the
next power-up.
Note: During the programming process, the transitions in
the programming current may cause high voltage spikes
generated by the inductance of the connection cable. To
avoid these spikes and possible damage to the IC, the
connection wires, especially the signals Prog and VSS
must be kept as short as possible. The maximum wire
length between the VPROG switching transistor and pin
Prog should not exceed 50mm (2 inches). To suppress
eventual voltage spikes, a 10nF ceramic capacitor should
be connected close to pins VPROG and VSS. This
capacitor is only required for programming, it is not
required for normal operation. The clock timing tclk must
be selected at a proper rate to ensure that the signal
Prog is stable at the rising edge of CLK (see Figure 9).
Additionally, the programming supply voltage should be
buffered with a 10µF capacitor mounted close to the
switching transistor. This capacitor aids in providing peak
currents during programming. The specified programming
voltage at pin Prog is 7.3 – 7.5V (see section 15.2).
To compensate for the voltage drop across the VPROG
switching transistor, the applied programming voltage
may be set slightly higher (7.5 - 8.0V, see Figure 11).
OTP Register Contents:
CCW Counter Clockwise Bit
ccw=0 – angular value increases in clockwise direction
ccw=1 – angular value increases in counterclockwise
direction
Z [11:0]: Programmable Zero Position
PWM dis: Disable PWM output
MagCompEn: when set, activates LIN alarm both
when magnetic field is too high and
too low (see Table 5).
PWMhalfEn: when set, PWM frequency is 122Hz or
2µs / step (when PWMhalfEN = 0,
PWM frequency is 244Hz, 1µs / step)
7.1 Zero Position Program ming
Zero position programming is an OTP option that
simplifies assembly of a system, as the magnet does not
need to be manually adjusted to the mechanical zero
position. Once the assembly is completed, the
mechanical and electrical zero positions can be matched
by software. Any position within a full turn can be defined
as the permanent new zero position.
For zero position programming, the magnet is turned to
the mechanical zero position (e.g. the “off”-position of a
rotary switch) and the actual angular value is read.
This value is written into the OTP register bits Z11:Z0
(see Figure 9) and programmed as described in
section 7.
Note: The zero position value may also be modified
before programming, e.g. to program an electrical zero
position that is 180° (half turn) from the mechanical zero
position, just add 2048 to the value read at the
mechanical zero position and program the new value into
the OTP register.
7.2 Repeated OTP Programming
Although a single AS5045 OTP register bit can be
programmed only once (from 0 to 1), it is possible to
program other, unprogrammed bits in subsequent
programming cycles. However, a bit that has already
been programmed should not be programmed twice.
Therefore it is recommended that bits that are already
programmed are set to “0” during a programming cycle.
7.3 Non-permanent Programming
It is also possible to re-configure the AS5045 in a non-
permanent way by overwriting the OTP register.
This procedure is essentially a “Write Data” sequence
(see Figure 9) without a subsequent OTP programming
cycle.
The “Write Data” sequence may be applied at any time
during normal operation. This configuration remains set
while the power supply voltage is above the power-on
reset level (see 14.6).
See Application Note AN5000-20 for further information.