AS5030 AB austriamicrosystems, AS5030 AB Datasheet - Page 8

BOARD ADAPTER AS5030

AS5030 AB

Manufacturer Part Number
AS5030 AB
Description
BOARD ADAPTER AS5030
Manufacturer
austriamicrosystems
Datasheets

Specifications of AS5030 AB

Sensor Type
Magnetic, Rotary Position
Sensing Range
360°
Interface
Serial
Voltage - Supply
5V
Embedded
No
Utilized Ic / Part
AS5030
Lead Free Status / RoHS Status
Lead free by exemption / RoHS compliant by exemption
Sensitivity
-
AS5030 8-bit Programmable Magnetic Rotary Encoder
Adapterboard Operation Manual
7 C-Source code, simple AGC & Angle read
void main()
{
}
short SerialRead(unsigned char command)
{
}
short void SSIread()
{
}
void SSIwrite(unsigned char command)
{
}
Revision 1.0, 26.February 2009
short SSI_Stream;
byte angle_value, agc_value;
float angle_degree;
SSI_Stream = SerialRead (0);
angle_value = (byte)(SSI_Stream & 0x00FF);
agc_value
angle_degree = (float)value *
short RX_buffer;
SET_CS();
delay_us(Delay_Serial);
SSIwrite(command);
DIO_HIGH_IMP();
RX_buffer
delay_us(Delay_Serial);
CLEAR_CS();
return RX_buffer;
xdata unsigned char current_bit;
short result;
result = 0;
for (current_bit = 16; current_bit; current_bit--)
{
}
return result;
unsigned char current_bit;
unsigned char this_bit
for (current_bit = 5; current_bit; current_bit--)
{
}
// This program reads the angle and AGC value from AS5030
result <<= 1;
delay_us(Delay_Serial);
result += (VAL_DIO) ? 1 : 0;
SET_CLK();
delay_us(Delay_Serial);
CLEAR_CLK();
this_bit = (command >> (current_bit-1)) & 0x01;
// If the current command bit is ‘1’:
if (this_bit)
else
if (current_bit == 1)
{
}
else
{
}
= (byte)((SSI_Stream >> 8) & 0x3F);
= SSIread();
// This function reads the 16-bit value from the AS5030 DIO pin
// Is the shift buffer for the 16 bit data receive
delay_us(Delay_Serial);
SET_CLK();
delay_us(Delay_Serial);
DIO_HIGH_IMP();
delay_us(Delay_Serial);
CLEAR_CLK();
// Else generate a CLK pulse to shift the data on DIO
delay_us(Delay_Serial);
SET_CLK();
delay_us(Delay_Serial);
CLEAR_CLK();
// Shift buffer value left 1 step (first time doesn’t count)
SET_DIO();
CLEAR_DIO();
www.austriamicrosystems.com
// If Last Bit has been written
// 16-bit value where the serial result will be saved
// 8-bit results: Angle and AGC
// Angle in degree
// Send command “READ” (command ‘00000’)
// and reads the 16-bit result from AS5030
(360/256);// Convert the 8-bit angle to degrees (0-360°)
// CS pin = ‘1’, AS5030 selected
// Send the command (exemple “READ” command ‘00000’)
// DIO output high impedance (input mode), ready to read
// Receive the 16bit result from the AS5030
// CS pin = ‘0’
// This function writes the 5-bit command to
// the AS5030 DIO pin
// This function writes the command
// and receives the result from the AS5030
// Small delay to be get the correct level on DIO
// If ‘1’ on DIO, store ‘1’ on the LSB else ‘0’
// Generate a CLK pulse to shift the data on DIO
// then send ‘1’ on DIO (push-pull output)
// Otherwise send ‘0’ on DIO (push-pull output)
// Set Clock
// And DIO output of CPU in input mode
// Clear Clock (datasheet timings)
// Extract the angle value (8 bit)
// Extract the AGC value (6 bit)
// 16 steps loop (16 bit data)
// 5 steps loop (5 bit command)
// Value of bit 5, then
// bit 4, …, bit 0
Page 8 of 10

Related parts for AS5030 AB