This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
justhomework/MCU/MCU_5 _Wave_Generate/main.h

38 lines
517 B
C
Raw Normal View History

2022-04-28 02:00:04 +00:00
#ifndef _MAIN_H_
#define _MAIN_H_
#define MODE_3
//1<><31><EFBFBD><EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD>3<EFBFBD><33><EFBFBD><EFBFBD>
#ifdef MODE_3
#define RELOAD (65535-217)
//#define RELOAD (65535-217)
#else
#define RELOAD (5000)
#endif
unsigned int TH, TL;
unsigned long int count = 0;
unsigned int ge,ui,bd,qm,wj,num;
void setConfig()
{
TH = RELOAD / 256;
TL = RELOAD - (RELOAD / 256) * 256;
TMOD = 0x01; //T0 16λ<36><CEBB>ʱ T1 16λ<36><CEBB><EFBFBD><EFBFBD>
TH0 = TH;
TL0 = TL;
EA = 1; //<2F><><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6>ܿ<EFBFBD><DCBF><EFBFBD>
ET0 = 1; //<2F>򿪶<EFBFBD>ʱ<EFBFBD><CAB1>0<EFBFBD>жϿ<D0B6><CFBF><EFBFBD>
TR0 = 1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>0
P1 = 0X00;
}
#endif