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
  • In RTX full verion, it will automaticly change the IE value. If I set IE directly, the value will only active in a short time, sometime later, RTX will change it.
    Maybe Mr.Reinhard gave me the correct answer, the traffic is worked with RTX tiny version, so direct setting of IE is allowed. But no in RTX-51 version.
    Anyway, thanks very much.

Reply
  • In RTX full verion, it will automaticly change the IE value. If I set IE directly, the value will only active in a short time, sometime later, RTX will change it.
    Maybe Mr.Reinhard gave me the correct answer, the traffic is worked with RTX tiny version, so direct setting of IE is allowed. But no in RTX-51 version.
    Anyway, thanks very much.

Children
No data