TI中文支持网
TI专业的中文技术问题搜集分享网站

c2000f28379 dac烧入buffdac_sine_cpu01官方历程,示波器检测不到信号

新建了工程,已经可以控制GPIO31和GPIO34的灯开关,但写入官方历程buffdac_sine_cpu01,DACOUTA(launchpad上30引脚)接示波器,并没有信号产生,我想知道是什么问题?这个官方历程需要改动什么吗?

历程如下

/###########################################################################

//
// FILE: buffdac_enable_cpu01.c
//
// TITLE: Buffered DAC Enable Output Example for F2837xD.
//
//! \addtogroup cpu01_example_list
//! <h1> Buffered DAC Enable (buffdac_enable) </h1>
//!
//! This example generates a voltage on the buffered DAC output,
//! DACOUTA/ADCINA0 (HSEC Pin 9) and uses the default DAC reference setting
//! of VDAC.
//!
//! When the DAC reference is set to VDAC, an external reference voltage
//! must be applied to the VDAC pin. This can accomplished by connecting a
//! jumper wire from 3.3V to ADCINB0 (HSEC pin 12).
//!
//
//###########################################################################
// $TI Release: F2837xD Support Library v3.05.00.00 $
// $Release Date: Thu Oct 18 15:48:42 CDT 2018 $
// $Copyright:
// Copyright (C) 2013-2018 Texas Instruments Incorporated – http://www.ti.com/
//
// Redistribution and use in source and binary forms, with or without// modification, are permitted provided that the following conditions// are met:
//// Redistributions of source code must retain the above copyright// notice, this list of conditions and the following disclaimer.
//// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the// documentation and/or other materials provided with the// distribution.
//// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// $
//###########################################################################

//
// Included Files
//
#include "F28x_Project.h"

//
// Globals
//
volatile struct DAC_REGS* DAC_PTR[4] = {0x0,&DacaRegs,&DacbRegs,&DaccRegs};
Uint16 dacval = 2048;

//
// Defines
//
#define REFERENCE_VDAC 0
#define REFERENCE_VREF 1
#define DACA 1
#define DACB 2
#define DACC 3
#define REFERENCE REFERENCE_VDAC
#define DAC_NUM DACA

//
// Function Prototypes
//
void configureDAC(Uint16 dac_num);

void main(void)
{
//
// Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the F2837xD_SysCtrl.c file.
//
InitSysCtrl();

//
// Disable CPU interrupts
//
DINT;

//
// Initialize the PIE control registers to their default state.
// The default state is all PIE interrupts disabled and flags are cleared.
// This function is found in the F2837xD_PieCtrl.c file.
//
InitPieCtrl();

//
// Clear all interrupts and initialize PIE vector table:
//
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();

//
// Configure DAC
//
configureDAC(DAC_NUM);

while(1)
{
DAC_PTR[DAC_NUM]->DACVALS.all = dacval;
DELAY_US(2);
}
}

//
// configureDAC – Configure specified DAC output
//
void configureDAC(Uint16 dac_num)
{
EALLOW;
DAC_PTR[dac_num]->DACCTL.bit.DACREFSEL = REFERENCE;
DAC_PTR[dac_num]->DACOUTEN.bit.DACOUTEN = 1;
DAC_PTR[dac_num]->DACVALS.all = 0;
DELAY_US(10); // Delay for buffered DAC to power up
EDIS;
}

//
// End of file
//

ziyi jiang:

回复 Green Deng:

是FLASH运行,但我不知道是VDAC还是DAC,您能帮我看看吗?
#include "F28x_Project.h"
#include "time.h"
#include "stdlib.h"
#define REFERENCE_VDAC0
#define REFERENCE_VREF1
#define DACA1
#define DACB2
#define DACC3
#define REFERENCEREFERENCE_VDAC
#define DAC_NUMDACA

新建了工程,已经可以控制GPIO31和GPIO34的灯开关,但写入官方历程buffdac_sine_cpu01,DACOUTA(launchpad上30引脚)接示波器,并没有信号产生,我想知道是什么问题?这个官方历程需要改动什么吗?

历程如下

/###########################################################################

//
// FILE: buffdac_enable_cpu01.c
//
// TITLE: Buffered DAC Enable Output Example for F2837xD.
//
//! \addtogroup cpu01_example_list
//! <h1> Buffered DAC Enable (buffdac_enable) </h1>
//!
//! This example generates a voltage on the buffered DAC output,
//! DACOUTA/ADCINA0 (HSEC Pin 9) and uses the default DAC reference setting
//! of VDAC.
//!
//! When the DAC reference is set to VDAC, an external reference voltage
//! must be applied to the VDAC pin. This can accomplished by connecting a
//! jumper wire from 3.3V to ADCINB0 (HSEC pin 12).
//!
//
//###########################################################################
// $TI Release: F2837xD Support Library v3.05.00.00 $
// $Release Date: Thu Oct 18 15:48:42 CDT 2018 $
// $Copyright:
// Copyright (C) 2013-2018 Texas Instruments Incorporated – http://www.ti.com/
//
// Redistribution and use in source and binary forms, with or without// modification, are permitted provided that the following conditions// are met:
//// Redistributions of source code must retain the above copyright// notice, this list of conditions and the following disclaimer.
//// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the// documentation and/or other materials provided with the// distribution.
//// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// $
//###########################################################################

//
// Included Files
//
#include "F28x_Project.h"

