AMS AS5048 Eval-Kit Manual do kit - Página 11

Procurar online ou descarregar pdf Manual do kit para Acessórios AMS AS5048 Eval-Kit. AMS AS5048 Eval-Kit 16 páginas. 14-bit rotary position sensor with digital angle (interface) and pwm output
Também para AMS AS5048 Eval-Kit: Manual de operação (10 páginas), Manual do utilizador (12 páginas)

AS5048 Adapter Board
dat |= spiCalcEvenParity(dat) << 15;
spiTransfer((u8*)&dat, sizeof(u16));
}
magreg = dat;
#endif
for
(i = 0; i < 2; i++)
{
/* the result is available only just in the second transfer.
transfers must be separated by chip selects */
dat
= SPI_CMD_READ | SPI_REG_DATA;
dat |= spiCalcEvenParity(dat);
spiTransfer((u8*)&dat, sizeof(u16));
}
#ifdef
AS5048_CHIPDESCRIPTION
if
((dat & 0x4000) || (agcreg & 0x4000) || (magreg & 0x4000))
#else
if
(((dat >> 1) & 0x1) || ((agcreg >> 1) & 0x1))
#endif
{
/* error flag set - need to reset it */
dat
= SPI_CMD_READ | SPI_REG_CLRERR;
dat |= spiCalcEvenParity(dat);
spiTransfer((u8*)&dat, sizeof(u16));
}
else
{
#ifdef
AS5048_CHIPDESCRIPTION
dd->agc = agcreg & 0xff;
dd->value = dat & (currentChipDescription->positions - 31 - 1);
dd->angle = (dd->value * 360) / currentChipDescription->positions;
dd->magnitude = magreg & (currentChipDescription->positions - 31 - 1);
dd->alarmLo = (agcreg >> 10) & 0x1;
dd->alarmHi = (agcreg >> 11) & 0x1;
#else
dd->agc
= (agcreg >> 2) & 0x3F;
dd->value
= (dat >> 2) &
dd->angle
=
(dd->value
dd->alarmLo = (dat >> 14) & 0x1;
dd->alarmHi = (dat >> 15) & 0x1;
#endif
}
}
ams Eval Kit Manual, Confidential
[v1-3] 2014-Aug-01
(currentChipDescription->positions
* 360) / currentChipDescription->positions;
- 1);
Document Feedback
Page 11