AdcbRegs.ADCSOC1CTL.bit.CHSEL = 1; //SOC1 will convert pin B1 AdcbRegs.ADCSOC1CTL.bit.ACQPS = acqps; //sample window is acqps + 1 SYSCLK cycles AdcbRegs.ADCSOC1CTL.bit.TRIGSEL = 1; //这里设置1为timer0中断,设置0为软件中断 AdcbRegs.ADCSOC2CTL.bit.CHSEL = 2; //SOC1 w...
AdcbRegs.ADCCTL2.bit.PRESCALE = 6; //set ADCCLK divider to /4 AdcSetMode(ADC_ADCB, ADC_RESOLUTION_12BIT, ADC_SIGNALMODE_SINGLE); AdccRegs.ADCCTL2.bit.PRESCALE = 6; //set ADCCLK divider to /4 AdcSetMode(ADC_ADCC, ADC_RESOLUTION_12BIT, ADC_SIGNALMODE_SINGLE); AdcdRegs.ADC...
AdcaRegs.ADCSOC1CTL.bit.TRIGSEL = 1; //这里设置1为timer0中断,设置0为软件中断 AdcaRegs.ADC...
AdcaRegs.ADCSOC1CTL.bit.CHSEL= 1;// SOC0 converts channel 0, if differential is selected as conv.type 01 ADCIN0 (non-inverting) and ADCIN1 (inverting) AdcaRegs.ADCSOC0CTL.bit.ACQPS= 30;//(30 clkcycs)Sets the number of clock cycles to the acquisi...
EPwm1Regs.ETSEL.bit.SOCAEN = 1; // Enable SOC on A group SDFM的软件配置如下: // Setup SDSYNC EPwm11Regs.CMPC = EPwm11Regs.TBPRD - SDFM_TICKS*(OSR_RATE+1)*3/2; 综上所述,通过ADC或者SDFM进行相电流采样,不需要电流重构的步骤。通过数据寄存器直接读取当前电流结果,参与FOC控制算法的运算。
PWM启动ADC,主要是考虑启动ADC的周期,常规的做法启动ADC转换的周期就是PWM的周期,这种做法适用于PWM周期比较长的情况下,如果PWM周期比较短,可能需要隔好几个PWM周期,再启动一次ADC转换。 //ADC SOC EPwm1Regs.ETSEL.bit.SOCAEN = 1; // Enable SOC on A group ...
AdcaRegs.ADCSOC1CTL.bit.ACQPS = acqps; //sample window is acqps + 1 SYSCLK cycles AdcaRegs.ADCSOC1CTL.bit.TRIGSEL = 1; //这里设置1为timer0中断,设置0为软件中断 AdcaRegs.ADCSOC2CTL.bit.CHSEL = 2; //SOC1 will convert pin A1 ...
AdcRegs.ADCCTL1.bit.ADCREFSEL = 0; // Select interal BG 建议使用内部基准 内部基准一般就是指3.3v ( Digital Value = 4096 [(Input – VREFLO)/3.3v] when 0v < Input < 3.3v) DELAY_US(ADC_usDELAY); //选择序列采样模式 AdcRegs.ADCSAMPLEMODE.bit.SIMULEN0=0; //SOC0和SOC1 ...
AdcbRegs.ADCINTFLGCLR.all = 0x3; EPwm2Regs.ETCNTINITCTL.bit.SOCAINITFRC = 1; EPwm2Regs.ETCLR.bit.SOCA = 1; // // Enable continuous operation by setting the last SOC to re-trigger the first // AdcaRegs.ADCINTSOCSEL1.bit.SOC0 = 2; ...
(ADC) – 16 位模式 – 每个转换器的吞吐量为 1.1MSPS(系统吞 吐量高达 4.4MSPS) – 差分输入 – 多达 12 个外部通道 – 12 位模式 – 每个转换器的吞吐量为 3.5MSPS(系统吞 吐量高达 14MSPS) – 单端输入 – 多达 24 个外部通道 – 每个 ADC 上有单个采样与保持 (S/H) 电路 – ADC 转换的...