The Atmel AVR and its Development Hardware Up Close

March 22nd, 2008 by Robot Technology | 1 Comment | Filed in Microcontroller

atmel microcontrollerThe AVR series consists of a fairly broad range of hybrid-bit-width microcontrollers (nominally 16-bit code word, 8-bit data bus and ALU) sharing a common instruction set and differing primarily in the on-chip peripherals and package options. These devices don’t show a clear genealogical relationship to any other microcontroller core I’m aware of, but some variants do show superficial signs of having been designed for people migrating away from the 8051 (the 40-pin AVRs are in a very similar pinout to a standard 40-pin 8051, for instance). AVR is a Harvard- architecture RISC core with 32 8-bit general-purpose registers, named R0—R31.

These registers are mapped into the core’s data address space at address $00-$1F. Registers R26—R31 have a secondary function for indirect addressing modes; they are divided into pairs named X (R26—R27), Y (R28—R29) and Z (R30—R31). Any of these three paired registers can be used as a 16-bit pointer into data RAM (the first register named is, in each case, the less significant byte of the address word). Most instructions can operate on any register; a few instructions (such as word-add, wordsubtract, and load immediate) can operate only on a subset of the registers, R16—R31. The AVR core also has a separate 64-byte I/O address space to interface with the on-chip peripherals. All of these peripheral control registers are conveniently mirrored in the general data address space at locations $20-$5F, so that you can access them with different addressing modes if you wish. The ATtiny26L also has 128 bytes of SRAM from $60-$DF, and the remainder of the data address space is unimplemented.

Tags: , , , ,

AVR Line Following Robot Tutorial

March 21st, 2008 by Robot Technology | 3 Comments | Filed in Electronics, Microcontroller, Programming, Robotics Tutorial, Sensors

Block Diagram

The robot uses IR sensors to sense the line, an array of 8 IR LEDs< (Tx) and sensors (Rx), facing the ground has been used in this setup. The output of the sensors is an analog signal which depends on the amount of light reflected back, this analog signal is given to the comparator to produce 0s and 1s which are then fed to the µC.

L4L3L2L1R1R2R3R4

Left ———— Center ————- Right

Sensor Array

Starting from the center, the sensors on the left are named L1, L2, L3, L4 and those on the right are named R1, R2, R3, R4.
Let us assume that when a sensor is on the line it reads 0 and when it is off the line it reads 1

The µC decides the next move so as to position the robot such that L1 and R1 both read 0 and the rest read 1.

L4L3

L2

L1

R1

R2

R3

R4

Left ————– Center ————— Right

Desired State L1=R1=0, and Rest=1

Algorithm:

Tags: , , , ,

Line Follower Robot Tutorial

March 20th, 2008 by Robot Technology | 79 Comments | Filed in Electronics, Mechanics, Microcontroller, Programming, Robotics Tutorial, Sensors, Software

Line Follower ROBOT

Plermjai Inchuay, plermjai@loxinfo.co.th

Award winner from VingPeaw Competition 2543, the robot built with 2051, L293D, and four IR sensors. Simple circuit and platform, quick tracking and easy-understand program using C language.

Line Follower Robot design

I designed my robot, which use two motors control rear wheels and the single front wheel is free. It has 4-infrared sensors on the bottom for detect black tracking tape, when the sensors detected black color, output of comparator, LM324 is low logic and the other the output is high. Microcontroller AT89C2051 and H-Bridge driver L293D were used to control direction and speed of motor.

line follower robot circuit

Tags: , , , , , , , , , , , , ,