Bit spesific commands and interrupts (syntax)

  • Mike

    Mike - 2008-11-22

    Hello everyone.
    I'm new here and I was having some problems working with bits.

    I've included the 8051.h library and I get the following error when I try to:
    " set TR0; " or " clr TR0; "

    syntax error: token -> 'TR0' ; column 9

    I assume that I got the syntax wrong but I couldn't find correct syntax in the documentation.

    Also is the following syntax correct for using an interrupt ?
    "void timer0_int() __interrupt (1) __using (0)

    Sorry for the "noobish" questions.

    Thanks in advance, Mike.

    • Oliver Sedlacek

      Oliver Sedlacek - 2008-11-24

      For the bit variables use:
           TR0 = 0;
           TR0 = 1;

      The syntax for your interrupt service routine looks fine.

      • Mike

        Mike - 2008-11-24

        Oh, so that's how you do it.

        Thanks !


Log in to post a comment.