Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
AlVa_264671
Level 5
Level 5
25 sign-ins First like given First like received

Hi  there

I always used ADC Delta sigma. This is my firs time  with Sar ADC.

I have attached a simple project  where the  minus Sar's input is  hooked up to  Vref/2

From a pot I change the + input volatge between  Vssa and Vdda.

I don't know what I am missing but I expect get negative values when V+ - V-   is negative  and positive values when the diference is positive.

I just got values from  0 couts  to 4095 counts  when the positive input  is from 0v to 3.3v ,in this case.

Please see attached project.

Thank you in advance

0 Likes
1 Solution
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi Alejandro,

The problem with your code is that ADC_SAR_1_SAR_WRK0_PTR register is not sign extended; the result is always unsigned. You can use ADC_SAR_1_GetResult16(); API inside the ISR which will return a signed result .

Best Regards,

VRS

View solution in original post

0 Likes
4 Replies