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.

c programming with ATMEGA16

Status
Not open for further replies.

mahesh.pawaskar

Newbie level 4
Joined
Apr 5, 2010
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Ratnagiri
Activity points
1,323
I want to learn c prgramming with ATMEGA16. where can i get sample tutorial for programming.
I am familier with c programming with 8051. Which e-book i should refer?
 

Hi mahesh.pawaskar
if you are already familiar with C and any other controller then i don't think you really need e-book for working with ATMEGA16.
just grab the datasheet, programming tool and easy compiler. I would suggest MikroC for AVR from mikroElectronica. It's easy to use, lots of examples and very rich set of inbuilt library.
 

If you get to know ATmega16, you can then work with all mega AVRs. More or less they are the same, having some slight differences on some register names (eeprom and watchdog just came in mind). Other AVRs have more pins or more peripherals, but the philosophy is the same. If we speak about architecture, you should look into power on and reset, power reduction registers, power down and sleep modes and maybe a couple of more. If you use C, then as s_guria pointed out you needn't change the structure of your code, just the low level routines (IO, ADC, UART, SPI, I2C etc). Of course the product's datasheet is the most important to start with and in parallel you should choose a compiler.

Datasheet:
http://www.atmel.com/dyn/resources/prod_documents/doc2466.pdf

Some helpfull referneces:
**broken link removed**
ATmega16 :: AVR Freaks
**broken link removed**

As for compilers, Atmel's AVRStudio (GCC compiler) free tool is very popular. Other compilers you could look into is Arduino, CodeVisionAVR, microC and IAR EW.

Finally, attached please find two datasheets for AVR core.
View attachment AVR Core.pdf
View attachment AVR Core Summary.pdf

I think all the above give you a starting point! ;-)
Welcome to the AVR world! :)
 

SR i m familier with all the programming for 8051 microcontroller.....sr now i want to move at ATmega16.....so plz tell me that which compiler will be most suitable.........i used keil compiler till now for 8051..................
 

You can try MikroC for AVR its free to use. You can compile up to 2KB of code data with free edition, for bigger code you should get licence.
 

Re: GEtting started with ATmega16

avr c compilers

1,WinAVR : AVR-GCC for Windows
2,IAR Embedded Workbench
3,CodeVisionAVR
4,Imagecraft

- - - Updated - - -

WinAVR+avr studio 4 is my choice

**broken link removed**
 
Rather than simply repost the same reply three times, which I've now deleted two of the duplicates, try replying with a more meaningful response.

Perhaps, posting your code using either CODE or SYNTAX tags so that we may advise you on the more appropriate compiler for your situation.

BigDog
 

You will see lots of shift operations in AVR microcontroller programming.
for example to set any pin High
#define LED PB0
PORTB|=(1<<PB0).
It makes PB0 pin as High
PORTB&=~(1<<PB0).
it makes PB0 Pin as Low.

Start reading Simple I/O Operations like making Led On and Off.
Just read Datasheets.
 

sir in my program using Avr studio 4 along with Winarvr.....i am facing a problem like......
c:/winavr-20100110/lib/gcc/../../avr/include/util/delay.h:90:3: warning: #warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed"
what should i do?
sir as i an thinking that it is not detecting my delay's function....
 

open the project properties and change the optimization level to Os.
Why did you disable it in the first place?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top