To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 12711
12710  |  12712
Subject: 
Re: programming the Hitachi H8... (newbie question)
Newsgroups: 
lugnet.robotics
Date: 
Mon, 9 Oct 2000 03:14:35 GMT
Original-From: 
Steve Baker <sjbaker1@airmail#nomorespam#.net>
Reply-To: 
sjbaker1@airmail.netANTISPAM
Viewed: 
655 times
  
Colin Reinhardt wrote:

I am new to Lego Mindstorms and just got a RIS 1.5 for my birthday.

...I have a passion to understand how computer systems work at the low levels.


Well, (I'm also a C++ programmer - with a similar background - who got a
RIS for his birthday this year).

There are two choices that suit people like you and I.

The *simplest* is 'NQC' (Not Quite C) - which is a *small* C subset
that compiles into the special byte-code that the Lego robotics
firmware interprets in realtime.

However, for more serious programs (and if you need to get into the
low level machinecode)...you'll want to replace the Lego firmware and
use 'LegOS' instead.  This is a nice realtime operating system that
can be downloaded into the RCX controller in place of the Lego firmware.

With LegOS in place, you can grab a copy of the standard 'gcc' compiler
suite (such as Linux and Cygwin use) - but set up as a cross-compiler
for the H8 microprocessor that's in the RCX brick.

Once you get that done, you should be able to write H8 assembly code
into a C framework and run it under LegOS.

When I heard about Lego robotics it occurred to me that this might be a
great opportunity to learn more and experiment with low-level programming
and systems, on a processor which I assume is relatively simple (compared to
the current Intel Pentium family and other modern cutting-edge CPUs...)

I think you are right...the only problem is that debugging programs inside
the RCX brick is fiercely difficult.  There is hardly any way to see what's
going on inside!  The LCD display is rather limited and your only inputs
are the sensors - which are already (presumably) in use in controlling
the robot.

So, you'll want to be REALLY careful with writing good code from day #1
because it's going to be 'interesting' to try to catch some of the more
subtle errors that you get with assembler.

Anyway - I'm just getting into LegOS.   I still believe that if you just
want to play with some simple robotics, NQC is the way to go...at least
to start with.

I found there was *quite* enough to learn about the subtleties of controlling
motors, reading shaft encoders, preventing the robots from destroying themselves
under the power of their own drivetrains, the ideosyncrasies of Lego 'geometry'...
...etc.

I guess I'd like to experiment with writing assembly instructions to the
Hitachi H8 microcontroller directly, if possible, and learning about writing
low-level systems and the related skills, like debugging, testing, analysis,
etc...

Then NQC is no use to you - get LegOS and install GCC as a cross-compiler
on your computer.

--
Steve Baker   HomeEmail: <sjbaker1@airmail.net>
              WorkEmail: <sjbaker@link.com>
              HomePage : http://web2.airmail.net/sjbaker1
              Projects : http://plib.sourceforge.net
                         http://tuxaqfh.sourceforge.net
                         http://tuxkart.sourceforge.net
                         http://prettypoly.sourceforge.net



Message has 1 Reply:
  Re: programming the Hitachi H8... (newbie question)
 
Thanks for the info Steve! I've read a little about NQC and LegOS and as you describe LegOS appeals to me for the raw low-level support it offers. (...) What do you mean "setup as a cross-compiler"? I'm not familiar with that process... Is there a (...) (24 years ago, 9-Oct-00, to lugnet.robotics)

Message is in Reply To:
  programming the Hitachi H8... (newbie question)
 
Hi, I am new to Lego Mindstorms and just got a RIS 1.5 for my birthday. Let me start with a brief background info on myself: By profession I'm a C++ programmer who does COM+ development. I'm not a formally educated computer scientist however (no CS (...) (24 years ago, 8-Oct-00, to lugnet.robotics)

4 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