Hi, I'm using FRDM-KL26Z board with IAR EWARM 7.20.
I just bought this board and I'm new to it. I want to use the 16 bit ADC.
I'm curious whether the MCU can accept negative voltages at the ADC input pins.
For instance,
I want to plug a sine wave
(-1 ~ 1 volts peak-to-peak which has frequency of 1000) using a function generator.
Can the MCU read the negative voltages and convert it?
If so, what configurations are needed?
- Best Regards, David
Hi David Lee,
Now answer your questions.
Actually, the sign bit of the ADC data register is just for the diff mode, because just the diff mode has a pair of external pins, DADPx and DADMx, when do ADC diff conversion, it actually convert the DADPx-DADMx, if the DADPx higher than DADMx, the result is positive, if the DADPx is lower than DADMx, the result is negative, then it will use the sign bit.
Your problem is very simple to solve, you just need to use the 16 bit differential mode, connect "input 0" to DADPx, connect "input 1" to DADPMx, then you will get the diff data of your input0 and input1 in the ADC data register, and it should have the sign bit.
Wish it helps you!
If you still have question, please contact with me!
Have a great day,
Jingjing
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------