AVR ???

hgmjr

Joined Jan 28, 2005
9,027
It is nice to have another AVR using member in the forum.

I look forward to your future AVR project related threads.

hgmjr
 

Thread Starter

Mathematics!

Joined Jul 21, 2008
1,036
O, The told me at avr freak it is an optimization problem.
change -Os to -O0 in the general configuration and sure enough it worked.

Yeeeeeeeeeeeessssssssss.

However I programmed the program first into eeprom but it didn't start executing until I put the program into flash any reason for this.

Blinks fine now.
Curious to know what the optimiztion is doing to screw the program up?
 

Thread Starter

Mathematics!

Joined Jul 21, 2008
1,036
Ok , I got it they told me
Either set no optimization (-O0 , thats "Oh zero")
or use the delay header file

I set the -Os option in the general tab in the configuration properties to -O0
And it works like a charm.
Curious to know why the -Os messy's the blinking.

Cool I am all good for know
Thanks
 

hgmjr

Joined Jan 28, 2005
9,027
Ok , I got it they told me
Either set no optimization (-O0 , thats "Oh zero")
or use the delay header file

I set the -Os option in the general tab in the configuration properties to -O0
And it works like a charm.
Curious to know why the -Os messy's the blinking.

Cool I am all good for know
Thanks
Without knowing the specifics behind the optimizing algorithm it is difficult to say exactly what code it is optimizing out of the program. I do know that -Os (s is for small), is pretty aggressive at saving memory that it deems useless since it is trying to keep the code as compact as possible.

hgmjr
 

Thread Starter

Mathematics!

Joined Jul 21, 2008
1,036
yes, and I believe it was getting rid of the for loop ;
Makes since , since when I was trying to jump into the method in debug it won't let me probably because it wasn't on the chip or it was just a return or something.

But anyway I figured it out ( or at least avr freak guy's did)

Anyway now that I figured how to program the avr chips.
I am wondering what their many application is.
And is their any benfit in useing PIC over AVR?
Aside from the fact that AVR software is free.

Can you use these chips for wireless applications like sending one chip a message wirelessly by putting an small wire stick out of a pin (like a small anntena).
Or do you need the expensive zigbee.
 

hgmjr

Joined Jan 28, 2005
9,027
yes, and I believe it was getting rid of the for loop ;
Makes since , since when I was trying to jump into the method in debug it won't let me probably because it wasn't on the chip or it was just a return or something.

But anyway I figured it out ( or at least avr freak guy's did)

Anyway now that I figured how to program the avr chips.
I am wondering what their many application is.
The extent of your imagination is the only limitation in what a microcontroller can be used to do. There is robotics, PID controllers, data collection and interpretation, RFID interfacing, just to name a few.
And is their any benefit in using PIC over AVR?
Since you are programming in C-language then the two are basically equivalent. If you were using assembly language, I would recommend the AVR product over the PIC.

Aside from the fact that AVR software is free.
This one aspect of AVR won me over. Not only is the software free but both the Assembly Language and the C-language programming tools are full feature. Neither one is crippled in any way.
Can you use these chips for wireless applications like sending one chip a message wirelessly by putting an small wire stick out of a pin (like a small anntena).
Or do you need the expensive zigbee.
Neither the PIC nor the AVR microcontrollers support wireless without the need for additional RF circuitry. Zigbee is not the only source of RF transmitters/receivers. There are other sources of RF modules that you can use.

hgmjr
 

hgmjr

Joined Jan 28, 2005
9,027
The ATMEGA32 io pin should not be connected directly to the LED with its cathode to ground. You should have a series current limiting resistor between the ATMEGA32's output and the LED's anode. You are correct to connect the cathode to ground.

hgmjr
Hey, I just tried this usb unplug experiment and sure enough my AVR doesn't work either. What I suspect is that the programmer loads the reset line if you only unplug the usb connection.

The best thing to do if you don't need the programmer is to unplug it from the ISP connector on your target board. I think this is a reasonable strategy.

hgmjr
 
Top