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.

TMS320F280023: DEVICE_DELAY_US() 问题

Part Number: TMS320F280023

280025程序ADC初始化如下程序:

//
// Reset the ADCs
//
SysCtl_resetPeripheral(SYSCTL_PERIPH_RES_ADCA);
SysCtl_resetPeripheral(SYSCTL_PERIPH_RES_ADCC);

//
// Disable converters during configuration
//
ADC_disableConverter(ADCA_BASE);
ADC_disableConverter(ADCC_BASE);

//
// Set for VREF internal 3.3V - Must set ADC C voltage reference the same
// as ADC B voltage reference on double-bonded devices. See datasheet
// section 5.10 Analog Peripherals.
//
ADC_setVREF(ADCA_BASE, ADC_REFERENCE_INTERNAL, ADC_REFERENCE_3_3V);
ADC_setVREF(ADCC_BASE, ADC_REFERENCE_INTERNAL, ADC_REFERENCE_3_3V);

//
// ADCCLK max = 50 MHz, SYSCLK = 100 MHz -> Prescaler = 2.0
//
ADC_setPrescaler(ADCA_BASE, ADC_CLK_DIV_2_0);
ADC_setPrescaler(ADCC_BASE, ADC_CLK_DIV_2_0);

//
// SOC configuration, sample all values on EPWM SOCA
//

ADC_setupSOC(LLC_ADCCTLBASE_ISEC, LLC_ADCSOC_ISEC, ADC_TRIGGER_EPWM2_SOCA,
LLC_ADCIN_ISEC, 8);
ADC_setupSOC(LLC_ADCCTLBASE_IPRIRESO,
LLC_ADCSOC_IPRIRESO, ADC_TRIGGER_EPWM2_SOCA,
LLC_ADCIN_IPRIRESO, 8);
ADC_setupSOC(LLC_ADCCTLBASE_VSEC, LLC_ADCSOC_VSEC, ADC_TRIGGER_EPWM2_SOCA,
LLC_ADCIN_VSEC, 8);

//
// No ADC interrupt triggers SOC0
// (TRIGSEL determined by SOC and not ADCINT1 or ADCINT2)
//
ADC_setInterruptSOCTrigger(LLC_ADCCTLBASE_ISEC, LLC_ADCSOC_ISEC,
ADC_INT_SOC_TRIGGER_NONE);
ADC_setInterruptSOCTrigger(LLC_ADCCTLBASE_IPRIRESO, LLC_ADCSOC_IPRIRESO,
ADC_INT_SOC_TRIGGER_NONE);
ADC_setInterruptSOCTrigger(LLC_ADCCTLBASE_VSEC, LLC_ADCSOC_VSEC,
ADC_INT_SOC_TRIGGER_NONE);

//
// All SOCs handled in round-robin mode
//
ADC_setSOCPriority(ADCA_BASE, ADC_PRI_ALL_ROUND_ROBIN);
ADC_setSOCPriority(ADCC_BASE, ADC_PRI_ALL_ROUND_ROBIN);

//
// Enable converters
//
ADC_enableConverter(ADCA_BASE);
ADC_enableConverter(ADCC_BASE);

//
// Wait 1 ms after power-up before using the ADC
//
DEVICE_DELAY_US(1000);

程序运行到DEVICE_DELAY_US(1000);提示如下:

No source available for "_system_post_cinit() at C:/Users\1\workspace_v10

No source available for "_system_post_cinit() at C:/Users\1\workspace_v10

No source available for "_system_post_cinit() at C:/Users\1\workspace_v10

No source available for "_system_post_cinit() at C:/Users\1\workspace_v10

No source available for "_system_post_cinit() at C:/Users\1\workspace_v10

No source available for "_system_post_cinit() at C:/Users\1\workspace_v10

然后就嗝屁了,

delay函数来自于ti自带文件:

//*****************************************************************************
//
// Macro to call SysCtl_delay() to achieve a delay in microseconds. The macro
// will convert the desired delay in microseconds to the count value expected
// by the function. \b x is the number of microseconds to delay.
//
//*****************************************************************************
#define DEVICE_DELAY_US(x) SysCtl_delay(((((long double)(x)) / (1000000.0L / \
(long double)DEVICE_SYSCLK_FREQ)) - 9.0L) / 5.0L)