8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes :: Forums :: Discuss and Learn :: AVR Discussion Forum
 
<< Previous thread | Next thread >>
serial communication for AVR microcontroller
Go to page  1 [2] 3
Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
ece
Tue Mar 18 2008, 10:05PM
 User Offline
Registered Member #3950
Joined: Tue Sep 11 2007, 06:55AM

Posts: 13
Thanked 0 times in 0 posts
we dont know whether to use clock or not.we are new to this concept.can u help in modifying our program or send us new one that can run.

Back to top


Ajay
Wed Mar 19 2008, 12:41AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3529
Thanked 644 times in 609 posts
Please go through the tutorial and datasheet. Write something and if you get any problem then post here.

We do not provide codes as such you know that. So you can take the tutorial codes as reference.

One suggestion.. use normal timers to provide delay, after half time of make the transition on port pin..
lets say your 100mS is the total time.. so 50mS for high and 50mS for low, will give you 100mS of square wave with equal proportion.
Just convert the frequency to time period (total time) and then generate delay of half the time.

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


ece
Mon Mar 24 2008, 10:41PM
 User Offline
Registered Member #3950
Joined: Tue Sep 11 2007, 06:55AM

Posts: 13
Thanked 0 times in 0 posts
we are not getting u.can u pls make necessary changes in the code that we sent u.
Back to top


sashijoseph
Tue Mar 25 2008, 01:04AM

 User Offline
Registered Member #5870
Joined: Mon Feb 04 2008, 06:26PM

Posts: 496
Thanked 112 times in 105 posts
Your code seems to be ok.
Are you using an external 4Mhz crystal?
Can you tell us about your hardware connections....like crystal,reset pin,uart pins etc.
Have you programmed the fuse bits? If not then you shouldn't be using an externl crystal coz the Atmega(when bought new and with no fuse bits done) defaults to a 1Mhz internal rc clock.
Which programmer are you using?
Finally I would suggest writing a small LED blinking program for portA or portB and checking whether your chip is working in the 1st place.

Let there be music........
Back to top


ece
Tue Mar 25 2008, 01:41AM
 User Offline
Registered Member #3950
Joined: Tue Sep 11 2007, 06:55AM

Posts: 13
Thanked 0 times in 0 posts
v hav already tested the chip wid simple led programs. v r using a 16Mhz external
crystal. v can transmit through our program btwen it comes in recieve mode UDR bit goes zero. v saw this in IO view of AVR STUDIO4 nd have nt done practically wid kit
Back to top


Ajay
Tue Mar 25 2008, 10:08AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3529
Thanked 644 times in 609 posts
may i take a look at your program once?

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


sashijoseph
Tue Mar 25 2008, 12:11PM

 User Offline
Registered Member #5870
Joined: Mon Feb 04 2008, 06:26PM

Posts: 496
Thanked 112 times in 105 posts
It's in the 1st page,Ajay.

Let there be music........
Back to top


Ajay
Tue Mar 25 2008, 01:14PM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3529
Thanked 644 times in 609 posts
is that program correct? Its just subroutines.. where is the main routine?

and UDR is a register not a bit.

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


sashijoseph
Tue Mar 25 2008, 11:53PM

 User Offline
Registered Member #5870
Joined: Mon Feb 04 2008, 06:26PM

Posts: 496
Thanked 112 times in 105 posts
ece wrote ...

v hav already tested the chip wid simple led programs. v r using a 16Mhz external
crystal. v can transmit through our program btwen it comes in recieve mode UDR bit goes zero. v saw this in IO view of AVR STUDIO4 nd have nt done practically wid kit

UDR bit??You meant UDRregister(byte) didn't you.
In I/O view of AVR Studio you will get UDR=0x00 because there's no hardware UART simulation provided by which you can latch in a byte to the RX shift register and from there to the UDR.
Probably you are assuming that the TX byte you sent out should be received into UDR by your 'receive' routine.But this is possible only in hardware when you loop back the byte by shorting the TX and RX pins.
Not possible in simulation.
So burn your program and test in hardware.

[ Edited Tue Mar 25 2008, 11:54PM ]

Let there be music........
Back to top


pdi33
Sun Apr 13 2008, 02:37AM

 User Offline
Registered Member #1329
Joined: Mon Jun 04 2007, 09:28AM

Posts: 548
Thanked 109 times in 105 posts
just check if the IC is ATmega32 or ATmeag32L. If it is ATmeag32L, then the max. frequency it can operate is 8mhz and not 16mhz.
download WinAVR GCC( it is free!!) . It automatically integrates with AVRstudio4. U will find writing a c program much easier especially for serial communication as the WinAVR has a great library for serial communication for AVRs.

* inspired to develop,developing to inspire *
Back to top


Go to page  1 [2] 3  

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems