This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Interrupt Enable?

Study the traffic example bout RTX-51 and interrupt. I was so confused.
Since I can not find any file called the function os_enable_isr().
And the serial file use the standard C51 interrupt function.
and in the file, the serial prot initialization like:
void serial_init (void) {
SCON = 0x50; /* mode 1: 8-bit UART, enable receiver */
TMOD |= 0x20; /* timer 1 mode 2: 8-Bit reload */
TH1 = 0xf3; /* reload value 2400 baud */
TR1 = 1; /* timer 1 run */
ES = 1; /* enable serial port interrupt */
}

it use ES=1 to enable interrupt!!!!!!!!!!!!!
and according to the Keil RTX-51/251 User's Guide,
on page 24, chapter 3 "Handling of the 8051/MCS 251 Interrupt Enable Register",
it said that "The INTERRUPT ENABLE registers of the 8051/MCS 251 are managed by
RTX-51/251 and must not be directly manipulated by user!".

But if I use os_enable_isr(4) to enable serial port0 interrupt, it always return failure. What's the matter?

Parents
  • it use ES=1 to enable interrupt!!!!!!!!!!!!!

    Of course, the operating system cannot prevent you from accessing the SFR's directly as you have done here. EA=1 and ES=1 will always enable the serial interrupt on an 8051.

    - Mark

Reply
  • it use ES=1 to enable interrupt!!!!!!!!!!!!!

    Of course, the operating system cannot prevent you from accessing the SFR's directly as you have done here. EA=1 and ES=1 will always enable the serial interrupt on an 8051.

    - Mark

Children