Loading ...
Sorry, an error occurred while loading the content.
 

can't write to some registers in simulator

Expand Messages
  • Matthew Berkemeier
    Hi, I am using gdb v. 5.0 and gcc v. 2.95.2 under Linux. I am having trouble writing to some of the registers when using the simulator. As an example, here is
    Message 1 of 3 , Nov 2, 2000
      Hi,

      I am using gdb v. 5.0 and gcc v. 2.95.2 under Linux.

      I am having trouble writing to some of the registers when using the
      simulator. As an example, here is a modification of main() in
      simple.c (which comes with the examples). When I run it, I get all zeros.

      With some 6811 ports, this works fine (e.g., M6811_PORTA). I should be
      able to write to the TMSK1 register, as this controls whether interrupts
      are generated when using output compare.

      int
      main()
      {
      unsigned char i;

      serial_init ();
      for (i = 0; i < 255; i++)
      {
      /* added the following 2 lines */
      _io_ports[M6811_TMSK1] = i;
      i = _io_ports[M6811_TMSK1];

      print_hello (i);
      }
      return 0;
      }
    • Stephane Carrez
      Hi! ... Thanks! I think I ve seen the problem. Only TMSK2 is handled and writing to TMSK1 is completely ignored (:- Stephane ... Home
      Message 2 of 3 , Nov 5, 2000
        Hi!


        Matthew Berkemeier a écrit :
        >
        > Hi,
        >
        > I am using gdb v. 5.0 and gcc v. 2.95.2 under Linux.
        >
        > I am having trouble writing to some of the registers when using the
        > simulator. As an example, here is a modification of main() in
        > simple.c (which comes with the examples). When I run it, I get all zeros.
        >
        > With some 6811 ports, this works fine (e.g., M6811_PORTA). I should be
        > able to write to the TMSK1 register, as this controls whether interrupts
        > are generated when using output compare.
        >

        Thanks! I think I've seen the problem. Only TMSK2 is handled and writing
        to TMSK1 is completely ignored (:-

        Stephane

        -----------------------------------------------------------------------
        Home Office
        E-mail: stcarrez@... Stephane.Carrez@...
        WWW: http://home.worldnet.fr/stcarrez http://www.sun.com
        Mail: 17, rue Foucher Lepelletier 6, avenue Gustave Eiffel
        92130 Issy Les Moulineaux 78182 Saint Quentin en Yvelines
        France
      • matthewb@ece.usu.edu
        Well, it s nice to know why it wasn t working! I would like to run MicroC/OS-II on the simulator if possible (a real-time kernel described in a book by Jean
        Message 3 of 3 , Nov 5, 2000
          Well, it's nice to know why it wasn't working!

          I would like to run MicroC/OS-II on the simulator if possible (a
          real-time kernel described in a book by Jean Labrosse. The web site is
          http://www.ucos-ii.com). This kernel requires interrupts which are
          generated periodically. The MicroC/OS-II 68HC11 port accomplishes
          this by using the output compare feature. So, I need to enable the
          interrupts using TMSK1.

          I have gotten the code to compile under the 68hc11 port of gcc and as.
          So, if I had a board, I could try it out. Of course, it would be nice
          to run it on the simulator first.

          Is there any plan to add support for TMSK1 to the simulator? If not
          soon, then can I get some suggestions as to how I might go about doing
          it myself? The simulator source code looks a little intimidating...

          Thanks!

          Matt Berkemeier

          --- In gnu-m68hc11@egroups.com, Stephane Carrez <stephane.carrez@w...>
          wrote:
          > Hi!
          >
          >
          > Matthew Berkemeier a écrit :
          > >
          > > Hi,
          > >
          > > I am using gdb v. 5.0 and gcc v. 2.95.2 under Linux.
          > >
          > > I am having trouble writing to some of the registers when using
          the
          > > simulator. As an example, here is a modification of main() in
          > > simple.c (which comes with the examples). When I run it, I get
          all zeros.
          > >
          > > With some 6811 ports, this works fine (e.g., M6811_PORTA). I
          should be
          > > able to write to the TMSK1 register, as this controls whether
          interrupts
          > > are generated when using output compare.
          > >
          >
          > Thanks! I think I've seen the problem. Only TMSK2 is handled and
          writing
          > to TMSK1 is completely ignored (:-
          >
          > Stephane
          >
          >
          --------------------------------------------------
          ---------------------
          > Home Office
          > E-mail: stcarrez@w... Stephane.Carrez@s...
          > WWW: http://home.worldnet.fr/stcarrez http://www.sun.com
          > Mail: 17, rue Foucher Lepelletier 6, avenue Gustave Eiffel
          > 92130 Issy Les Moulineaux 78182 Saint Quentin en
          Yvelines
          > France
        Your message has been successfully submitted and would be delivered to recipients shortly.