You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alignment determines how the binary will end up in the hardware register. Suppose you have a 16 bit resolution register (or 2x8 bits) but only 12 bit ADC resolution. Your option is then either to get:
XXXX DDDD DDDD DDDD
or
DDDD DDDD DDDD XXXX
Where "D" is your data bits and "X" is "don't care" bits (usually filled with zeroes). The form requiring the least amount of bitwise arithmetic to get to your desired format is usual the preferred one. One will contain the need to shift, the other won't.
This in turn depends on endianess - the byte order. If the ADC is using the same endianess as your CPU then you'd pick the one matching best. In case of STM32 little endian that probably means the 2nd of the two forms. Built-in ADCs in microcontrollers typically have the same endianess as the CPU. In case of external ones, it could have either big or little endian.
Source: electronics.stackexchange
The text was updated successfully, but these errors were encountered:
Alignment determines how the binary will end up in the hardware register. Suppose you have a 16 bit resolution register (or 2x8 bits) but only 12 bit ADC resolution. Your option is then either to get:
Where "D" is your data bits and "X" is "don't care" bits (usually filled with zeroes). The form requiring the least amount of bitwise arithmetic to get to your desired format is usual the preferred one. One will contain the need to shift, the other won't.
This in turn depends on endianess - the byte order. If the ADC is using the same endianess as your CPU then you'd pick the one matching best. In case of STM32 little endian that probably means the 2nd of the two forms. Built-in ADCs in microcontrollers typically have the same endianess as the CPU. In case of external ones, it could have either big or little endian.
Source: electronics.stackexchange
The text was updated successfully, but these errors were encountered: