To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcxOpen lugnet.robotics.rcx in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / 2641
2640  |  2642
Subject: 
Re: 8 bit timer problem
Newsgroups: 
lugnet.robotics.rcx
Date: 
Thu, 19 May 2005 18:43:37 GMT
Viewed: 
5102 times
  
In lugnet.robotics.rcx, Martin Toft wrote:
This is my interrupt handler:

    void handler(void)
    {
      asm("push r0 \n\t" // Save registers
          "push r1 \n\t" // CCR and r6 are saved by
          "push r2 \n\t" // ROM dispatcher
          "push r3 \n\t"
          "push r4 \n\t"
          "push r5 \n\t"
          "bset #7, @0x80:8 \n\t" // Start motor A
          "bclr #6, @0xc3:8 \n\t" // Clear CMFA
                                  // (bit 6 of
                                  // TCSR)
          "pop r5 \n\t" // Restore registers
          "pop r4 \n\t"
          "pop r3 \n\t"
          "pop r2 \n\t"
          "pop r1 \n\t"
          "pop r0"
          );
    }

I expect motor A to start when the interrupt is
requested by the timer, but nothing happens. At
this point I am very lost :( Does somebody have a
solution for the riddle?

Looks like a typo - try this in your handler instead:

          "bclr #6, @0xc9:8 \n\t" // Clear CMFA
                                  // (bit 6 of
                                  // TCSR)

I haven't really checked the rest of the code for
anything else, though.

HTH,

Mark



Message has 1 Reply:
  Re: 8 bit timer problem
 
(...) Sorry, my mistake. I actually wrote the correct address in the code on my machine. (...) Thanks anyway :) (...) (19 years ago, 20-May-05, to lugnet.robotics.rcx)

Message is in Reply To:
  8 bit timer problem
 
Hi I am a member of a project group at Aalborg University, Denmark, and the goal for our project on this semester is to code an operating system for the RCX brick from Lego. During a whole week, I have been strugling with the 8 bit timers of the (...) (19 years ago, 19-May-05, to lugnet.robotics.rcx)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR