Tuesday, May 20, 2008

Input to the microcontroller

Now it seems really simple to blink a LED using a microcontroller.The earlier mentioned program is the simplest to achieve the task.It just uses the port registers.In a expert way , we can achieve the same by using the timer(TCCR),counter(TCNT) and interrupt(TIMSK) registers.In this case,the timer is set and counter starts counting up or down depending on the values set in the TCNT register.When the timer overflows,TOV0 bit of flag register is set(set to zero).The interrupt can be enabled by setting the bits of TIMSK register.The code consists of just 5 to 6 lines which can be easily coded by reading Atmega8 datasheet.

Next step is to give input to microcontroller and get the output according to it.This task can be easily accomplished by writing a small program that uses the 3 port registers(PORTX,PINX,DDRX).A modified version of this code is used as the program for the line following robot.

If you can code for fullfilling the above 2 tasks,then we assure you that you can build your own maiden robot...
We studied this from experience and thus we gurantees it...

Any doubts and suggestions are always welcome and we have no hestitation to help...We look forward for genuine replys...

No comments: