Interfacing with the AMS AS5048A magnetic rotary sensor using SPI protocol AS5048 uses 16-bit transfer; We use two 8-bit transfers for compatibility with 8-bit SPI master devices SPI protocol: Mode = 1: clock polarity = 0 --> clock pulse is high clock phase = 1 --> sample on falling edge of clock pulse Code was succesfully tested on the FRDM KL25Z and K22F.
More...
Update the buffer with angular measurements NOTE 1: If the last command sent through Transfer was *not* AS_CMD_ANGLE then we need an additional Transfer; this takes more time! This should not occur, since Transfer is not *yet* used elsewhere.
SPI transfer between each of the daisy chained sensors.
Detailed Description
Interfacing with the AMS AS5048A magnetic rotary sensor using SPI protocol AS5048 uses 16-bit transfer; We use two 8-bit transfers for compatibility with 8-bit SPI master devices SPI protocol: Mode = 1: clock polarity = 0 --> clock pulse is high clock phase = 1 --> sample on falling edge of clock pulse Code was succesfully tested on the FRDM KL25Z and K22F.
The same code fails on the K64F for some reason. Sampling using a logic analyzer does however show the same results for al three boards.
Update the buffer with angular measurements NOTE 1: If the last command sent through Transfer was *not* AS_CMD_ANGLE then we need an additional Transfer; this takes more time! This should not occur, since Transfer is not *yet* used elsewhere.
NOTE 2: We run a parity check on the results from the transfer. We only update the angle_buffer_ with values that pass the parity check. Measurement using Timer on K64F for last_command_ == AS_CMD_ANGLE shows this function takes 87 or 88 us.
This site uses cookies to store information on your computer.
By continuing to use our site, you consent to our cookies.
If you are not happy with the use of these cookies, please review our
Cookie Policy
to learn how they can be disabled.
By disabling cookies, some features of the site will not work.
Access Warning
You do not have the correct permissions to perform this operation.