Your ad can be shown here!
 
  Help
AI links
  :: main hierarchy ::
• Agent Software
• Artificial Life
• Cellular Automata
• Cognitive Science
• Companies
• Computer Vision
• Data Mining
• Decision Support
• Expert Systems
• Fuzzy Logic
• Game AI
• General Resources
• Genetic Algorithms
• Handwriting Recognition
• Information Retrieval
• Intelligent Agents
• Intelligent Interfaces
• Knowledge Management
• LISP
• Machine Learning
• Mobile Agents
• Nanotechnology
• Natural Language Understanding
• Neural Networks
• Online Books
• Philosophy
• Programming
• Prolog
• Robot Builders
• Robotics
• Speech Recognition
• Virtual Pets
• Web Agents
 
aboutAI.net Weekly Features
    BASIC for Robot Developers

BASIC for Robot Developers

Dateline: 07/13/99

Building an advanced robot typically involves some assembly language programming which consists of writing code in machine specific instruction set designed for the microprocessor of your choice. On a PC, several layers of abstraction shield the user from the details of the particular processor implementation and its low level interaction with the peripheral hardware. Robot builders often use microcontrollers, new and highly integrated subclass of the microprocessor family that combines the small size, low power consuption and computational abilities of its "older brothers" with the signal processing proficiency of discrete circuits. They commonly include several very important features that greatly simplify system design, including serial line communication, analog-to-digital converters, pulse counters, timers, etc. That's for the good news. Unfortunately, the computational overhead required for maintaining several layers of abstraction mentioned above means that you'll have to fully understand the bit-level interaction between the microcontroller and the devices it controls.

C was the first higher-level language used for programming microcontrollers and similar devices. Famous MC68HC11 series from Motorola was a favorite choice for robotics hobbyist some time ago. One of the most popular books for building mobile robots, "Mobile Robots : Inspiration to Implementation" by Jones and Flynn uses processor from this series as a base for an advanced robot. Randy Sargent, Anne Wright and Fred Martin from MIT designed an easy-to-use, freeware program called Interactive-C (IC) that includes such useful features as the ability to initiate and terminate processes and C statements immediately, without usual compile-link-load process.

Some higher level languages entered the world of microcontrollers recently, starting with the BASIC Stamp from Parallax, Inc. BASIC Stamp is small, "single-board" computer that runs Parallax BASIC (PBASIC) programs. It is called a "Stamp" simply because it is close to the size of an average postage stamp ( 1.4" -35 mm- L x 0.58" -15 mm- W x 0.13" -3 mm- D form BASIC Stamp I). Every device from this series has fully programmable I/O pins that can be used to directly interface to TTL-level devices, such as buttons, LEDs, speakers, potentiometers, and shift registers. With just a few extra components, these I/O pins can be connected to non-TTL devices, such as solenoids, relays, RS-232 networks, and other high current/voltage devices.


When compared to older programmable microcontrollers, these devices will save you weeks of work, because of their simple, but powerful, language structure and straight forward method of downloading and debugging.

Currently there are two functional versions of the BASIC Stamp and three physical versions. The BASIC Stamp line consists of the BASIC Stamp I and the BASIC Stamp II. The BASIC Stamp I is available in two package types - a through-hole/socketed package (with prototyping area) called the BASIC Stamp Rev. D and a 14-pin SIP, surface-mount package called the BS1-IC. Both versions are functionally equivalent (with the exception of the Reset pin) but are just in physically different packages. The BASIC Stamp II is only available in a 24-pin DIP, surface-mount package called the BS2-IC.

As for the functional differences, BASIC Stamp I has 8 I/O pins, room for 80 to 100 lines of code, executes approximately 2000 instructions per second and requires a parallel interface for programming. The BASIC Stamp II has 16 I/O pins, 2 dedicated serial port pins, room for 500 to 600 lines of code, executes approximately 4000 instructions per second and requires a serial interface for programming.

The items you'll need to get started with both versions include the programming software, the programming cable, the BASIC Stamp module itself, and optionally the appropriate carrier board. Your PBASIC code is tokenized (compressed) and stored within the Stamp's EEPROM memory. This memory is non-volatile, meaning it retains it's program even without power. Every time the BASIC Stamp receives power, it starts running its PBASIC code starting with the first executable line. This EEPROM can be rewritten immediately, without any lengthy erase cycle or procedure, by simply pressing ALT-R in the BASIC Stamp editor again.

An excellent choice of additional hardware an accessories (including several walking and wheeled robots, RAM packs, wireless modules, expansion boards) and long list of books and articles available for free download makes Stamp an excellent tool for beginners (including school children), quick prototyping, and even more advanced projects.

Now when BASIC has established its position in this community, there are even more exciting news. NetMedia, Inc. recently announced BasicX, a microntoller then can be programmed in a BASIC dialect almost identical (subset-compatible) to the Microsoft's Visual Basic™! Requiring only an external crystal and a 2.8 - 6.0 volt source to run the BasicX microprocessor is another great choice for engineers and hobbyists that require an easy to program microcontroller with fast code execution speed and large amounts of EEPROM for code storage. After downloading your program to the BasicX (either to it's internal or external EEPROM) the compiled data is then extracted at startup by a built-in high speed interpreter that converts your code into machine language that is then executed by the BasicX's ATMEL 8515 RISC processor (at 65,000 lines of code per second!). By adding one 8 pin SPI chip the BasicX chip now has 32K of user available EEPROM for code/program storage that can easily be expanded to 64K. Code can be downloaded into RAM for even faster execution exceeding 100,000 Basic statements per second.

