View Single Post
  #17   Spotlight this post!  
Unread 05-03-2002, 14:59
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
C and C++ are used to control hardware directly all the time. It's the operating system that abstracts the hardware, but in a situation like this an OS most likely wouldn't be used. Many processors use memory mapped I/O which allows access to input/output pins in much the same way that PBASIC does. By writing a value to a certain location in memory, you're actually setting the output pins to that value. Thus, in C or C++, you can access the input/output pins directly through the use of a pointer. This is done all the time in embedded systems. Realistically, for what we're doing here, microcontroller assembly wouldn't be much more difficult to learn than PBASIC. Also, x86 assembly isn't a very good comparison. If you look at the instruction set for something like an HC12 or similar, I think you'd find that it's a lot more simple than x86.

If such a microcontroller were to be used, FIRST could easily provide a library that initialized the processor, handled serial inputs/outputs, etc. All that would be left to the teams would be the traditional bit twiddling for input/output, and any calculations in between. However, you'd also be able to use interrupts and other features of the chip, not to mention the fact that it would run thousands of times faster than the BASIC stamp.

Personally, I'd like to see FIRST have some form of modular control system, which different user processors could be plugged into. Thus, new teams or teams without the knowledge required could just plug in the BASIC stamp module. But, for teams that wanted more power and don't mind assembly or C, there could be control modules with more powerful processors that would plug in.