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.

[参考译文] SysConfig:SysConfig 将 DL_ADC12_setDMASamplesCnt 函数的第二个参数填充为 0

Guru**** 2680875 points

Other Parts Discussed in Thread: SYSCONFIG

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1590394/sysconfig-sysconfig-populate-second-argument-of-the-dl_adc12_setdmasamplescnt-function-as-0

器件型号: SysConfig

SysConfig 使用函数为 ADC12 的 DMA 传输生成代码  

DL_ADC12_setDMASAMPLESCnt
 
第二个参数为 0(SAMPCNT feild 的设置)。 参考手册强调这一点(粗体) -它必须至少为 1(第 991 页)。
请解释此难题。  
谢谢你
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我在 MSP 团队中循环回复。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Mykhaylo:
    您能否与我分享您的 SysConfig 文件、或者告诉我您如何配置 ADC(以及您使用的器件)? 最后、您能告诉我您所使用的 CCS、SysConfig 和 SDK 的版本吗?

    此致、

    Diego Abad

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    /**
     * Import the modules used in this configuration.
     */
    const ADC12  = scripting.addModule("/ti/driverlib/ADC12", {}, false);
    const ADC121 = ADC12.addInstance();
    const ADC122 = ADC12.addInstance();
    const DMA    = scripting.addModule("/ti/driverlib/DMA");
    const GPIO   = scripting.addModule("/ti/driverlib/GPIO", {}, false);
    const GPIO1  = GPIO.addInstance();
    const GPIO2  = GPIO.addInstance();
    const MCAN   = scripting.addModule("/ti/driverlib/MCAN", {}, false);
    const MCAN1  = MCAN.addInstance();
    const PWM    = scripting.addModule("/ti/driverlib/PWM", {}, false);
    const PWM1   = PWM.addInstance();
    const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL");
    const TIMER  = scripting.addModule("/ti/driverlib/TIMER", {}, false);
    const TIMER1 = TIMER.addInstance();
    const TIMER2 = TIMER.addInstance();
    
    /**
     * Write custom configuration values to the imported modules.
     */
    const gate7  = system.clockTree["MFCLKGATE"];
    gate7.enable = true;
    
    const gate8  = system.clockTree["MFPCLKGATE"];
    gate8.enable = true;
    
    const mux4       = system.clockTree["EXHFMUX"];
    mux4.inputSelect = "EXHFMUX_XTAL";
    
    const mux8       = system.clockTree["HSCLKMUX"];
    mux8.inputSelect = "HSCLKMUX_HFCLK";
    
    const mux12       = system.clockTree["SYSPLLMUX"];
    mux12.inputSelect = "zSYSPLLMUX_HFCLK";
    
    const pinFunction4        = system.clockTree["HFXT"];
    pinFunction4.inputFreq    = 40;
    pinFunction4.enable       = true;
    pinFunction4.HFCLKMonitor = true;
    pinFunction4.HFXTStartup  = 30;
    
    ADC121.$name                          = "ADC0";
    ADC121.endAdd                         = 11;
    ADC121.trigSrc                        = "DL_ADC12_TRIG_SRC_EVENT";
    ADC121.adcMem10chansel                = "DL_ADC12_INPUT_CHAN_11";
    ADC121.pubChanID                      = 14;
    ADC121.disChan11                      = true;
    ADC121.enabledEvents                  = ["DL_ADC12_EVENT_MEM0_RESULT_LOADED"];
    ADC121.subChanID                      = 12;
    ADC121.adcMem11chansel                = "DL_ADC12_INPUT_CHAN_11";
    ADC121.adcMem11trig                   = "DL_ADC12_TRIGGER_MODE_TRIGGER_NEXT";
    ADC121.adcMem0chansel                 = "DL_ADC12_INPUT_CHAN_11";
    ADC121.repeatMode                     = true;
    ADC121.sampleTime0                    = "0";
    ADC121.sampleTime1                    = "0";
    ADC121.sampClkSrc                     = "DL_ADC12_CLOCK_ULPCLK";
    ADC121.enabledInterrupts              = ["DL_ADC12_INTERRUPT_MEM0_RESULT_LOADED"];
    ADC121.configureDMA                   = true;
    ADC121.enabledDMATriggers             = ["DL_ADC12_DMA_MEM0_RESULT_LOADED"];
    ADC121.adcMem0trig                    = "DL_ADC12_TRIGGER_MODE_TRIGGER_NEXT";
    ADC121.peripheral.$assign             = "ADC0";
    ADC121.DMA_CHANNEL.$name              = "DMA_CH0";
    ADC121.DMA_CHANNEL.enabledEvents      = ["EVENT_CHANNEL"];
    ADC121.DMA_CHANNEL.peripheral.$assign = "DMA_CH0";
    
    ADC122.$name                             = "ADC1";
    ADC122.endAdd                            = 3;
    ADC122.repeatMode                        = true;
    ADC122.trigSrc                           = "DL_ADC12_TRIG_SRC_EVENT";
    ADC122.pubChanID                         = 15;
    ADC122.adcMem1chansel                    = "DL_ADC12_INPUT_CHAN_1";
    ADC122.adcMem2chansel                    = "DL_ADC12_INPUT_CHAN_2";
    ADC122.adcMem3chansel                    = "DL_ADC12_INPUT_CHAN_15";
    ADC122.enabledEvents                     = ["DL_ADC12_EVENT_MEM0_RESULT_LOADED"];
    ADC122.sampClkSrc                        = "DL_ADC12_CLOCK_ULPCLK";
    ADC122.enabledInterrupts                 = ["DL_ADC12_INTERRUPT_MEM0_RESULT_LOADED"];
    ADC122.configureDMA                      = true;
    ADC122.subChanID                         = 14;
    ADC122.adcMem0trig                       = "DL_ADC12_TRIGGER_MODE_TRIGGER_NEXT";
    ADC122.enabledDMATriggers                = ["DL_ADC12_DMA_MEM0_RESULT_LOADED"];
    ADC122.peripheral.$assign                = "ADC1";
    ADC122.adcPin0Config.hideOutputInversion = scripting.forceWrite(false);
    ADC122.adcPin0Config.$name               = "ti_driverlib_gpio_GPIOPinGeneric0";
    ADC122.DMA_CHANNEL.enabledEvents         = ["EVENT_CHANNEL"];
    ADC122.DMA_CHANNEL.$name                 = "DMA_CH1";
    ADC122.DMA_CHANNEL.peripheral.$assign    = "DMA_CH1";
    
    const Board = scripting.addModule("/ti/driverlib/Board", {}, false);
    
    DMA.sub1ChanID = 12;
    DMA.pubChanID  = 2;
    DMA.sub0ChanID = 3;
    
    GPIO1.$name                             = "GPIO_TST_0";
    GPIO1.port                              = "PORTB";
    GPIO1.portSegment                       = "Upper";
    GPIO1.associatedPins.create(3);
    GPIO1.associatedPins[0].$name           = "PIN_0";
    GPIO1.associatedPins[0].pin.$assign     = "PB22";
    GPIO1.associatedPins[1].$name           = "PIN_RED";
    GPIO1.associatedPins[1].subOutputPolicy = "TOGGLE";
    GPIO1.associatedPins[1].pin.$assign     = "PB26";
    GPIO1.associatedPins[2].$name           = "PIN_GREEN";
    GPIO1.associatedPins[2].subOutputPolicy = "TOGGLE";
    GPIO1.associatedPins[2].subChanID       = 10;
    GPIO1.associatedPins[2].pin.$assign     = "PB27";
    
    GPIO2.$name                             = "GPIO_GRP_A";
    GPIO2.port                              = "PORTA";
    GPIO2.portSegment                       = "Lower";
    GPIO2.associatedPins.create(2);
    GPIO2.associatedPins[0].$name           = "PIN_STB";
    GPIO2.associatedPins[0].pin.$assign     = "PA14";
    GPIO2.associatedPins[1].$name           = "PIN_DBG1";
    GPIO2.associatedPins[1].subOutputPolicy = "TOGGLE";
    GPIO2.associatedPins[1].subChanID       = 15;
    GPIO2.associatedPins[1].pin.$assign     = "PA0";
    
    MCAN1.$name                    = "MCAN0";
    MCAN1.peripheral.$assign       = "CANFD0";
    MCAN1.peripheral.rxPin.$assign = "PA13";
    MCAN1.peripheral.txPin.$assign = "PA12";
    MCAN1.txPinConfig.$name        = "ti_driverlib_gpio_GPIOPinGeneric6";
    MCAN1.rxPinConfig.$name        = "ti_driverlib_gpio_GPIOPinGeneric7";
    
    PWM1.$name                       = "PWM_0";
    PWM1.subscriberPort              = "FSUB0";
    PWM1.event1PublisherChannel      = 1;
    PWM1.event1ControllerInterruptEn = ["ZERO_EVENT"];
    PWM1.clockDivider                = 8;
    PWM1.timerCount                  = 50000;
    PWM1.timerStartTimer             = true;
    PWM1.peripheral.$assign          = "TIMA0";
    PWM1.PWM_CHANNEL_0.$name         = "ti_driverlib_pwm_PWMTimerCC0";
    PWM1.PWM_CHANNEL_0.dutyCycle     = 50;
    PWM1.PWM_CHANNEL_1.$name         = "ti_driverlib_pwm_PWMTimerCC1";
    PWM1.ccp0PinConfig.$name         = "ti_driverlib_gpio_GPIOPinGeneric5";
    PWM1.ccp1PinConfig.$name         = "ti_driverlib_gpio_GPIOPinGeneric8";
    
    SYSCTL.clockTreeEn = true;
    
    TIMER1.$name                       = "TIMER_0";
    TIMER1.timerStartTimer             = true;
    TIMER1.enableShadowLoad            = true;
    TIMER1.timerClkDiv                 = 2;
    TIMER1.timerPeriod                 = "1 ms";
    TIMER1.event1ControllerInterruptEn = ["LOAD_EVENT"];
    TIMER1.event2PublisherChannel      = 13;
    TIMER1.timerMode                   = "PERIODIC_UP";
    TIMER1.event2ControllerInterruptEn = ["ZERO_EVENT"];
    TIMER1.peripheral.$assign          = "TIMG6";
    
    TIMER2.$name                       = "TIMER_1";
    TIMER2.timerMode                   = "PERIODIC_UP";
    TIMER2.timerClkDiv                 = 8;
    TIMER2.event1PublisherChannel      = 12;
    TIMER2.timerStartTimer             = true;
    TIMER2.enableShadowLoad            = true;
    TIMER2.event1ControllerInterruptEn = ["ZERO_EVENT"];
    TIMER2.timerPeriod                 = "1ms";
    TIMER2.peripheral.$assign          = "TIMG7";
    
    /**
     * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
     * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
     * re-solve from scratch.
     */
    pinFunction4.peripheral.$suggestSolution           = "SYSCTL";
    pinFunction4.peripheral.hfxInPin.$suggestSolution  = "PA5";
    pinFunction4.peripheral.hfxOutPin.$suggestSolution = "PA6";
    ADC122.peripheral.adcPin0.$suggestSolution         = "PA15";
    Board.peripheral.$suggestSolution                  = "DEBUGSS";
    Board.peripheral.swclkPin.$suggestSolution         = "PA20";
    Board.peripheral.swdioPin.$suggestSolution         = "PA19";
    PWM1.peripheral.ccp0Pin.$suggestSolution           = "PA2";
    PWM1.peripheral.ccp1Pin.$suggestSolution           = "PA1";
    

    大家好、Diego、这是 SysConfig、无法将其添加为文件。

    CCS 为 版本:20.2.0.12__1.8.0

    SysConfig 1.25.0

    SDK 2.7.0.05

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    关闭 SysConfig 允许提供值为 0 的字段“DMA Samples“。 我认为应该是固定的。