Home > other >  Why external interrupt 0 can't jump out
Why external interrupt 0 can't jump out

Time:09-16

#include
#include
# include "absacc. H"
# define uint unsigned int
# define uchar unsigned char
# define PA8255 XBYTE [0 xff7c]
# define PB8255 XBYTE [0 xff7d]
# define COM8255 XBYTE [0 xff7f]
Sbit S1=P3 ^ 2;
Void delay (uint t);
Uchar time []={x5b x3f 0, 0 x06, 0, 0, x4f x66 0, 0 x6d, 0 x7d, 0 x07, 0 x7f, 0 x6f, 0 x01};
Uchar a=0, b=0;
Void main ()
{
COM8255=0 x80;
EA=1;
EX0=1;
IT0=1;
TMOD=0 x55;
TH0=0 XFF;
TL0=0 XFF;
TH1=0 XFF;
TL1=0 XFF;
PX0=0;
PA8255=0 x00;
PA8255=0 x00;

While (1)
{
PB8255=time [a];
PA8255=time [b];
Delay (1000);
+;
If (time [b]==0 x7d) b=0;
If (time [a]==0 x01) a=0, b++;
}
}
Void ting () interrupt 0
{
Uchar n=100;
PB8255=0 x00;
PA8255=0 x00;
Delay (1000);
ET0=1;

CodePudding user response:

Interrupt delay inside (1000), timid to really fat

CodePudding user response:

Ha ha, you get a sign not to go

CodePudding user response:

Programming requirements are as follows:
Interrupt service routine to the shorter, the better,

Generally buy a logo in the interrupt service routine, and then processing in the main program,
For example:
A serial port receives the data, the only read serial data in the interrupt service routine, and then put logo, finally according to the logo in the main program to parse,

CodePudding user response:

reference 1/f, whales, niko response:
interrupt delay inside (1000), timid to really fat


Why can't use? What will happen???

CodePudding user response:

reference 4 floor m0_45393514 response:
Quote: reference 1/f, whales, niko response:

Interrupt delay inside (1000), timid to really fat


Why can't use? What will happen???
key is why you use that? What is the purpose of you use?

CodePudding user response:

Void delay (uint t);
What is the function of the content?

CodePudding user response:

Interrupt it cannot add delay, it will block the next break, cause problems, interrupted only mark a change in it

CodePudding user response:

Problem solution is: add a interrupt flag

CodePudding user response:

Problem solution is: add a interrupt flag

CodePudding user response:

Problem solution is: add a interrupt flag

CodePudding user response:

A register interrupt flag bits can be casually?

CodePudding user response:

Interrupt flag change is your own definition of a variable, such as an unsigned char variables a, enter the interrupt and change his value, judging the value outside, inside the interrupt function should be as simple as possible quickly performed, all processing as far as possible in the main loop, don't delay, read more,

CodePudding user response:

Find someone to write program of the hardware is stc12c5024ad hardware, 2 slices ready with 22.1184 crystals with hc244 do 12 road input a 64 - bit dial the code switch do address input 4 tpic6b595 2 set of output a 485 and Siemens plc200 do credit to PLC program written 12 road by n address input count alarm display
QQ39084813
  • Related