programming techniques of AVR MCUs

Nov 18, 2004 2 Replies

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


formatting link
is pretty good for avr questions

"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

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required