我把程序贴上来吧!这个好像是12位6KHz的程序,请大家帮我看看!
/*------------------------------------------------------------------*/
/* --- STC MCU International Limited -------------------------------*/
/* --- STC 1T Series MCU Programme Demo ----------------------------*/
/* --- Fax: 86-755-82944243 ----------------------------------------*/
/* --- Tel: 86-755-82948412 ----------------------------------------*/
/* If you want to use the program or the program referenced in the */
/* article, please specify in which data and procedures from STC */
/*------------------------------------------------------------------*/
unsigned int PWM_high; //定义PWM占空比寄存器,即PWM输出高电平的PCA时钟脉冲个数(占空比写入变量)。
unsigned int PWM_low; //定义PWM输出低电平的PCA时钟脉冲个数。
unsigned int CCAP0_tmp; //定义CCAP0重装载影射寄存器。