TWR-K60F120M DAC problems

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

TWR-K60F120M DAC problems

跳至解决方案
1,291 次查看
acurtis
Contributor II

My company is evaluating Kinetis chips for an new project.  I've just recently started working with the TWR-K60F120M tower kit via Kinetis Design Studio and have been quite successful so far (interfacing with UART, ADC, misc Timer configs, etc...); however, I am having trouble getting output from the DACs.  In KDS, I select the DAC component in the Components Library (DA1=DAC0, DA2=DAC1), use defauls (right justified/unsigned, enable on init, pin output enabled, etc...), generate the code and have adapted mainline code from the component  "Typical Usage"  help page (see below).  I receive no compilation errors and debugging shows that my code seems to be doing what I want...except I'm not getting any output...  I'm probing pins A32 (DAC0_OUT) and B32 (DAC1_OUT) on the edge connector, using TP17(GND) as my probe ground and I'm expecting to see a sawtooth, but no dice.

Has anyone had similar issues or provide some assistance with my problem?  Any feedback is greatly appreciated.

    word i = 0;

    for(;;) {

      if (i==4095) {

        i=0;

      } else {

        i++;

      }

      DA1_SetValue(&i);

      DA2_SetValue(&i);

    }

Regards,

Aaron

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
1,144 次查看
acurtis
Contributor II

I solved my problem:

1. It was necessary to change the "voltage reference source" of DacLdd1 and DacLdd2 from "internal" to "external".  This got some output, but the peak voltage was quite low (a couple hundred millivolts)...

2. DAX_SetValue() seems to do a four bit right shift (>>4) of shorts/words to set the 12 bit DAC output.  Changing the "I" rollover point from 4095 to 65535 get me the 3.3V sawtooth I expected.

Hope this helps someone else down the line.

Regards,

Aaron

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,145 次查看
acurtis
Contributor II

I solved my problem:

1. It was necessary to change the "voltage reference source" of DacLdd1 and DacLdd2 from "internal" to "external".  This got some output, but the peak voltage was quite low (a couple hundred millivolts)...

2. DAX_SetValue() seems to do a four bit right shift (>>4) of shorts/words to set the 12 bit DAC output.  Changing the "I" rollover point from 4095 to 65535 get me the 3.3V sawtooth I expected.

Hope this helps someone else down the line.

Regards,

Aaron

0 项奖励
回复