Microb Technology/2008/Main code

De Wikidroids

Current page: Microb_Technology / 2008 / Main_code

Sommaire

Overview

What we call the main code in our robot is the program that is executed on the motherboard of the robot, composed of several AVR microcontrollers. The code is based on Aversive. It's only the "brain" of our robot and does not include the code for the beacons, the vision system, ...

You can refer to our electronics page to have more details about the motherboard.

See the planning for the main code.

Core: AVR ATMega 128

This uC does the biggest part of the job. It gathers informations from all sensors (beacons, vision system, sensors of extension uC, and its own sensors). Then it takes the correct decision (we hope so), and controls the main actuators (like the wheel motors) to execute the corresponding action.

  • Control System

Here you can find a documentation about our control system implementation (in french).

  • I2C communication

A small documentation about our i2c driver is now available.

Extension: AVR ATMega 32

The role of this uC is to control some external motors, servos, and to read the values coming from sensors. It is globally autonomous, but it receives its commands from the Core uC and sends a status to it through the I2C bus.

The protocol between main board and extension board is now defined.

Encoders: AVR AT90S2313

There are several AT90S2313 on our motherboard. Their role is to decode the 4 signals coming from 2 odometers (2 channels A and B by encoder). Each encoder deliver a 2 bit gray counter, and the uC is able to keep an internal value of a 8 bits natural counter that is controlled by each encoder. A selection bit allow to select which counter has to be written on a port (encoder 1 or encoder 2).

The code is written in assembly to be very fast and support frequencies above 100KHz for A and B.

Boîte à outils
LANGUAGES