虫虫首页|资源下载|资源专辑|精品软件
登录|注册

您现在的位置是:虫虫下载站 > 资源下载 > 技术资料 > PID-小车类-基于Cortex-M0的BLDC电机驱动

PID-小车类-基于Cortex-M0的BLDC电机驱动

  • 资源大小:31640 K
  • 上传时间: 2022-06-01
  • 上传用户:kingwide
  • 资源积分:2 下载积分
  • 标      签: pid 电机 bldc

资 源 简 介

#include "NUC1xx.h"

#include "Hal.h"


#include "pwm.h"


//wait current PWM cycle done, otherwise there maybe short pulse on FET

void PWM_Stop(U8 ch)

{

switch(ch)

{

case PWM_CHANNEL_A:

PWMA->u32CNR1 = 0;

PWMA->u32CMR1 = 0;

while(PWMA->u32PDR1 != 0);

break;

case PWM_CHANNEL_B:

PWMA->u32CNR2 = 0;

PWMA->u32CMR2 = 0;

while(PWMA->u32PDR2 != 0);

break;

case PWM_CHANNEL_C:

PWMA->u32CNR3 = 0;

PWMA->u32CMR3 = 0;

while(PWMA->u32PDR3 != 0);

break;

default:

while(1);

}

PWMA->u32POE &= ~(1<<ch);

PWMA->u32PCR &= ~(1<<(ch*8));

}


相 关 资 源