The K64 Reference manual states that the onboard 12-bit DACs on the TWR-K64F120M can be set to use DACREF_1 or DACREF_2. Where do I choose the voltages that determine DACREF_1 and DACREF_2?
Using jumper J29, I am able to choose V_BRD as:
But regardless of the jumper setting I use, setting the DACREF to 1 vs. 2 in software has little effect on the maximum DAC output. That is, if I use jumper setting 1-2, I get about 3.3 V out regardless of whether I set the DAC reference to DACREF_1 or DACREF_2 in software. And for jumper setting 7-8, I get about 1.8 V regardless of the software setting. Is there a way to independently set DACREF_1 and DACREF_2?
Hi Andy,
At first, you need to know DACREF_1 and DACREF_2 is what.
DACREF_1: VREF_OUT
DACREF_2:VDD.
The DAC refernce can be selected in the register DACx_C0[DACRFS], you can choose the VDD as your DAC reference voltage, then try the DAC convert.
About the code ,you can use our SDK_2.3_TWR-K64F120M which can be downloaded from this link:
Welcome | MCUXpresso SDK Builder
The dac code can be found in the folder:SDK_2.3_TWR-K64F120M\boards\twrk64f120m\driver_examples\dac
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I did find on pg 131 of the K64 Reference Manual that:
DACREF_1 = VREF_OUT
DACREF_2 = VDDA
It's not clear what VREF_OUT is though. How does it differ from VREFH?
Also, from the TWR-K64F120M schematic, it appears that VREFH is just an LC filtered version of VDDA. What are the typical uses cases for VREFH vs VDDA?
Hi Andy,
VREF_OUT is the Internally-generated Voltage Reference output, you can check K64 reference manual, Chapter 38
Voltage Reference (VREFV1).
VREFH is used for the ADC, DAC didn't use it, but normally, it recommended to connect to the VDDA.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------