programming techniques of AVR MCUs

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

Reply to
Roman Mashak
Loading thread data ...

formatting link
is pretty good for avr questions

Reply to
Alex Gibson

"Roman Mashak" skrev i meddelandet news:cnh0pt$839$ snipped-for-privacy@mpeks.tomsk.su...

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
This is a personal view which may or may not be
share by my Employer Atmel Nordic AB
Reply to
Ulf Samuelsson

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.