Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Let's learn & build simple AVR project!Need ur participa

Status
Not open for further replies.
with winAVR :

Code:
#include <io.h>
void main (void)
{
     int i;
     DDRA |= 0x01;     //< put bit 0 of port 1 in output
     while(1)     //< forever loop
     {
          PORTA = PORTA ^ 0x01;     //< toggle bit 0 of PORT A
          i = 0x3FF;     //< dummy value to countdown
          while(i--);     //< dummy countdown for waiting then loop
     }
}
manitooo

BTW : the datasheet are fully provided with sample code (both in C and Asm) for all the differents contained blocks...
 

hi thomgun_lc,moof,ceaser,
this sounds interesting.THe most interesting thread i saw of late.But the pity is that i m a complete newbie guys.But i am really interested to learn with you guys.So you people are upto learning AVR uCs.I really dont have any idea of that hardware architecture.I am good at programming,8051 ,C,etc.I have good knowledge in Java and have completed a course in MS.NET technologies(C#,VB.NET,ASP.NET,XML).
I too wanna start with you all ;;) so can anyone suggest me where to start so that i can cope up with your flow share my part of work.Thanks guys.Will be waiting for ur response.
Kareja
Ok guys.I have read all the threads.Let me tell the way i learnt 8051 programming.
1.Architecture
2.Pin Configaration
3.Introduction to assembly language programming
4.Memeory management and Addressing Modes
5.Sample programs covering basic mnemonics,like trasfering data within the RAM,etc.Then using the ports.
6.Timer Programming
7.Serial Communication in 8051
8.Interrupts Programming
The one thing we culd not cover up is the interfacing part.Interfacing various devices like LCD,motors,etc.Then using rs232,etc,etc.
Dont you guys think thats really a better way of learning a new uC.I think we shuld first go through the architecture and come up some course module like thing i gave above.We can then decide and go for the better one.Then coming to programming part,i think we shuld first start with assembly and then move on to some other high level language.I feel thats the better way.This will also expose us more to the hardware side.Anyway guys,I will go through the AVR achitecture(i am completely newbie there)i downloaded the CodeVisionAVR evaluation.I ll play with it learn to use it.Any more suggestions please???coming to the projects things,we cant start off with a robot straight away.We shuld start with small intefaces like stepper motor,Using an LCD display,etc.Then we can move on to sensors like Photosensor and then make a switch which starts a bulb automatically after the sunset,etc
Also i find this board the best board for anything.I am also registering at the avrfreaks but we are lucky enough to have this thread permitted on the board.There were very good chances of this thread to get trashed.WE can use that board if we are stuck up somewhere.
thanks for the board for allowing such a good thread for newbies like us.
Kareja.
 

can anyone tell me where can i get c compiler or the editor for AVR programming. I'm newbie
 

Re: Let's learn & build simple AVR project!Need ur parti

tupai_pintar said:
can anyone tell me where can i get c compiler or the editor for AVR programming. I'm newbie

There are four different C compilers for AVR:

IAR: www.iar.com
CodeVisionAVR: www.hpinfotech.ro
ImageCraft ICCAVR + ICCtiny: www.imagecraft.com
AVR GCC: www.avrfreaks.net/AVRGCC

I would reccomend CodeVisionAVR, it's a good and stbale compiler and generates compact code, it's very easy to use also for beginners.
I use this compiler myself.

IAR is a very expensive and professional tool, it's way too expensive for private persons.

I ahven't used AVR GCC, but I have heard that this is a good compiler too, and the best thing about it: It's open source and FREE!!


Read this document, it compares the CodeVision, ImageCraft and AVR-GCC compilers. IAR is not included in this comparison because it's much more expensive than the three other compilers:
Which C-compiler should I choose? www.avrfreaks.net/Freaks/Articles/AdamJohnson/intro.php


The compilers should be used together with the free original Atmel AVR Studio IDE tool with assembler: www.atmel.com/dyn/products/tools.asp?family_id=607
 

Re: Let's learn & build simple AVR project!Need ur parti

excuse me . what is AVR? like arm?
 

Re: Let's learn & build simple AVR project!Need ur parti

fantaci said:
excuse me . what is AVR? like arm?
Not excactly.

Atmel AVR is the industry's largest selling 8-bit Flash Microcontroller with a market share of over 30 percent. The AVR is a bit similar to other 8-bit Flash Microcontollers like the Microchip PIC which is also popular.

Check these sites:

www.atmel.com/products/AVR

www.avrfreaks.net

www.atmel.com/dyn/corporate/view_detail.asp?FileName=Ships500M.html
Over the past six years, the AVR has become the industry's largest selling 8-bit Flash Microcontroller with a market share of over 30 percent.
 

Re: Let's learn & build simple AVR project!Need ur parti

I think that the C is "portable", and used with no hardware.
With harware, the C is not very interesting, exect for peiple that does not used the machine language.
For example, try to put a float in a 2313 in C..
you can see this:
**broken link removed**
lucas
 

Re: Let's learn & build simple AVR project!Need ur parti

Hi guys ,
I am new to the microcontroller world and I am just started to learn C programming . I have the " HOW YO PROGRAM C" book , 4th edition by Deitel . I visited the AVRfreaks site and there were many good things for beginners .Also they have some good learning kits . I want to buy one of them but I dont know which one to choose . Please advice me , so next time I will be ready to join you in your global AVR projects !!!!.
Thanx in advance ,
 

