programming techniques of AVR MCUs

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hello, All!

I have a general question related to development procedure for AVR.
Are there ane common recommendations about building programs for 8-bit AVR,
like. I know, one of them - not to use global variables where it's possible,
and how about structurual programming, splitting all code into
functions/procedures rather then using it in one common piece?

How is it affected on code size (i think it's not too much dependent on
compiler?)  Anyway, in my case I'm using WinAVR...

Thanks in advance.

With best regards, Roman Mashak.  E-mail: snipped-for-privacy@tusur.ru



Re: programming techniques of AVR MCUs

Quoted text here. Click to load it

www.avrfreaks.net is pretty good for avr questions




Re: programming techniques of AVR MCUs

Quoted text here. Click to load it
AVR,
possible,


If you have a compiler that can optimize the global variables into registers
it is not so bad!
Can reduce code quite a lot by this trick!
I took a  5kB customer application and fitted into 4kB by putting a few
glbal variables into R0-R15
Thik it was about 8 variables.

--
Best Regards,
Ulf Samuelsson   ulf@a-t-m-e-l.com
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline