technical people,
when I tried to write a menu to 89C51, with header correct header file, 100% sure I correctly sent the baud rate for hyperterminal program in computer to communicate. I turn on serial interrupt buy setting EA=1 & ES=1; I clear RI or TI when I have interrupt in Interrupt service routine(serial() interrupt 4) at every time. However, when I tried to echo the word I typed in hyperteminal, It doesn't show. I compiled in keil c IDE and get hex code. and burn it into my 89C51 chip, it does not jump to the main program. It always stay in interrupt service routine. What's happening?Can you help?
Thanks, Steve
hi Steve,
You are clearing the TI as well as RI flag in serial interrupt. Before doing this disable all interrupt, in ISR, then do whatever you want and at the end of ISR again Enable serial interrupt.
... to disable interrupts in the ISR.
Have you looked at the interrupt-driven serial IO example in the downloads section of this very website?
this qualifies as the blind leading the deaf.
Why on earth would you disable an interrupt for a period of time where it can not activate anyhow?
Erik