Re: Let's learn & build simple AVR project!Need ur parti

jaz396 said:
Hi guys ,
I am new to the microcontroller world and I am just started to learn C programming . I have the " HOW YO PROGRAM C" book , 4th edition by Deitel . I visited the AVRfreaks site and there were many good things for beginners .Also they have some good learning kits . I want to buy one of them but I dont know which one to choose . Please advice me , so next time I will be ready to join you in your global AVR projects !!!!.
Thanx in advance ,
I would advice you to buy the STK500 kit.
I have a STK500 and STK501 add-on board myself.
The STK500 is a great kit with lot's of features and you can also use it as an in-circuit programmer.
You can't find many MCU kit's at such a low price with so many features.

And I agree www.avrfreaks.net is the best resource for AVR programming and they have a great forum similar to this one, but only dedicated to AVR's.
You can buy STK500 for a good price at www.digikey.com


I have a book called "C++ How to program" from Deitel, I guess it's similar to your book. Good book for learning, but bad as a handbook.
It's hard to look up a special function or command when you want to find them later and read a short description of a certain function.
 

Me ,
Would you please recomend a good handbook other than "C HOW TO PTOGRAM" , or if there is a good web site this would be even better .
thanx.
 

Re: Let's learn & build simple AVR project!Need ur parti

jaz396 said:
Me ,
Would you please recomend a good handbook other than "C HOW TO PTOGRAM" , or if there is a good web site this would be even better .
thanx.
I often use this book as reference book:
The C Programming Language, 2nd edition
Authors: Brian W. Kernighan and Dennis M. Ritchie
Prentice Hall, Inc., 1988.
ISBN 0-13-110362-8 (paperback), 0-13-110370-9 (hardback).
Book website: **broken link removed**
As you can seee from this website, the book has been translated into many different languages.

Amazon: http://www.amazon.com/exec/obidos/t...=sr_11_1/104-3979090-2339121?v=glance&s=books

You can download it here:


I use it on my PC, which makes it faster to search for keywords.

The authors Kernighan and Ritchie are the developers of the C language.
It's fast to look up a specific command and read a short description of it.
If I want to read more details about it I use my other hardcopy book "C++ How To Program".

The original C language before the ANSI C standard was introduced is often referred to as K&R C, named after the developers of the C language and authors of this book.


Other good refernce books could be:

The Standard C Library
Author: P. J. Plauger
http://www.amazon.com/exec/obidos/t...c_gl_acc/104-3979090-2339121?v=glance&s=books
Uploaded here:


C: A Reference Manual (5th Edition)
Authors: Samuel P. Harbison and Guy L. Steele
http://www.amazon.com/exec/obidos/t..._books_1/104-3979090-2339121?v=glance&s=books

Read the book reviews at Amazon, it's always a good idea when you are looking for a new book.
 

Re: Let's learn & build simple AVR project!Need ur parti

Hi jaz936,
I wouldn't suggest to learn C language on a microcontroller target.
Get some old DOS machine, install Borland C++ or Turbo C++ on it
and go ahead with it. Why? The answer is: "better debugging options".
A debugger integrated with these environments can tell you
a lot of what the program does. This is useful especially when
you reach "dead end" and don't know what to do next to solve a problem.
...
Or pick up a JTAGICE adapter (several manufacturers provides them)
and debug the AVR over JTAG. See:
http://www.vanka.net/microice/avr-jtag-microice-mini-howto.htm
 

I agree, it best to learn C/C++ programming with a DOS screen first and first move on to microcontrollers later, it's easier this way.
I learned C/C++ programming with Microsoft Visual Studio and used a DOS screen as display and keyboard as input for my programs.
This is the easiest way to learn C or C++ programming.
 

Re: Let's learn & build simple AVR project!Need ur parti

Hoi anybody,i'm sorry i didn't show up for along time. So let's starting our project about learning programming in AVR ic. I have an idea, how about to build minimum system, so we can debug the real ic not only try with simulator program. SO WE CAN try that avr with a real hardware. Does anyone have a schematic about avr 8535 project board(include serial communication) in one pcb layout.THx.
 

Re: Let's learn & build simple AVR project!Need ur parti

thomgun_lc said:
Hoi anybody,i'm sorry i didn't show up for along time. So let's starting our project about learning programming in AVR ic. I have an idea, how about to build minimum system, so we can debug the real ic not only try with simulator program. SO WE CAN try that avr with a real hardware. Does anyone have a schematic about avr 8535 project board(include serial communication) in one pcb layout.THx.
Try using the www.avrfreaks.net forum instead.
 

Re: Let's learn & build simple AVR project!Need ur parti

OK,Thx everyone. Now,i'm still confused about what called "Jtag". Any body knows what is JTAG emulator. I only know if i wanted to emulated device, i must download the program to the target board, and then emulated with that board. What about JTAG??Can anyone help me
 

Re: Let's learn & build simple AVR project!Need ur parti

thomgun_lc said:
OK,Thx everyone. Now,i'm still confused about what called "Jtag". Any body knows what is JTAG emulator. I only know if i wanted to emulated device, i must download the program to the target board, and then emulated with that board. What about JTAG??Can anyone help me
JTAG can both be used for programming and On-chip Debugging.
Read AVR JTAG ICE User Guide:
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2737
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top