hardenning stuff with assembler

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Diego J

hardenning stuff with assembler

Post by Diego J » Sun Oct 05, 2008 9:08 am

Hi people.
I need to make a project completely in assembler for the Uni.

As an extra for the project, students can opt to make an interface with USB, and only for that we can use C.

I have successfully maked (with a lot of research) a C project with some assembler functions. But this is far away from being an assembler project.
With assembler functions i cant use constants like PORTB and the others.
I cant include m32def.inc because i use avr-gcc and not avrasm.

If i use AVR-ASM i can make an entire project in assembler, but then i cant add C files like the ones for avrusb.

Any idea of how can i make a basic mix between both languages?

My needs for the mixedproject are like this:

main.asm (or .S) for the core (reset interrupt, device initialization, etc.)
usb.c and usb.h for making use of avrusb.
i2cmem.asm to comunicate with an i2c external memory.

And also i would need to be able to use predefined constants in assembler.

I would really apreciate any help.

Cheers,
Diego.

Grendel
Rank 4
Rank 4
Posts: 167
Joined: Sat Dec 16, 2006 9:53 pm
Location: Oregon, USA
Contact:

Post by Grendel » Tue Oct 07, 2008 3:28 am

avr-gcc allows mixing assembler and C modules quite nicely -- including usage of I/O macros (via #include <avr/io.h>). Just take a look at some of the AVR-USB projects.

JohanKrava
Posts: 2
Joined: Sun Oct 12, 2008 6:16 pm

Post by JohanKrava » Sun Oct 12, 2008 6:33 pm

You can use any language you wish or all of them in a single project! You need a compiler for each of your languages and then just link your compiled (obj) files together. I work this way. Ask Google for details.

Post Reply