+ Post New Thread
Results 1 to 2 of 2
  1. #1
    Full Member level 5
    Points: 2,506, Level: 11
    Achievements:
    7 years registered

    Join Date
    May 2012
    Posts
    251
    Helped
    10 / 10
    Points
    2,506
    Level
    11

    Signed fractional format ADC dspic33EV

    I am referring to the microchip dspic33ep micro controller. I am trying to read the adc of the pot, the adc is initialized for signed fractional format and in the data sheet it is shown as Click image for larger version. 

Name:	signedFractional.JPG 
Views:	3 
Size:	14.0 KB 
ID:	156559. The test point at POT reads 3.3V and when i debug the variable is 32736 which when converted into binary will be
    Code:
     0111 1111 1110 0000
    My first doubt is the number of zeros are 5 but in the data sheet image is should be 6. Why is the difference?
    Second doubt i want to get the original voltage at the ADC of X (32736) value, i will right shift X by 6 bits. 512 value corresponds to 3.3V then X >> 6 correponds to what voltage? (X >> 6) * 3.3/512? Am I correct and any other methods available? Please advise.

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 4
    Points: 7,900, Level: 21

    Join Date
    Jan 2015
    Posts
    1,108
    Helped
    348 / 348
    Points
    7,900
    Level
    21

    Re: Signed fractional format ADC dspic33EV

    Exactly which MCU do you have (you have mentioned dsPIC33EV and dsPIC33EP - but the next characters may or may not be significant)?
    Do you have it set for 10-bit or 12-bit? Showing us the configuration for the ADC would help here.
    AS for how to interpret the value, have you looked at the ADC FRM section that is appropriate for your device?
    Susan



--[[ ]]--