- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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