Discussion in "AVR Discussion Forum" started by    ece    Mar 13, 2008.
Wed Mar 19 2008, 10:35 am
#11
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.
Wed Mar 19 2008, 01:11 pm
#12
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.
Tue Mar 25 2008, 11:11 am
#13
we are not getting u.can u pls make necessary changes in the code that we sent u.
Tue Mar 25 2008, 01:34 pm
#14
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.
Tue Mar 25 2008, 02:11 pm
#15
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
Tue Mar 25 2008, 10:38 pm
#16
may i take a look at your program once?
Wed Mar 26 2008, 12:41 am
#17
It's in the 1st page,Ajay.
Wed Mar 26 2008, 01:44 am
#18
is that program correct? Its just subroutines.. where is the main routine?

and UDR is a register not a bit.
Wed Mar 26 2008, 12:23 pm
#19


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

ece


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 Wed Mar 26 2008, 12:24 pm ]
Sun Apr 13 2008, 03:07 pm
#20
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.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

MichaelGot
Tue May 14 2024, 04:08 pm
FrankTrelm
Tue May 14 2024, 10:39 am
BillyTum
Tue May 14 2024, 09:08 am
Loganbag
Tue May 14 2024, 04:05 am
MichaelMog
Tue May 14 2024, 03:58 am
ThomasGaxaW
Mon May 13 2024, 05:33 pm
RobertInfup
Mon May 13 2024, 04:28 pm
Joshuatem
Mon May 13 2024, 08:30 am