.include in AVRStudio 3.2

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,
I'm trying to do something and I'm sure I'm not the first to ask this type of question but I can't find the answer.

What I would like to do is this.

.set _SharedPath = "C:\My Documents\Electronics\AVR\Shared\"

.include _SharedPath & "2313def.inc"
.include _SharedPath & "StdIOequ.inc"

you get the idea.

Also, are there any resources that explain how to make the best use of the directives in AVRStudio. The help file is hopeless as all it contains is the syntax and 1 miserable example.

Thanks for your help,
ozi

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi!

As I posted earlier, the place to look is really not the AVR Studio help, but the AVR Assembler User Guide. It's available on this site, and describes the syntax nicely (I think).

Best regards,

Morten, AVR tech. support, Atmel FAE

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Unfortunately, the assembler does not support what you are trying to do (by concatenating strings).
The v1.51 assembler supports specifying include search directories on the command line. This feature doesn't seem to have made it into the latest Studio release, but I guess they will add it there as well.

SIS

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry...

... my goldfish memory didn't allow room for more than ozi's last sentence (the one with "hopeless" in it ;) ) Thank you for the clarification, SIS.

Best regards,

Morten, AVR tech. support, Atmel FAE

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So are there any resources other than the assembler UG regarding the directives _usage_.

I'm trying to keep everything modular as per "Software Engineering 101" and that means lots of seperate .inc files with subroutines and macro's.

For example I need to know stuff like:
*Can macro's be defined in .include files or do they have to be 'inline'?

Thanks,
ozi

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

Yes, you can for instance have all your macros in one .inc file.

Best regards,

Morten, AVR tech. support, Atmel FAE

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Morten,
But that was really just an example of the kind of info that appears to be publicly unavailable.

So are there any resources on the net or do I just continue work this stuff out by trial-and-error (or asking q's on the forum)???

for example... I just discovered (by trial-and-error) that a macro has to be defined _before_ it is reffered too.

Thanks,
ozi

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi ozi,

Unfortunately, there is not much more official Atmel information beyond the assembler UM. However, the AVR Assembler is pretty simple. This has been commented before, in discussions concerning the AVR Assember versus the IAR assembler, and it's true! One of the reasons why this assembler is so simple, is that it should be easy to understand.

I think the number of issues or quirks with the assembler are so few that they can be addressed here, in this forum.

Has anybody else had difficulties using the AVR Assembler? If so, could you please post a follow-up here? It'd be a good idea to resolve all quirks here. I cannot think of any at the moment.

Best regards,

Morten, AVR tech. support, Atmel FAE

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't really think they're 'issues' but It is just sometimes difficult to tell when something doesn't work whether it's my mistake or whether it is the way the assembler is supposed to operate.

I agree the assembler is relatively simple and I really like the simulator but if would be good if there was some reference with plenty of examples of good programming practices. There is heaps of source code on the net but most of it's hobby stuff and doesn't show how to go about _developing_ assembler software and many don't use AVRStudio anyway.

Cheers,
ozi

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

That's the issue, isn't it? When project surpass a certain size, the developers tend to switch to a more intelligent assembler or to a higher-level-language compiler. The AVR instruction set is made for C, and the easy-to-use, cheap compilers out there make this language very accessible to even middle-range developers. Now that we've got the GCC compiler (free), it's even more accessible.

Best regards,

Morten, AVR tech. support, Atmel FAE

admin's test signature