?? myproj.c
字號:
#include <reg51.h>
#define uchar unsigned char
#define uint unsigned int
/*--------------------------parameter setting-----------------------*/
#define XtalFreq (11.059200)//Crystal Frequence
#define FALSE 0
#define TRUE 1
/*--------------------------sfr setting-----------------------*/
sfr CCAPM0=0xDA;//PCA module 0 mode
sfr PCACL=0xE9;//PCA timer Low BYTE
sfr CCAP0H=0xFA;//module 0 get High BYTE
sfr CCAP0L=0xEA;//module 0 get Low BYTE
sfr CMOD=0xD9;//PCA module timer mode
sfr CCON=0xD8;//PCA module timer control
sbit CR=0xDE;//The PCA Start Count
sbit CEX0=0x93;//PWM output CEX0 output P1.3
/*-------------------------------main-------------------------------*/
void main()
{
//CCAP0L=0x4e;
CCAP0H=0x01;//using for the control of the PWM pulse
CMOD=0x80;//using the T0 overflow for the Count Pulse,none Interupt,none WDOG/remain count
CCAPM0=0x42;//model 0 work state
CR=1;//start the PCA Counter
while(1);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -