Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Saturday, May 18, 2013

USBasp programmer with avrdude(Linux)


    After success full  implementation of  serial programmer, I turned to make a USBasp programmer .The firmware is downloaded from USBasp official site.In this tutorial we will see how to use AVRdude for burning hex files into AVR microcontroller using USBasp. USBasp is a USB in-circuit programmer for Atmel AVR controllers. It simply consists of an ATMega8 and a couple of passive components. The programmer uses a firmware-only USB driver, no special USB controller is needed. In my circuit only use the six pins(MOSI,MISO,SCK,RESET,GND,+5V) from the usbasp to target microcontroller, It is little different from actual circuit in official site. No need of external +5V power supply to target microcontroller. The circuit is given below


USBasp programmer

NOTE:The fuse bits for 12Mhz crystal  HFUSE=0xc9 and  LFUSE=0xef  burn explicitly to  atmega8 using serial programmer(any programmer).It is very important, the USBasp programmer cannot work with default fuse bits. The command for setting the fuse bit:

avrdude -c ponyser -p m8 -P /dev/ttyS0 -U lfuse:w:0xc9:m -U hfuse:w:0xef:m

For reading the current fuse bit in atmega8:

avrdude -c ponyser -p m8 -P /dev/ttyS0 -U hfuse:r:high.bin:b -U lfuse:r:low.bin:b

Friday, May 17, 2013

AVR Serial Programmer

First I think, how to build a USBasp programmer.But I have n't a usb programmer to flash the firmware to it. Then decided to create a serial programmer and flash the firmware through this programmer to  atmega8. My  AVR serial programmer will transform hex file to most AVR microcontroller. It can build using few readily  available components. This programmer is compatible with popular avrdude software or PonyProg software.

We will be using the serial port for burning. First, we have to develop a burning circuit for it.

REQUIRED COMPONENTS 


Resistors :             10k     - 2
                           4.7k    - 2
                           15k     - 1

Zener diode :         5.1v   - 2


Diode :               1N4148 - 1


Transistor :      BC549/48 -  1


9-PIN RS232 female connector

serial programmer

Friday, September 21, 2012

Git Basics and Using Github

Hi, this blog entry is for beginners who want to try out Git and GitHub. I am setting up this on Ubuntu .

What is Git and How is setting Up with Ubuntu? :


Git  is a distributed revision control and source code management (SCM) system with an emphasis on speed. Git was initially designed and developed by Linus Torvalds for Linux kernel development.


Setting up Git in your system:

First install Git in your machine, Enter the command seen in Below in terminal(Alt+Shift+T):









You can test the installation by simply typing git.It should print out the instructions of Git

 












If you don't see this.then try to install Git again

Friday, March 2, 2012

Useful Commands for Linux Terminal (command line interface)

Fundamental Commands are given below:


  1. sudo: Executing Commands with Root Privileges


    Most of the following commands will need to be prefaced with the sudo command. which is necessary when working with directories or files not owned by your user account. When using sudo you will be prompted for your password. Only users with sudo (administrative) privileges will be able to use this command.




  1. Useful File and Directory Commands





  • The tilde (~) symbol indicates it is  your home directory. If you are user, then the tilde (~) stands for /home/user

  • pwd: The pwd command will allow you to know in which directory you're located (pwd stands for "print working directory"). Example: "pwd" in the Desktop directory will show "~/Desktop".

  • ls: The ls command used for showing the files in your current directory.

  • cd: The cd command will allow you to change directories. When you open a terminal you will be in your home directory. To move around the file system you will use cd. Examples:

    • To navigate into the root directory, use "cd /"

    • To navigate to your home directory, use "cd" or "cd ~"

    • To navigate up one directory level, use "cd .."

    • To navigate to the previous directory (or back), use "cd -"

    • To navigate through multiple levels of directory at once, specify the full directory path that you want to go to. For example, use, "cd /var/www" to go directly to the /www subdirectory of /var/. As another example, "cd ~/Desktop" will move you to the Desktop subdirectory inside your home directory.



  • cp: The cp command will make a copy of a file for you. Example: "cp jaseem job" will make an exact copy of "jaseem" and name it "job", but the file "jaseem" will still be there. If you are copying a directory, you must use "cp -r directory jasmedia" (copy recursively). (To understand what "recursively" means, think of it this way: to copy the directory and all its files and subdirectories and all their files and subdirectories of the subdirectories and all their files, and on and on, "recursively")

  • mv: The mv command will move a file to a different location or will rename a file. Examples are as follows: "mv jaseem jasmedia" will rename the file "jaseem" to "jasmedia". "mv jaseem ~/Desktop"will move the file "jaseem" to your Desktop directory but will not rename it. You must specify a new file name to rename a file.

    • To save on typing, you can substitute '~' in place of the home directory.

    • Note that if you are using mv with sudo you can use the ~ shortcut, because the terminal expands the ~ to your home directory. However, when you open a root shell with sudo -i or sudo -s, ~ will refer to the root account's home directory, not your own.



  • rm: Use this command to remove or delete a file in your directory.

  • rmdir: The rmdir command will delete an empty directory. To delete a directory and all of its contents recursively, use rm -r instead.

  • mkdir: The mkdir command will allow you to create directories. Example: "mkdir Document" will create a directory called "music".

  • man: The man command is used to show you the manual of other commands. Try "man man" to get the man page for man itself.


Running a File Within a Directory


So you've decided to run a file using the command-line? Well... there's a command for that too!

./filename.extension


After navigating to the file's parent directory, this command will enable any Ubuntu user to parse files compiled via gcc or any other programming language. Keep in mind that the 'extension' will vary depending upon the language the source code is written in. For example: ".c" for C source, ".cpp" for C++, ".rb" for Ruby, ".py" for python, etc. Also, remember that (in the case of interpreted languages like Ruby & Python) you must have a version of that language installed on Ubuntu before trying to run files written with it.

System Information Commands



  • df: displays filesystem disk space usage for all mounted partitions. "df -h" is probably the most useful - it uses megabytes (M) and gigabytes (G) instead of blocks to report. (-h means "human-readable")

  • du: The du command displays the disk usage for a directory. It can either display the space used for all subdirectories or the total for the directory you run it on. Example:


user@users-desktop:~$ du /media/cd

1032 /media/cd/files

1036 /media/cd/

user@users-desktop:~$ du -sh /media/cd

1.1M /media/cd/

where -s means "Summary" and -h means "Human Readable"

  • free: The free command displays the amount of free and used memory in the system. "free -m" will give the information using megabytes, which is probably most useful for current computers.

  • top: The top command displays information on your Linux system, running processes and system resources, including CPU, RAM & swap usage and total number of tasks being run. To exit top, press "q".

  • uname -a: The uname command with the -a option prints all system information, including machine name, kernel name & version, and a few other details. Most useful for checking which kernel you're using.

  • lsb_release -a: The lsb_release command with the -a option prints version information for the Linux release you're running

  • ip addr reports on your system's network interfaces.


Adding A New User


"adduser newuser" command will create a new general user called "newuser" on your system, and to assign a password for the newuser account use "passwd newuser".

Options


The default behaviour for a command may usually be modified by adding a --option to the command. The ls command for example has an -s option so that "ls -s" will include file sizes in the listing. There is also a -h option to get those sizes in a "human readable" format.

Options can be grouped in clusters so "ls -sh" is exactly the same command as "ls -s -h". Most options have a long version, prefixed with two dashes instead of one, so even "ls --size --human-readable" is the same command

I hope it is helpful for Ubuntu Biginners.....!

Wednesday, August 24, 2011

How to fix Grub Error after reinstalling Windows7 on a dual boot laptop ?

Problem is that After re-installing Windows7, When the laptop was rebooted, Grub Error 17 Message appeared.

Solution :

Boot from Ubuntu 10.04 LTS or other linux versions

Start Ubuntu Without installetion

Debian expert's shortcuts

MOUNTING NTFS FORMATTED DRIVES IN DEBIAN OS

Steps as follows:

  • first take the login window in system administaration and check the box to login local user


for ntfs file system mounting:

  1. First login using


user name:root

Password:your actual password

  • Next is creat folder in media ,like" /media/c"



  • then open terminal and type" fdisk -l".It gives the properties of partitions