用stcc单片机内置pwm模块产生可调频率的pwm信号(The PWM frequency signal with adjustable frequency can be generated by STCC MCU with PWM module).docVIP

  • 10
  • 0
  • 约3.51千字
  • 约 9页
  • 2018-07-08 发布于江西
  • 举报

用stcc单片机内置pwm模块产生可调频率的pwm信号(The PWM frequency signal with adjustable frequency can be generated by STCC MCU with PWM module).doc

用stcc单片机内置pwm模块产生可调频率的pwm信号(The PWM frequency signal with adjustable frequency can be generated by STCC MCU with PWM module).doc

用stc12c5410单片机内置pwm模块产生可调频率的pwm信号(The PWM frequency signal with adjustable frequency can be generated by STC12C5410 MCU with PWM module)IPH EQU 0B7H; interrupt priority high registerEPCA_LVD EQU IE.6; PCA/LVD interrupt enable bit.To open the PCA interrupt, also open the corresponding ECF, ECCF0, ECCF1 bitsTo open LVD interrupts, also open the corresponding ELVDI bitsCH EQU 0xF9; the PCA counter is 8 bits high.CL EQU 0xE9; PCA counter low 8 bits.------------------------;CCON EQU 0D8H; PCA control register.CCF0 EQU CCON.0; PCA module 0 interrupt flag, set by hardware, must be cleared by software 0.CCF1 EQU CCON.1; PCA module 1 interrupt flag, set by hardware, must be cleared by software 0.CR EQU CCON.6; 1: allows PCA counter count, and must be cleared by software 0.CF EQU CCON.7; PCA counter overflow flag, set by hardware or software, must be cleared by software 0.------------------------;CMOD EQU 0D9H; PCA working mode register.When the CMOD.7 CIDL: idle state, the PCA counter continues to count, the 0: continues counting, and the 1: stops counting.CMOD.2 CPS1: PCA counter pulse source select bit 1.CMOD.1 CPS0: PCA counter pulse source select bit 0.CPS1 CPS000 internal clock, fosc/12.01 internal clock, fosc/2.10 Timer0 overflow.(11) an external clock input by the ECI/P3.4 pin.CMOD.0 ECF: PCA counters overflow interrupt enable bits, and 1-- allows CF (CCON.7) interrupts.------------------------;CCAP0H EQU 0FAH; PCA module 0 capture / compare register 8 bit high.CCAP1H EQU 0FBH; PCA module 1 capture / compare register 8 bit high.CCAP2H EQU 0FCH; PCA module 2 capture / compare register 8 bit high.CCAP3H EQU 0FDH; PCA module 3 capture / compare register 8 bit high.CCAP0L EQU 0EAH; PCA module 0 capture / compare register low 8 bit.CCAP1L EQU 0EBH; PCA module 1 capture / compare register low 8 bit.CCAP2L EQU 0ECHCCAP3L EQU 0EDH------------------------;PCA_PWM0 EQU 0F2H; PCA module 0 PWM register.PCA_PWM1 EQU 0F3H; PCA module 1 PWM register.PCA_PWM2 EQU 0F4HPCA_PWM3 EQU 0F5

文档评论(0)

1亿VIP精品文档

相关文档