2014-01-29 01:24 AM
Is it possible to get the 2's compliment of ADC input in STM32F407vg. If It is possible how it can be achieved
2014-01-29 03:21 AM
Hi
''Is it possible to get the 2's compliment of ADC input in STM32F407vg.'' Not sure what you are trying to ask here. Are you asking if the ADC can read negative voltages (and therefore return a negative number and what format will the number be in)?2014-01-29 07:52 AM
Your expressed goal is not clear, please try again or diagram
The ADC cannot measure negative voltages, and can't do anything with the data sample other than change the alignment. ie if the 12-bits fill the top or bottom half of a 16-bit word for example. The measurement from the ADC in 12-bit mode will fall in the 0x000 - 0xFFF (4095) range for an input in the 0 - 3V (VREF) range. If you need to add a DC bias to an AC signal to put it in the center of this range (1.5V) then you'll need to subtract 0x800 from the signed variable holding the measurement to get a 2's complement value to work with while processing the signal.