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.

ATMEGA32 Sample progrms

Status
Not open for further replies.

villuribhanu

Junior Member level 1
Junior Member level 1
Joined
Oct 9, 2007
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
hyderabad
Activity points
1,393
atmega32 example

Hi to all,
Myself is Bhanu. I am having command on Assembly language for ATMEGA series. Now I want to write the code in C language for ATMEGA series.Can any one one help me in this aspect.
 

atmega delay

Could you be more specific.

i want compiler to you want to write and what?

:p
 

atmega32 adc code

villuribhanu said:
Hi to all,
Myself is Bhanu. I am having command on Assembly language for ATMEGA series. Now I want to write the code in C language for ATMEGA series.Can any one one help me in this aspect.


what exactly do you want, you have code in assembly and need to convert it?
 

atmega32 sample code

Hi,
Thanks all for responding to my quiery. Now I am trying to write my code in C language using the AVR Studio 4. I need some guide lines or sample programs in C which can be compiled by AVR STUDIO 4. Need sample programs like

1. UART Tx,Rx with and without interrupt
2. LCD 4 lines Data
3.SPI to EEPROM( The EEPROM u can suggest me)
4.ADC
5.PWM
6.SPI to Flash Memory

If u have more than this also u can forward to me.

With Regards,
Bhanu
 

atmega32 uart

villuribhanu said:
Hi,
Thanks all for responding to my quiery. Now I am trying to write my code in C language using the AVR Studio 4. I need some guide lines or sample programs in C which can be compiled by AVR STUDIO 4. Need sample programs like

1. UART Tx,Rx with and without interrupt
2. LCD 4 lines Data
3.SPI to EEPROM( The EEPROM u can suggest me)
4.ADC
5.PWM
6.SPI to Flash Memory

If u have more than this also u can forward to me.

With Regards,
Bhanu

regarding uart etc did you had a look at atmega32 datasheet Bhanu ? there is many use full information in it even some sample codes.
 

atmega32 code

Hi,
I gone through the datasheet. I wrote a code(UART) also.
But it was not working in Proteus. I am getting garbage values.
 

atmega32 uart example

villuribhanu said:
Hi,
I gone through the datasheet. I wrote a code(UART) also.
But it was not working in Proteus. I am getting garbage values.

can you post the code? and the dsn of proteus.

and y don't u try it in real life instead of simulating ?
 

atmega32 uart code

Hi,
This is my code. After getting output from proteus I want to make a board.
Proteus(DSN) was not attaching to this.If you dont mind can you give ur
mail ID so that i can forward it to you.

#include<avr/io.h>
void uart_init();
void delay();
unsigned char USART_Rx();

int main()
{
unsigned char data;

uart_init();

for(data='a';data<='z';data++)
{

while(!(UCSRA & 0X20));
UDR=data;
delay();
}

return 0;
}

void uart_init()
{
UBRRH=0;
UBRRL=52;
UCSRB=0X18;
UCSRC=0X86;

}

unsigned char USART_Rx()
{
while ( !(UCSRA & (1<<RXC)) );
return UDR;
}

void delay()
{
unsigned int i,j;
for (i=0;i<100 ;i++ )
for(j=0;j<30;j++);
}
 

uart atmega32

Hai,
Use ICC Compiler,it has the 30 days Eval full version,which has built in code generator
 

atmega example

Some compiler provide you a code generation such as CodeVision C compiler try to use it.
 

atmega32 codes

bascom is good

if anyone needs code and proteus files i can provide it .
 
atmega examples

Hi,
Thanks for you. But I need a source code which work in AVRStudio 4.If it so plz forward to me.
 

atmega32 samples

Visit on avrfreaks.net many AVR user in side.
 

sample atmega programs

villuribhanu what frequency are you using (Fosc) ?
 

atmega32 sample

villuribhanu said:
I am using Internal 1Mhz.

your UBRR register is set incorrectly. check on the datasheet of the atmega32 pg165, i also tried to simulate it on proeus it worked fine.

in that table found in page 165 you have the UBRR value for certain baudrates @ Fosc 1Mhz.
 

atmega32 sample programs

Hi,
Thanks for your response.
I changed my UBRR to 0x0c also
Still it is not working. If you dont maine
can you send the working code.

Hope a response for this mail.
 

atmega32 example code

villuribhanu said:
Hi,
Thanks for your response.
I changed my UBRR to 0x0c also
Still it is not working. If you dont maine
can you send the working code.

Hope a response for this mail.


now in the simulation (ISIS) set the atmega clock frequency to 1Mhz and set the virtual terminal baudrate to 4800 this should work.
 

atmega assembly

Hi,
I am using 9600 as baud rate.
But u mentioned that 4800. Can
u give me the clarity for this.
 

uart in atmega32

villuribhanu said:
Hi to all,
Myself is Bhanu. I am having command on Assembly language for ATMEGA series. Now I want to write the code in C language for ATMEGA series.Can any one one help me in this aspect.

here is a forum specially for avr micros, you can find bunch of full projects for avr in c or assembly.
www.avrfreaks.net
good luck.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top