The BasicX chip introduces several very advanced features, including built-in multitasking operating system that executes BASIC language statements. Basic subroutines can be CALLed as normal or CALLTASKed in parallel. Tasks can share global variables, perform I/O, network, sleep and alarm, start and stop other tasks and interrupt on critical events. A built-in peer-to-peer network in each BasicX chip is similar to the same feature in BASIC Stamp: it allows you to interconnect multiple chips with just two wires and an external RS485 chip. The network runs at any speed from 300 to 500,000 baud.

NetMedia also introduces several projects and devices to help showcase the abilities of its main MCU. One of them is Fluffy 2, a fully autonomous robot spider capable of detecting and avoiding obstacles while exploring its environment. It is built around the Hexapod 2 spider type chassis kit available from LynxMotion, has 12 servos and panning Polaroid sonar sensor.

BASIC is not the only newcomer to this field. Considering the hype surrounding Java, it was only the question of time when people will start using it for programming microcontrollers and similar devices. The time has come: picoJava™ processor cores comprise the central component of a microprocessor or controller chip. Chips based on the picoJava core are suited for consumer electronic products that run Java applications (like digital set-top boxes, Internet TVs, Internet screen phones and automotive communications devices). The combination of the small size of the processor core and the performance gained from direct execution of Java code instructions, means that smaller, higher performance devices such as cellular phones, TV set top boxes and other information appliances can be rapidly developed and brought to market.

   Site(s) of interest:

  • Parallax, Inc.
    Parallax, Inc. home site - plenty of books, articles, tutorials, samples and other very useful material (besides info on their products).
  • Stamps in Class
    "What's a Microcontroller?" educational curriculum is now available for download.
  • Scenix
    Scenix SX MCU is advertised as the fastest 8-bit microcontroller in the world.
  • Larry Barello's Home Page
    A small real time operating system (RTOS) called AvrX for the Atmel AVR® series of microcontrollers.
  • microcontroller.com
    An excellent resource for the professional embedded developer.
  • BasicX
    If you are familiar with Visual Basic, and want to try programming microcontrollers, here's a great way to start. Considering the features of BasicX MCU, you may stick to it for a long time...
  • picoJava
    Chips based on the picoJava core are ideally suited for consumer electronic products that run Java applications.
  • 68HC11 Microcontrollers Resources
    Great compilation of links related to Motorola 68HC11 and similar MCUs.

Talk about AI-related topics at Artificial Intelligence Bulletin Board.

Want more timely information and resources related to AI? Subscribe to our FREE newsletter!

Got some specific AI related questions or need consulting services? Contact your webmaster, Denis Susac.

Talk with people who share your interests...

Previous Features

S p o n s o r e d    b y...

Buy the ER1 Robot!