基于stc12pwm波
#include
#include
#define FOSC 110592000L//這個是long型數(shù)據(jù),11.0595mhz
typedef unsigned char BYTE;
typedef unsigned int WORD;
sfr CCON
sfr CMOD
sfr CCAP0L = 0xEA; //PCA 模塊 0 的捕捉/比較寄存器低 8 位。
sfr CCAP0H = 0xFA;
sfr CL
sfr CH
sfr AUXR
sbit CR = CCON^6;
sfr CCAPM0 = 0xDA;
sfr PCAPWM1=0xf3;
sfr CCAP1H=0xfb;
sfr CCAP1L=0xeb;
void main()
{
}
兩路pwm輸出,設(shè)置頻率和占空比
評論