AT91SAM7S16 Header File?

All design tool related questions: compiler, assembler, linker. Embedded programming questions: assembler, C code.

Moderator: nferre

AdamDG
Posts: 9
Joined: Thu Dec 06, 2012 2:10 am

AT91SAM7S16 Header File?

Thu Dec 06, 2012 2:44 am

Hi,

For a university project I am getting started for the first time working with a SAM7 chip. The hardware design that I have been presented with uses an AT91SAM7S16.

For the past few weeks I have been trying to familiarise with examples and tutorials, as I've not worked with startup code in assembly or linker scripts before. I believe I've just about learned enough to start programming - without just hacking away at somebody else's code.

Now, it seems to me that if you're not working with an evaluation board, the only header file you really need is one of the AT91SAM7S*.h ones. I've downloaded from Atmel (http://www.atmel.com/tools/AT91SAMSOFTWAREPACKAGE.aspx) the most recent AT91LIB (version 1.9). What I've noticed though is that there doesn't seem to be an AT91SAM7S16.h file, whereas there's a corresponding file for just about every other chip.

I'm assuming that I'll need to use the AT91SAM7S32.h file instead, as it's the only other SAM7 with the same pinout as the 16. What I'd like to know from the experts however, is whether or not the definitions in the AT91SAM7S32.h file do in fact apply to the SAM7S16.

Apologies that this is quite a basic question, but I couldn't find the answer online. I'm trying to remove all of these uncertainties so that when my first program inevitably doesn't work, I can narrow down to the cause a lot faster.

Thanks in advance.
jharley
Posts: 238
Joined: Thu Dec 06, 2012 6:40 am

Re: AT91SAM7S16 Header File?

Thu Dec 06, 2012 6:59 am

have a look at the at91sam7s161.h file (looks like it is incorrectly named), it should work for you...
AdamDG
Posts: 9
Joined: Thu Dec 06, 2012 2:10 am

Re: AT91SAM7S16 Header File?

Thu Dec 06, 2012 7:33 am

Thanks for the reply, but I've looked into that already. The SAM7S161 is another 64 pin MCU, but the SAM7S16 has 48 pins. The first 48 on each don't match up either, so I don't think that header file would work.
jharley
Posts: 238
Joined: Thu Dec 06, 2012 6:40 am

Re: AT91SAM7S16 Header File?

Thu Dec 06, 2012 8:04 am

No, seriously... the file is for the AT91SAM7S16.

Grab the data sheet and verify for yourself that the addresses, peripherials and memory definitions match up.

If you prefer you can use the AT91SAM7S32 the only difference is the memory definitions at the end of the file. If you use any of these defines in your code you will have to change these to what is shown in the *incorrectly named* AT91SAM7S161.h file.

or you can simply rename the AT91SAM7S161.h file to AT91SAM7S16.h and use it.

Best Regards.
AdamDG
Posts: 9
Joined: Thu Dec 06, 2012 2:10 am

Re: AT91SAM7S16 Header File?

Thu Dec 06, 2012 9:14 am

Wow, sorry, you're absolutely right. It even says "File Name : AT91SAM7S16.h" in the comments at the top of the file.

Strange that they got it right for the 32 and 321 models then.

Thanks a lot anyway, that's one less thing to worry about

Return to “Development Tools”

Who is online

Users browsing this forum: Google [Bot] and 1 guest