Looking for AVR32 assembly language tutorial

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

I'm looking for AVR32 assembly language documentation that will help me understand the processor registers, calling conventions, exception and interrupt handling, stack frames, etc.

Please don't refer me to the 8-bit AVR tutorials - the AVR and AVR32 are *completely* different processors.

Please don't refer me to the AVR32 Architecture Document doc32000.pdf. I have it, and it is a specification to chip designers on how to make new flavors of the AVR32. It is not a tutorial to a programmer on how to write programs.

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

I think you may be out of luck. The AVR32 Architecture Document is the only resource available that I know of that covers the AVR32 instruction set and syntax.

Are you trying to solve a particular problem? If so, post it here; there are several people that may be able to help.

Letting the smoke out since 1978

 

 

 

 

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

Dan -
Thanks for responding.

I'm just trying to be as knowledgeable on AVR32 as I am on 8-bit AVR, ARM, x86, and 68xxx. Whenever I debug C/C++, I pay attention to the disassembly windows, etc. How can you debug ISRs, write peripheral drivers, etc. if you don't know anything about the underlying machine?

The other day I was debugging a data bus exception. I read some mention about the BEAR register, but there isn't enough written to help very much.

Where does Atmel documentation tell me which way the stack grows? What address code exceution begins after hardware reset? Whether this is truly a von Neumann or Harvard machine? What's the calling convention for mixed C and assembly? I couldn't answer these after 30 minutes of studying the architecture document. These should not be hard to find facts.

I'm impressed with the AVR32 generally, but I'm very disappointed in the documentation. It is not up to Atmel's usual standard for the AVR8 and the ARM/SAM families.

Dick.

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

Quote:
Where does Atmel documentation tell me which way the stack grows?
It doesn't, since it is toolchain specific. But IIRC GCC will grow by decreasing the stack pointer.

Quote:
What address code exceution begins after hardware reset?
Is documented in each device datasheet, you'll see a reset behavior there. But in general all AVR32 devices starts at address 0x80000000 after a reset. For UC3 this is the start of internal flash, for AP7 this is chip select 0 on the EBI.

Quote:
Whether this is truly a von Neumann or Harvard machine?
Single address space, load/store architecture.

Quote:
What's the calling convention for mixed C and assembly?
From the top of my head. Registers r9 - r12 is used for arguments, argument 1 go in r12, arg 2 in r11, arg 3 in r10 and arg 4 in r9. Return value go in r12. If you have more that 4 arguments you have to pass them on the stack. IIRC r0 to r5 can be used as scratch registers, r6 is reserved for keeping the GOT pointer. I'm on thin ice here, my details might be a bit off, so you should verify with Atmel support.

Hans-Christian

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

hce: thanks, I've drawn most of these same conclusions just by studying the disassembler output.

I still think atmel should document it, rather than leave it to us to reverse-engineer.

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

The wikipedia article on AVR32 claims it is a harvard machine. But, the disassembly sure looks von neumann. I've not found any reference one way or the other in atmel's documentation.

Comments?

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

http://en.wikipedia.org/wiki/Har...

It has little to do with the assembly language, but everything to do with how the CPU is connected to the bus(es) that carry instruction and data.

In this day and age, the distinction is largely irrelevant, since almost all processors fall into the modified Harvard architecture camp (somewhere between Harvard and von Neumann).

The bigger question is will the processor do what you need it to do?

Jeff Nichols

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

Hi Dick,

I found a nice paper from three students who are trying to run Linux on the AVR32 architecture, with some really good explanations of the hardware, and peripherals.

Have a search for Linux on AVR32 and see what you can find, and if that doesn't turn it up, send me an email, and I'll attach what I have and send it back.

Regards.