fix the delay time
This commit is contained in:
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
Listings/TimerDelay_2.lst
Normal file → Executable file
0
Listings/TimerDelay_2.lst
Normal file → Executable file
0
Listings/TimerDelay_2.m51
Normal file → Executable file
0
Listings/TimerDelay_2.m51
Normal file → Executable file
0
Objects/TimerDelay_2
Normal file → Executable file
0
Objects/TimerDelay_2
Normal file → Executable file
0
Objects/TimerDelay_2.build_log.htm
Normal file → Executable file
0
Objects/TimerDelay_2.build_log.htm
Normal file → Executable file
0
Objects/TimerDelay_2.lnp
Normal file → Executable file
0
Objects/TimerDelay_2.lnp
Normal file → Executable file
@ -41,7 +41,7 @@ char code POS[6] = {
|
||||
// <20>D<EFBFBD>{<7B><>
|
||||
int main(){
|
||||
|
||||
int i, j = 0;
|
||||
int i = 0, j = 0;
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>{<7B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>L<EFBFBD>a<EFBFBD>j<EFBFBD><6A>
|
||||
while(1) {
|
||||
Slect_Seg(POS[i]); // <20>]<5D>w<EFBFBD><77><EFBFBD><EFBFBD><EFBFBD>G
|
||||
@ -97,8 +97,8 @@ void delay_1ms(void) {
|
||||
//<2F>]<5D>w<EFBFBD><77><EFBFBD>l<EFBFBD><6C>
|
||||
TF1 = 0;
|
||||
TR1 = 0;
|
||||
TL1 = (65536 - 9) % 256;
|
||||
TH1 = (65536 - 9) / 256;
|
||||
TL1 = (65536 - 921) % 256;
|
||||
TH1 = (65536 - 921) / 256;
|
||||
|
||||
//<2F>}<7D>ҭp<D2AD>ɾ<EFBFBD>
|
||||
TR1 = 1;
|
||||
@ -115,25 +115,30 @@ void delay_1ms(void) {
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> 1500ms
|
||||
void delay_1500ms(void) {
|
||||
//ť<><C5A5> keil C <20>u<EFBFBD><75><EFBFBD>\<5C><><EFBFBD>ܼƫŧi<C5A7><69><EFBFBD>b<EFBFBD>̫e<CCAB><65> QQ
|
||||
int k = 0;
|
||||
|
||||
//<2F>]<5D>w<EFBFBD><77> mode1
|
||||
TMOD = 0x10;
|
||||
|
||||
while(k < 150){
|
||||
//<2F>]<5D>w<EFBFBD><77><EFBFBD>l<EFBFBD><6C>
|
||||
TF1 = 0;
|
||||
TR1 = 0;
|
||||
TL1 = (65536 - 13824) % 256;
|
||||
TH1 = (65536 - 13824) / 256;
|
||||
TL1 = (65536 - 9216) % 256;
|
||||
TH1 = (65536 - 9216) / 256;
|
||||
|
||||
//<2F>}<7D>ҭp<D2AD>ɾ<EFBFBD>
|
||||
TR1 = 1;
|
||||
|
||||
//<2F><> TF1 <20>S<EFBFBD><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
while(TF1 == 0);
|
||||
k = k + 1;
|
||||
}
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>ɾ<EFBFBD>
|
||||
TR1 = 0;
|
||||
|
||||
//<2F>N TF1 <20>k<EFBFBD>s
|
||||
TF1 = 0;
|
||||
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -28,7 +28,7 @@
|
||||
<TargetOption>
|
||||
<CLK51>24000000</CLK51>
|
||||
<OPTTT>
|
||||
<gFlags>0</gFlags>
|
||||
<gFlags>1</gFlags>
|
||||
<BeepAtEnd>1</BeepAtEnd>
|
||||
<RunSim>1</RunSim>
|
||||
<RunTarget>0</RunTarget>
|
||||
|
@ -48,7 +48,7 @@
|
||||
<OutputName>TimerDelay_2</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>0</CreateHexFile>
|
||||
<CreateHexFile>1</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\Listings\</ListingPath>
|
||||
@ -230,7 +230,7 @@
|
||||
<RCB>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
<Size>0xffff</Size>
|
||||
</RCB>
|
||||
<RXB>
|
||||
<Type>0</Type>
|
||||
|
Reference in New Issue
Block a user