This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

Friday, February 13, 2015

Reaction Time Measurement


Preface

For patients with neurological disorder reaction time, time taken for in stimulus to generate and execute a reaction, is slightly more than others.

This could be used as a measure for extent of neurological problems. 
For normal people the reaction time, visual in this case, is around 120- 250 ms, But for a patient suffering from certain neurological disorder reaction time can be as long as 5 seconds.

Aim

I'm designing a device that can very accurately and efficiently measure the reaction time of any subject.


 

Thursday, September 27, 2012

AVR Hello World In Linux

I was thinking to shift to linux and i'm doing this in "packets" after "packets"...

Using backtrack (ubuntu). So to start with AVR on linux you need some libraries and their dependencies to download. Finally you need atmegaX MCU and a burner. I'm using low cost usb-asp In System Programmer (ISP).

Software:

1. binutils:  The GNU assembler, linker and binary utilities

2. gcc-avr: The GNU C compiler (cross-compiler for avr).

3. avr-libc: Package for the AVR C library, containing many utility functions.

4. uisp: A Micro In-System Programmer for Atmel's AVR MCUs (for burning code to MCUs' memory).

5. AVRDUDE: AVR programmer software that supports a wide variety of programmers. 
Hardware: 

1: AtmegaX : I'm using Atmega 16 microcontroller

2. AVR-Asp: A low cost in system programmer. (I got one from nex-robotics.com)

3. Target Board: You can make one of ur own or you can buy online.



Now Write a Programme in terminal or whatever you like:


sample:


* ledblink.c, an LED blinking program */
#include
#include
void sleep(uint8_t millisec)
{
        while(millisec)

        {
                _delay_ms(1);/* 1 ms delay */
                millisec--;
        }
}
main()
{

        DDRC |=1<
        while(1)
        {
                PORTC &= ~(1<
                sleep(100);/* 100 ms delay */

                PORTC |=(1<
                sleep(100);/* 100 ms delay */
        }
}

// end of program.

Save the program with name "led.c". And compile it with 

Compile the code:


avr-gcc -mmcu=atmega16 -Os led.c -o led.o


In the above command atmega16 defines the target mcu. 
0s code optimization level.
led.c is the input c code that we've just written.
led.o is the output binary file.


Generate hex code:


avr-objcopy -j .text -j .data -O ihex  led.o  led.hex


led.o is the output file from previous operation.

led.hex is the hex file that we've just generate using the above command.




Erase target MCU:


avrdude -c usbasp -p m16 -P /dev/ttyACM0 -e


avrdude is the application that handles IO (input/Output) interfacing between MCU and computer.

-c usbasp specifies the type of the programmer used. In my case i'm using "usbasp" programmer.
-p m16 specifies the target MCU. "m16" denotes "atmega16" in this case.

-P /dev/ttyACM0 specifies the where the USB programmer connected to the linux pc. In my case it's "/dev/dev/tty/ACM0"

-e specifies erase the flash memory of the target MCU.



Burn Hexfile to MCU:


avrdude -c usbasp -p m16 -P /dev/ttyACM0 -U flash:w:led.hex


-U flash:w:led.hex   specifies Write flash memory with the with the hex file followed by the command. In this case it is led.hex.  



That's all and your program will be written into MCU's flash memory. And it'll self reset and will start execute the program.
Enjoy..





Monday, September 24, 2012

Just created a shell account on shellmix.com. Configured it and to get into it open up Terminal (Putty in win32). Type "ssh -p 22 name@shellmix.com"  without the quotes. It connects  to Shellmix.com at port 22 and with my user name "name".


To create a new account  in shellmix.com:

Open Terminal and type "ssh -p 30 newuser@shellmix.com".
Then follow the steps.

Monday, June 28, 2010

Introduction

Hi, This is Tuhin. This is my first blog.