This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28379D: STL官方安全诊断库进行ADC测试,DAC-A无输出数据

Part Number: TMS320F28379D
Other Parts Discussed in Thread: LAUNCHXL-F28379D

运行STL官方安全诊断库中的ADC的12为分辨率,无DMA的测试程序,使能DAC-A输出,设置值为2048。在LAUNCHXL-F28379D开发板上通过连接ADCINA0引脚和ADCINA1引脚,在CCS12上Debug,全速运行程序,观察寄存器值窗口的ADC结果寄存器的值,始终处于ADC未采集到数据的结果,怀疑DAC发送的数据始终为0,而不是2048。尝试使用EPWM和GPIO连接到ADC的ADCINA1引脚进行采集,其结果寄存器的值是正确的。请问这种情况应该怎么处理?

  • 我咨询下相关资深工程师后回复您。

  • 参考下工程师的回复:

    I believe the code by default uses VDAC for the DAC reference voltage. When running on a controlCARD, it is expected that you will connect this reference voltage in addition to connecting the ADC pins. As far as I can tell, this pin isn't available on the LaunchPad. See the thread below:

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/867853/launchxl-f28379d-vdac-vrefhi-of-the-buffered-dac

    I suspect you'll need to update the DAC configuration in the software to use a different reference voltage.

  • 我按照您所说的方法更新了DAC的配置,将参考基准电压修改为ADC_VREFHI,运行并调试程序,DAC可以正常输出了。

    但是程序循环连续运行时,在Debug窗口中观察ADC结果寄存器的值时发现,其值一直为DAC输出的0和2048的数据。4095的值没有读取到。我尝试了在程序中进行断点调试,三个值都正确的接收并读取了,测试成功通过。程序中在STL_ADC_test函数中将delay的while循环屏蔽掉,从而不进行超时操作。

    怀疑是DAC在输出第一个值0时,actualResult读取ADC结果寄存器的值为0,输出第二个值2048时,actualResult读取的ADC结果寄存器的值时为DAC输出第一个值0的偏移校准后的值,与2048的差值在300之外,导致测试失败退出DAC输出循环,从而第三个值没有输出。

    我该如何进行处理可以使程序连续循环进行三个值都可以在正确范围内读取到并ADC测试通过。

  • 有一个很奇怪的问题,我这里按照官方例程文件对我工程内的DAC进行配置,给4095,但是DAC一直没有输出幅值,而在官方例程工程中,DAC是正常输出,所以我想问问我这可能会是工程文件什么问题吗(我串口,sci通信,定时器中断都没问题),有没有什么关于DAC的配置没开

  • #include "mydac.h"
    #include "device.h"
    #include "dac.h"

    //
    // Configure DAC - Setup the reference voltage and output value for the DAC
    //
    void configureDAC(void)
    {
    //
    // Set VDAC as the DAC reference voltage.
    // Edit here to use ADC VREF as the reference voltage.
    //
    DAC_setReferenceVoltage(DACA_BASE, DAC_REF_ADC_VREFHI);

    //
    // Enable the DAC output
    //
    DAC_enableOutput(DACA_BASE);
    //
    // Set the DAC shadow output to 0
    //
    DAC_setShadowValue(DACA_BASE, 4095);

    //
    // Delay for buffered DAC to power up
    //
    DEVICE_DELAY_US(10);
    }

  • 你好,新问题请重新发帖提问,感谢理解

  • 我跟进一下