in use NE555 Module time ,NE555 No driver is required ,NE555 Providing an interface is P3^4 Interface , Of course, this interface is not connected by default , Need to J3 Use the jumper cap to P3^4 and SIGNAL Connect , We can see P3^4 Is as T0 timer , External input port of counter , that NE555 When used for frequency measurement, the idea is to
T0 Set to counting mode 2 Automatic reassembly , Used to receive SIGNAL Give it a pulse , then T1 Set in timing mode , timing 1s, After will 1s in T0 Take out the measured pulse number , Displayed by nixie tube .

Single chip microcomputer measures signal frequency , And displayed in the nixie tube , For frequency data display 5 Bit nixie tube , Unit is HZ
// When the display length is insufficient 5 Time position , The unused nixie tube goes out , On the far left 1 For digital tube F As a prompt // Frequency is in 1s How many pulse signals are generated in .
//P34 foot T0 For counting ( External signal count , Internal signal timing .) //T1 For timing //T0 use 8 Bit automatic reassembly , The initial value is set to 255, As long as a pulse comes, the signal overflows and enters the interrupt
// Add variables to the interrupt service function 1 #include<reg52.h> #define uint unsigned int #define uchar
unsigned char uchar code
table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xbf}; uint
maichong=0; uint maichong1=0; uint count=0; void hc138(uint z) { switch(z) {
case 4:P2=P2&0x1f|0x80;break; case 5:P2=P2&0x1f|0xa0;break; case
6:P2=P2&0x1f|0xc0;break; case 7:P2=P2&0x1f|0xe0;break; case
0:P2=P2&0x1f|0x00;break; } } void delaysmg(uint z) { while(z--); } void
initsystem() { hc138(5);P0=0x00; hc138(4);P0=0xff; hc138(0); } void inittimer()
{ TMOD=0x16; //0001 0110 timer 1 Working mode of timing mode 1, timer 0 Counting mode 2 TH0=0xff;//1111 1111
TL0=0xff; TH1=(65536-50000)/256; //50ms TL1=(65536-50000)%266; TR0=1; TR1=1;
EA=1; ET0=1; ET1=1; } void t0() interrupt 1 // timer 0 Interrupt function { maichong++; } void
t1() interrupt 3// timer 1 Interrupt function { TH1=(65536-50000)/256; //50ms
TL1=(65536-50000)%266; count++; if(count==20) { count=0; maichong1=maichong;
maichong=0; } } void selectsmg(uint we,uint du) { hc138(6); P0=0x01<<we;//0000
0001 hc138(0); hc138(7); P0=du; delay(500); p0=0xff; hc138(0); } void display()
{ selectsmg(0,0x8e);// Nixie tube first display F delaysmg(100); selectsmg(1,0xff);// Second digit display of nixie tube -
delaysmg(100); selectsmg(2,0xff);// Third digit display of nixie tube - delaysmg(100); if(maichong1>9999)
//23456 { selectsmg(3,table[maichong1/10000]); //2 delaysmg(100); }
if(maichong1>999) { selectsmg(4,table[maichong1/1000%10]);//3 delaysmg(100); }
if(maichong1>99) { selectsmg(5,table[maichong1/100%10]);//4 delaysmg(100); }
if(maichong1>9) { selectsmg(6,table[maichong1/10%10]);//5 delaysmg(100); }
selectsmg(7,table[maichong1%10]); delaysmg(100); } void main() { initsystem();
inittimer(); while(1) { display(); } }

©2019-2020 Toolsou All rights reserved,
C++ of string of compare usage Python Study notes ( one )evo Tool usage problems ——Degenerate covariance rank, Umeyama alignment is not possibleRISC-V_GD32VF103-TIMER0 timer interrupt java Array subscript variable _Java Basic grammar : array be based on stm32 Control four-wheel trolley motor drive ( one ) be based on redis Design of liking function Software engineering career planning mysql Query random data by conditions _MySQL Random query of several qualified records centos7 install RabbitMq