//
// Globals
//
volatile struct DAC_REGS* DAC_PTR[4] = {0x0,&DacaRegs,&DacbRegs,&DaccRegs};
Uint16 dacval = 2048;

//
// Defines
//
#define REFERENCE_VDAC 0
#define REFERENCE_VREF 1
#define DACA 1
#define DACB 2
#define DACC 3
#define REFERENCE REFERENCE_VDAC
#define DAC_NUM DACA

//
// Function Prototypes
//
void configureDAC(Uint16 dac_num);

void main(void)
{
//
// Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the F2837xD_SysCtrl.c file.
//
InitSysCtrl();

//
// Disable CPU interrupts
//
DINT;

//
// Initialize the PIE control registers to their default state.
// The default state is all PIE interrupts disabled and flags are cleared.
// This function is found in the F2837xD_PieCtrl.c file.
//
InitPieCtrl();

//
// Clear all interrupts and initialize PIE vector table:
//
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();

//
// Configure DAC
//
configureDAC(DAC_NUM);

while(1)
{
DAC_PTR[DAC_NUM]->DACVALS.all = dacval;
DELAY_US(2);
}
}

//
// configureDAC – Configure specified DAC output
//
void configureDAC(Uint16 dac_num)
{
EALLOW;
DAC_PTR[dac_num]->DACCTL.bit.DACREFSEL = REFERENCE;
DAC_PTR[dac_num]->DACOUTEN.bit.DACOUTEN = 1;
DAC_PTR[dac_num]->DACVALS.all = 0;
DELAY_US(10); // Delay for buffered DAC to power up
EDIS;
}

//
// End of file
//

ziyi jiang:

回复 Green Deng:

没有改过历程,输出引脚是序号为30的ADCINA0,那我是不是只需要连接做跳线从ADCINB0到3.3就好了?但我并没有再板子上找到ADCINB0,您能告诉我在哪吗?
谢谢您,
BEST
ZIYI JIANG

新建了工程,已经可以控制GPIO31和GPIO34的灯开关,但写入官方历程buffdac_sine_cpu01,DACOUTA(launchpad上30引脚)接示波器,并没有信号产生,我想知道是什么问题?这个官方历程需要改动什么吗?

历程如下

/###########################################################################

//
// FILE: buffdac_enable_cpu01.c
//
// TITLE: Buffered DAC Enable Output Example for F2837xD.
//
//! \addtogroup cpu01_example_list
//! <h1> Buffered DAC Enable (buffdac_enable) </h1>
//!
//! This example generates a voltage on the buffered DAC output,
//! DACOUTA/ADCINA0 (HSEC Pin 9) and uses the default DAC reference setting
//! of VDAC.
//!
//! When the DAC reference is set to VDAC, an external reference voltage
//! must be applied to the VDAC pin. This can accomplished by connecting a
//! jumper wire from 3.3V to ADCINB0 (HSEC pin 12).
//!
//
//###########################################################################
// $TI Release: F2837xD Support Library v3.05.00.00 $
// $Release Date: Thu Oct 18 15:48:42 CDT 2018 $
// $Copyright:
// Copyright (C) 2013-2018 Texas Instruments Incorporated – http://www.ti.com/
//
// Redistribution and use in source and binary forms, with or without// modification, are permitted provided that the following conditions// are met:
//// Redistributions of source code must retain the above copyright// notice, this list of conditions and the following disclaimer.
//// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the// documentation and/or other materials provided with the// distribution.
//// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// $
//###########################################################################

//
// Included Files
//
#include "F28x_Project.h"

//
// Globals
//
volatile struct DAC_REGS* DAC_PTR[4] = {0x0,&DacaRegs,&DacbRegs,&DaccRegs};
Uint16 dacval = 2048;

//
// Defines
//
#define REFERENCE_VDAC 0
#define REFERENCE_VREF 1
#define DACA 1
#define DACB 2
#define DACC 3
#define REFERENCE REFERENCE_VDAC
#define DAC_NUM DACA

//
// Function Prototypes
//
void configureDAC(Uint16 dac_num);

void main(void)
{
//
// Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the F2837xD_SysCtrl.c file.
//
InitSysCtrl();

//
// Disable CPU interrupts
//
DINT;

//
// Initialize the PIE control registers to their default state.
// The default state is all PIE interrupts disabled and flags are cleared.
// This function is found in the F2837xD_PieCtrl.c file.
//
InitPieCtrl();

//
// Clear all interrupts and initialize PIE vector table:
//
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();

//
// Configure DAC
//
configureDAC(DAC_NUM);

while(1)
{
DAC_PTR[DAC_NUM]->DACVALS.all = dacval;
DELAY_US(2);
}
}

//
// configureDAC – Configure specified DAC output
//
void configureDAC(Uint16 dac_num)
{
EALLOW;
DAC_PTR[dac_num]->DACCTL.bit.DACREFSEL = REFERENCE;
DAC_PTR[dac_num]->DACOUTEN.bit.DACOUTEN = 1;
DAC_PTR[dac_num]->DACVALS.all = 0;
DELAY_US(10); // Delay for buffered DAC to power up
EDIS;
}

//
// End of file
//

郭盖:

回复 Green Deng:

你好:
请问烧写进ram可以吗?
另外我也找不到ADCINB0

赞(0)
未经允许不得转载:TI中文支持网 » c2000f28379 dac烧入buffdac_sine_cpu01官方历程,示波器检测不到信号
分享到: 更多 (0)