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

how to use the interrupt keyword in 8051 C code.

Hi,

There is an application note on using the interrupt vectors in C51 c programming for 8051. It goes like this-

unsigned int int_count;
unsigned char second;

void timer0 (void) interrupt 1 using 2
{ if (++int_count == 4000) { /* count to 4000 */ second++; /* second counter */ int_count = 0; /* clear interrupt counter */ }
}

Can anyone explain what does that "using 2" at the end of the function denote?

I understand that interrupt 1 specifies that this is the ISR for interrupt number for timer0 overflow at adress 000Bh. Does the last keyword "using 2" denote the polling priority of the interrupt?

TIA,
Mrunmoy

Parents
  • In this case, I think the price doesn't matter, since we are talking about learning to program a microcontroller.

    The '51 core has been available for quite a number of years now, but it will not disapear too soon, because of widespread use and gazillions of variants. Hence, it is a good processor for learning embedded programming. Especially since it very clearly shows the difference between embedded and workstation programming.

Reply
  • In this case, I think the price doesn't matter, since we are talking about learning to program a microcontroller.

    The '51 core has been available for quite a number of years now, but it will not disapear too soon, because of widespread use and gazillions of variants. Hence, it is a good processor for learning embedded programming. Especially since it very clearly shows the difference between embedded and workstation programming.

Children
  • The '51 core has been available for quite a number of years now, but it will not disapear too soon, because of widespread use and gazillions of variants

    true, AND a new derivative is introduced almost every day.

    in addition to the 'processor only derivatives' all kinds of combos are coming out:
    BB (now TI) chose the '51 architecture when they came out with the first 24 bit a/d intefrated with a uC
    IR chose the '51 for their "integrated washer-dryer" power solutions
    Nordic chose the '51 for their UC radio con=mbination
    A?D has some '51 combos
    ..........

    I do believe that every year since it's introduction (including 2006) more '51s have been used than the year before. It is a fact (that microchip obfusciates) that when you add all the brands of the '51 together it is the most used processor in the world.

    Erik