??? 05/10/07 20:43 Read: times |
#139003 - serial port and interrupt problem |
I wrote a c code with falling edge interrupt and serail port application. When I use those codes seperately, they work correctly, but when I use together, new code doesnt work.
Would you give me any feedback or suggestion? My code is: #include <DS89C4xx.h> #include <stdio.h> void send(unsigned char x); void msdelay(unsigned int itime); bit flag = 0; void ex0_isr (void) interrupt 1 { flag =1 ; } void main() { TMOD = 0x20; TH1 = 0xFD; SCON0 =0x50; TR1=1; while(1) { if (flag == 1) { send('A'); } } } void msdelay(unsigned int itime) { unsigned int i, j; for (i=0; i<itime; i++) for(j=0; j<1275; j++); } void send(unsigned char x) { SBUF0 = x; while (TI_0 = 0); TI_0=0; } |
Topic | Author | Date |
serial port and interrupt problem | 01/01/70 00:00 | |
you did not enable the interrupt | 01/01/70 00:00 | |
from first looking | 01/01/70 00:00 | |
Serial port and Int0 solutions | 01/01/70 00:00 | |
formatted![]() | 01/01/70 00:00 |