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: Use DAC A and DAC B at the same time

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

Hi everyone,

I implemented the TMS320f228379D LAB11 and it worked fine. 

But I want to use DAC A and DAC B at the same time.
I made an edit (change) on this work as follows;

    ADC data will be read from AA3 and AA4 pins.
    ADC data read from AA3 and AA4 pins will be transferred as DAC data from AA0 and AA1 pins, respectively.
But I can't get DAC data from AA0 pin.

My DAC configuration part is as follows;

void InitDac(void)
{
asm(" EALLOW"); // Enable EALLOW protected register access

CpuSysRegs.PCLKCR16.bit.DAC_A=1;
DacaRegs.DACCTL.all = 0x0001;
DacaRegs.DACVALS.all = 0x0000; // DACVALS = bits 11-0, bits 15-12 reserved
DacaRegs.DACOUTEN.bit.DACOUTEN = 1; // DAC output enable, 0=disable, 1=enable

DacaRegs.DACLOCK.all = 0x0000; // Write a 1 to lock (cannot be cleared once set)


CpuSysRegs.PCLKCR16.bit.DAC_B = 1;
DacbRegs.DACCTL.all = 0x0001;
DacbRegs.DACVALS.all = 0x0800; // DACVALS = bits 11-0, bits 15-12 reserved
DacbRegs.DACOUTEN.bit.DACOUTEN = 1; // DAC output enable, 0=disable, 1=enable

DacbRegs.DACLOCK.all = 0x0000; // Write a 1 to lock (cannot be cleared once set)

asm(" EDIS"); // Disable EALLOW protected register access

} // end of InitDac()

I am thankful for any hint and advice.

Best regards...

  • Hi,

    Did you try running any of the DAC examples present under c2000Ware? You can check the basic confiuration for DAC from these examples.

    Location: C:\ti\c2000\C2000Ware_4_00_00_00\device_support\f2837xd\examples\cpu1

    Examples: buffdac_enable, buffdac_ramp, buffdac_random, buffdac_square, buffdac_sine_dma

    Let me know if you face any problem in trying these examples.

    Thanks
    Vasudha

  • Hi,

    I examined the examples you mentioned, but I encountered the problem as follows.
    Transferring data to output with only DACa or only DACB is successful, but ccs stops working

    when trying to output from both DACs (DACA and DACB) at the same time.

    In addition, DAC configuration code is as follows,

    void InitDac(void)
    {
    asm(" EALLOW"); // Enable EALLOW protected register access


    CpuSysRegs.PCLKCR16.bit.DAC_B = 1; // enable DAC_B clock
    DacbRegs.DACCTL.bit.DACREFSEL = 1; // Use ADC references
    DacbRegs.DACCTL.bit.LOADMODE = 0; // Load on next SYSCLK
    DacbRegs.DACVALS.all = 0x0000; // Set mid-range
    DacbRegs.DACOUTEN.bit.DACOUTEN = 1; // Enable DAC

    CpuSysRegs.PCLKCR16.bit.DAC_A = 1; // enable DAC_A clock
    DacaRegs.DACCTL.bit.DACREFSEL = 1; // use ADC VREFHI instead of an external signal
    DacaRegs.DACCTL.bit.LOADMODE = 0; // load on SysClk not PWMSYNC (PWM not yet enabled)
    DacaRegs.DACOUTEN.bit.DACOUTEN = 1; // enable output
    DacaRegs.DACVALS.all = 0; // output = 0

    DelayUs(1000);
    asm(" EDIS"); // Disable EALLOW protected register access

    }

  • Hi,

    Can you explain more about the issue? What do you mean by CCS stops working when trying run both the DACs? 

    Thanks
    Vasudha