编译HVACI_Sensorless_2833x例程 到这句:PWMDAC_INIT_MACRO(7,pwmdac1) ccs会报错: warning: subscript out of range,但是F28335只有6个ePWM模块,为什么例程这句是ePWM7Regs?
#define PWM_INIT_MACRO(v) \ /* Setup Sync*/ \ EPwm1Regs.TBCTL.bit.SYNCOSEL = 0; /* Pass through*/ \ EPwm2Regs.TBCTL.bit.SYNCOSEL = 0; /* Pass through*/ \ EPwm3Regs.TBCTL.bit.SYNCOSEL = 0; /* Pass through*/ \ \ /* Allow each timer to be sync'ed*/ \ EPwm1Regs.TBCTL....
#define PWM_INIT_MACRO(ch1,ch2,ch3,v) \ /* Setup Sync*/ \ (*ePWM[ch1]).TBCTL.bit.SYNCOSEL = 0; /* Pass through*/ \ (*ePWM[ch2]).TBCTL.bit.SYNCOSEL = 0; /* Pass through*/ \ (*ePWM[ch3]).TBCTL.bit.SYNCOSEL = 0; /* Pass through*/ \ \ /* Allow each timer to be sy...
/* Macro, type and constant definitions */ /*---
void TPM2_init(void) //PWM OUTPUT ,TPM2-TH0为硬件比较输出 PTF4 顺序,需要先启动后设置,否则设置无效 { PWM_OFF; //PWM-STEP1 PWM_ON; //PWM-STEP2 PWMDUTY=0x0000; // PTF4 LOW-LEVEL TIME } void main(void) { EnableInterrupts; /* enable interrupts */ ...
#include <hidef.h> /* for EnableInterrupts macro */ #include "derivative.h" /* include peripheral declarations */ /***变量和函数定义***/ void PWMInit(unsigned int i); void Delay_ms(int i); /***主函数***/ void main(){ unsigned...
就是在 /* USER CODE BEGIN TIM3_Init 2 */后面加上 HAL_TIM_PWM_Start (&htim3, TIM_CHANNEL_2这行代码而已目的是开启定时器中的PWM); /* USER CODE BEGIN Header */ /** *** * @file tim.c * @brief This file provides code for the configuration * of the TIM instances. ***...
STEP 2, define macro related to the pwm such as #define BSP_USING_PWM1 在board.h中设置宏定义,这个需要根据自己所使用的tim定时器来确定,pwm1 d对应 tim1; 2.3:sep3 cubemx 配置tim定时器; * STEP 3, copy your pwm timer init function from stm32xxxx_hal_msp.c generated by stm32cubemx to...
void Init_tpm1_ch1_output(void) { TPM1MODH=0x01; TPM1MODL=0x90; TPM1C1VH=0x00; TPM1C1VL=0xC8; TPM1C1SC=0x64;//通道1中断使能,边沿PWM模式,通道引脚高有效 TPM1SC=0x08;//TPM1时钟源为总线时钟;分频系数为1;溢出中断禁止 TPM1CNTH=0;//任意时刻对TPM1CNTH或TPM1CNTL的写操作将计数寄...
TIM1_TimeBaseInitTypeDef TIM1_TimeBaseStructure;TIM1_OCInitTypeDef TIM1_...