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
@ -40,8 +40,8 @@ char code POS[6] = {
|
|||||||
|
|
||||||
// <20>D<EFBFBD>{<7B><>
|
// <20>D<EFBFBD>{<7B><>
|
||||||
int main(){
|
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>
|
// <20><><EFBFBD><EFBFBD><EFBFBD>{<7B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>L<EFBFBD>a<EFBFBD>j<EFBFBD><6A>
|
||||||
while(1) {
|
while(1) {
|
||||||
Slect_Seg(POS[i]); // <20>]<5D>w<EFBFBD><77><EFBFBD><EFBFBD><EFBFBD>G
|
Slect_Seg(POS[i]); // <20>]<5D>w<EFBFBD><77><EFBFBD><EFBFBD><EFBFBD>G
|
||||||
@ -91,49 +91,54 @@ void Display_Seg(unsigned char display) {
|
|||||||
|
|
||||||
// <20><><EFBFBD><EFBFBD> 1ms
|
// <20><><EFBFBD><EFBFBD> 1ms
|
||||||
void delay_1ms(void) {
|
void delay_1ms(void) {
|
||||||
//<2F>]<5D>w<EFBFBD><77> mode1
|
//<2F>]<5D>w<EFBFBD><77> mode1
|
||||||
TMOD = 0x10;
|
TMOD = 0x10;
|
||||||
|
|
||||||
//<2F>]<5D>w<EFBFBD><77><EFBFBD>l<EFBFBD><6C>
|
//<2F>]<5D>w<EFBFBD><77><EFBFBD>l<EFBFBD><6C>
|
||||||
TF1 = 0;
|
TF1 = 0;
|
||||||
TR1 = 0;
|
TR1 = 0;
|
||||||
TL1 = (65536 - 9) % 256;
|
TL1 = (65536 - 921) % 256;
|
||||||
TH1 = (65536 - 9) / 256;
|
TH1 = (65536 - 921) / 256;
|
||||||
|
|
||||||
//<2F>}<7D>ҭp<D2AD>ɾ<EFBFBD>
|
//<2F>}<7D>ҭp<D2AD>ɾ<EFBFBD>
|
||||||
TR1 = 1;
|
TR1 = 1;
|
||||||
|
|
||||||
//<2F><> TF1 <20>S<EFBFBD><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
//<2F><> TF1 <20>S<EFBFBD><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
while(TF1 == 0);
|
while(TF1 == 0);
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>ɾ<EFBFBD>
|
||||||
|
TR1 = 0;
|
||||||
|
|
||||||
//<2F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>ɾ<EFBFBD>
|
//<2F>N TF1 <20>k<EFBFBD>s
|
||||||
TR1 = 0;
|
TF1 = 0;
|
||||||
|
|
||||||
//<2F>N TF1 <20>k<EFBFBD>s
|
|
||||||
TF1 = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// <20><><EFBFBD><EFBFBD> 1500ms
|
// <20><><EFBFBD><EFBFBD> 1500ms
|
||||||
void delay_1500ms(void) {
|
void delay_1500ms(void) {
|
||||||
//<EFBFBD>]<5D>w<EFBFBD><77> mode1
|
//ť<EFBFBD><EFBFBD> keil C <20>u<EFBFBD><75><EFBFBD>\<5C><><EFBFBD>ܼƫŧi<C5A7><69><EFBFBD>b<EFBFBD>̫e<CCAB><65> QQ
|
||||||
TMOD = 0x10;
|
int k = 0;
|
||||||
|
|
||||||
|
//<2F>]<5D>w<EFBFBD><77> mode1
|
||||||
|
TMOD = 0x10;
|
||||||
|
|
||||||
|
while(k < 150){
|
||||||
//<2F>]<5D>w<EFBFBD><77><EFBFBD>l<EFBFBD><6C>
|
//<2F>]<5D>w<EFBFBD><77><EFBFBD>l<EFBFBD><6C>
|
||||||
TF1 = 0;
|
TF1 = 0;
|
||||||
TR1 = 0;
|
TR1 = 0;
|
||||||
TL1 = (65536 - 13824) % 256;
|
TL1 = (65536 - 9216) % 256;
|
||||||
TH1 = (65536 - 13824) / 256;
|
TH1 = (65536 - 9216) / 256;
|
||||||
|
|
||||||
//<2F>}<7D>ҭp<D2AD>ɾ<EFBFBD>
|
//<2F>}<7D>ҭp<D2AD>ɾ<EFBFBD>
|
||||||
TR1 = 1;
|
TR1 = 1;
|
||||||
|
|
||||||
//<2F><> TF1 <20>S<EFBFBD><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
//<2F><> TF1 <20>S<EFBFBD><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
while(TF1 == 0);
|
while(TF1 == 0);
|
||||||
|
k = k + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>ɾ<EFBFBD>
|
||||||
|
TR1 = 0;
|
||||||
|
|
||||||
//<2F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>ɾ<EFBFBD>
|
//<2F>N TF1 <20>k<EFBFBD>s
|
||||||
TR1 = 0;
|
TF1 = 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>
|
<TargetOption>
|
||||||
<CLK51>24000000</CLK51>
|
<CLK51>24000000</CLK51>
|
||||||
<OPTTT>
|
<OPTTT>
|
||||||
<gFlags>0</gFlags>
|
<gFlags>1</gFlags>
|
||||||
<BeepAtEnd>1</BeepAtEnd>
|
<BeepAtEnd>1</BeepAtEnd>
|
||||||
<RunSim>1</RunSim>
|
<RunSim>1</RunSim>
|
||||||
<RunTarget>0</RunTarget>
|
<RunTarget>0</RunTarget>
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
<OutputName>TimerDelay_2</OutputName>
|
<OutputName>TimerDelay_2</OutputName>
|
||||||
<CreateExecutable>1</CreateExecutable>
|
<CreateExecutable>1</CreateExecutable>
|
||||||
<CreateLib>0</CreateLib>
|
<CreateLib>0</CreateLib>
|
||||||
<CreateHexFile>0</CreateHexFile>
|
<CreateHexFile>1</CreateHexFile>
|
||||||
<DebugInformation>1</DebugInformation>
|
<DebugInformation>1</DebugInformation>
|
||||||
<BrowseInformation>1</BrowseInformation>
|
<BrowseInformation>1</BrowseInformation>
|
||||||
<ListingPath>.\Listings\</ListingPath>
|
<ListingPath>.\Listings\</ListingPath>
|
||||||
@ -230,7 +230,7 @@
|
|||||||
<RCB>
|
<RCB>
|
||||||
<Type>0</Type>
|
<Type>0</Type>
|
||||||
<StartAddress>0x0</StartAddress>
|
<StartAddress>0x0</StartAddress>
|
||||||
<Size>0x0</Size>
|
<Size>0xffff</Size>
|
||||||
</RCB>
|
</RCB>
|
||||||
<RXB>
|
<RXB>
|
||||||
<Type>0</Type>
|
<Type>0</Type>
|
||||||
|
Reference in New Issue
Block a user