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
Read-Only
Author SBM B
Posted 14-Jan-2010 06:27 GMT
Toolset C51
RE: 89C51 serial interrupt handling erro
SBM B
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.
Read-Only
Author Andy Neil
Posted 14-Jan-2010 07:21 GMT
Toolset C51
It should not benecessary...
Andy Neil
... to disable interrupts in the ISR.
Have you looked at the interrupt-driven serial IO example in the
downloads section of this very website?
Read-Only
Author erik malund
Posted 14-Jan-2010 13:18 GMT
Toolset C51
this qualifies as ...
erik malund
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.
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?
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.