+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Full Member level 6
    Points: 3,339, Level: 13
    Achievements:
    7 years registered

    Join Date
    Jul 2010
    Location
    Germany
    Posts
    335
    Helped
    58 / 58
    Points
    3,339
    Level
    13

    Real use of left and right alignment in ADC

    Hello edaboard members,

    I am using STM32F103. I want to know what is the real use of a left and right alignment of adc result. How does it help? What should be chosen ideally?

    I googled but unfortunately could not get a concrete answer.

    Thanks in advance,
    Embedded_Geek
    "I have no special talents. I am only passionately curious." Albert Einstein

    Regards,
    Embedded_Geek

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 5
    Points: 9,145, Level: 22
    Achievements:
    7 years registered
    Easyrider83's Avatar
    Join Date
    Oct 2011
    Location
    Tallinn, Estonia
    Posts
    1,599
    Helped
    365 / 365
    Points
    9,145
    Level
    22

    Re: Real use of left and right alignment in ADC

    For 10 bit adc, if you need all 10 bits you are reading low and high value of conversion result using right alignment. If you need only 8 bits, you use left alignment and take only high value.
    Love me or hate me. All infractions will be ignored.



    •   AltAdvertisement

        
       

  3. #3
    Super Moderator
    Points: 77,851, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,777
    Helped
    3592 / 3592
    Points
    77,851
    Level
    68

    Re: Real use of left and right alignment in ADC

    Hi,

    Some think in LSBs. They like to use right aligned ADC values.

    I like to think in "full scale" ...i like left aligned.

    Some ADCs are available in 12, 14, 16 bit versions. If you use left aligned you don't need to change code.

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisement

        
       

  4. #4
    Banned
    Points: 78, Level: 1

    Join Date
    Sep 2019
    Location
    nepal
    Posts
    10
    Helped
    2 / 2
    Points
    78
    Level
    1

    Re: Real use of left and right alignment in ADC

    Real use of left and right alignment in ADC For 10 bit adc, if you need all 10 bits you are reading low and high value of conversion result using right alignment. If you need only 8 bits, you use left alignment and take only high value.To explain the use of the ADC, let's look at a basic example taking a single reading. ... ADFM = 1; //ADC result is right justified ADCON0bits. ... to the left by 8 and adding the ADRESL.If we do not wait at least 5us, the reading will be lower than the actual voltage applied to the pin.



--[[ ]]--