TI中文支持网
TI专业的中文技术问题咨询交流网站

instaspin-FOC PWMDAC的问题

// the PWMDAC variable

HAL_DacData_t gDacData;

// set DAC parameters  

gDacData.ptrData[0] = &gPwmData.Tabc.value[0];  

gDacData.ptrData[1] = &gPwmData.Tabc.value[1];  

gDacData.ptrData[2] = &gPwmData.Tabc.value[2];  

gDacData.ptrData[3] = &gAdcData.V.value[0];  HAL_setDacParameters(halHandle, &gDacData);// set PWMDAC parameters for each channel to ensure the output waveform

void HAL_setDacParameters(HAL_Handle handle, HAL_DacData_t *pDacData)

{   HAL_Obj *obj = (HAL_Obj *)handle;   

pDacData->PeriodMax = PWMDAC_getPeriod(obj->pwmDacHandle[PWMDAC_Number_1]);   pDacData->offset[0] = _IQ(0.5);   

pDacData->offset[1] = _IQ(0.5);   

pDacData->offset[2] = _IQ(0.5);  

  pDacData->offset[3] = _IQ(0.5);   pDacData->gain[0] = _IQ(1.0);   

pDacData->gain[1] = _IQ(1.0);  

  pDacData->gain[2] = _IQ(1.0);   

pDacData->gain[3] = _IQ(1.0);} // end of HAL_setDacParameters() function  // connect inputs of the PWMDAC module.  

gDacData.value[0] = (*gDacData.ptrData[0]);  //   

gDacData.value[1] = (*gDacData.ptrData[1]);  //   

gDacData.value[2] = (*gDacData.ptrData[2]);  //  

  gDacData.value[3] = (*gDacData.ptrData[3]);  //  HAL_writeDacData(halHandle,&gDacData);

使用28027F在程序里面用作如上设置,为什么在示波器上面观察不到输出波形,仍然是PWM波呢

赞(0)
未经允许不得转载:TI中文支持网 » instaspin-FOC PWMDAC的问题
分享到: 更多 (0)