La cuestión es como Juan  la describió en el correo anterior,
decirle al makefile que use AVRDUDE, especificar el micro que se usa,
especificar la librerias a usar, el puerto USB, y demás.
Se compila con 'make' y se carga al micro con 'make load'.

Adjunto el makefile del ejemplo que Juan envió en un correo
anterior, para hacer la comparación.


_Ricardo.

PS. Por cierto, hablé ayer con Camilo y quedamos de confirmar para
trabajar con ustedes esta noche.

--------------------------------------------------------
--------------------------------------------------------

# Makefile for AVR function library development and examples
# Author: Pascal Stang (with some modifications by Scott Wilson)
#
# For those who have never heard of makefiles: a makefile is essentially a
# script for compiling your code.  Most C/C++ compilers in the world are
# command line programs and this is even true of programming environments
# which appear to be windows-based (like Microsoft Visual C++).  Although
# you could use AVR-GCC directly from the command line and try to remember
# the compiler options each time, using a makefile keeps you free of this
# tedious task and automates the process.
#
# For those just starting with AVR-GCC and not used to using makefiles,
# I've added some extra comments above several of the makefile fields which
# you will have to deal with.

########### change this lines according to your project ##################
#put the name of the target mcu here (at90s8515, at90s8535, attiny22,
atmega603 etc.)
    MCU = atmega32
#    MCU = atmega161
#    MCU = atmega128

#put the name of the target file here (without extension)
#  Your "target" file is your C source file that is at the top level of your
code.
#  In other words, this is the file which contains your main() function.

    TRG = flash

# put the name of your programmer serial port here
    UISP_PORT=/dev/ttyS0
    AVRDUDE_PORT = /dev/ttyUSB0

    UISP_PART = ATmega32
    AVRDUDE_PART = m32

# standard ccrma location for the library.  If you need to customize
#    the make script or the library c code, install it locally and
#    change this line
    AVRLIB = $(HOME)/avrlib

#put your C sourcefiles here
#  Here you must list any C source files which are used by your target file.
#  They will be compiled in the order you list them, so it's probably best
#  to list $(TRG).c, your top-level target file, last.

    SRC = $(AVRLIB)/timer.c $(TRG).c

#put additional assembler source file here
#  The ASRC line allows you to list files which contain assembly
code/routines that
#  you would like to use from within your C programs.  The assembly code
must be
#  written in a special way to be usable as a function from your C code.

    ASRC =

#additional libraries and object files to link
#  Libraries and object files are collections of functions which have
already been
#  compiled.  If you have such files, list them here, and you will be able
to use
#  use the functions they contain in your target program.

    LIB    =

#additional includes to compile
    INC    =

########### you should not need to change the following line #############
include $(AVRLIB)/make/avrccrma_make

###### dependecies, add any dependencies you need here ###################
#  Dependencies tell the compiler which files in your code depend on which
#  other files.  When you change a piece of code, the dependencies allow
#  the compiler to intelligently figure out which files are affected and
#  need to be recompiled.  You should only list the dependencies of *.o
#  files.  For example: uart.o is the compiled output of uart.c and uart.h
#  and therefore, uart.o "depends" on uart.c and uart.h.  But the code in
#  uart.c also uses information from global.h, so that file should be listed
#  in the dependecies too.  That way, if you alter global.h, uart.o will be
#  recompiled to take into account the changes.

$(TRG).o        : $(TRG).c                        global.h

--------------------------------------------------------
--------------------------------------------------------




> yo creo que tengo un arduino funcionando que le puedo prestar si le
> interesa para que lo pruebe.
>
> cuando le dedicamos un tiempo a esto?
>
> zea
>
> >
> > _Ricardo
> >
> > 2008/5/22 Juan I Reyes <[EMAIL PROTECTED]>:
> >
> > > Hola Ricardo,
> > >
> > > Este link es un poco viejo y de la época de UISP. Pero habla de los
> > > Makefiles. Esto fue cuando se hicieron los workshops en Banff y con el
> > > propio Bill Verplank. Uno de los aistentes fue Ricardo dal Farra porque
> > > vivía en Canada en esa época.
> > >
> > > Hay que configurar la AVRLIB para que usen AVRDUDE y el ATMega
> > > correspondiente. Perdón por la insistencia.
> > >
> > > La idea es tener un directorio para cada aplicación que se va a cargar
> > > al ATMega. en este directorio esta el programa en C además de una
> > > libreria que 'global.h' y desde luego el 'makefile'. Vale la pena
> > > analizar y entender este Makefile.
> > >
> > > Con solo escribir 'make' en la linea de comandos se compila el
> programa.
> > > Así mismo si quiero cargarlo al ATMega, escribo 'make load'.
> > >
> > > Ahora, el archivo que hay que configurar en las AVRLIB es:
> > >
> > > '~/avrlib/make/avrccrma_make' o para wiring por ejemplo crear un
> archivo
> > > que se llame y que esté en ese directorio : 'avrwiring'.
> > > Si se leen los comentarios se puede configurar este archivo facilmente
> e
> > > insisto configurenlo para AVRDUDE y el puerto: /dev/ttyUSB0 que
> > > normalmente es el que asigna FTDI a los Wiring o a los AVRMini. Me
> > > imagino que Arduino también.
> > >
> > > En los ejemplos de la AVRLIB hay código y Makefiles que pueden
> analizar,
> > > después de hacerle un backup, para entender un poco el proceso.
> > >
> > > Pilas no vayan a borrar el bootloader en Wiring a menos que tengan un
> > > backup.
> > >
> > >
> > > Saludes,
> > >
> > >  --* Juan
> > >
> > >
> > > On Thu, 2008-05-22 at 01:20 -0500, Ricardo Dueñas Parada wrote:
> > > > Encontré esta información, explica un poco la forma de programación
> > > > de los avr con avrlib y avr-gcc. También habla un poco de los
> makefile.
> > > >
> > >
> > >
> > > _______________________________________________
> > > ____ ____ ___  ____ _  _ ___
> > > |__| |__/   /  |___  \/  |__]
> > > |  | |  \  /__ |___ _/\_ |
> > >
> > > Arzexp mailing list
> > > [email protected]
> > > http://lists.slow.tk/listinfo.cgi/arzexp-slow.tk
> > >
> > _______________________________________________
> > ____ ____ ___  ____ _  _ ___
> > |__| |__/   /  |___  \/  |__]
> > |  | |  \  /__ |___ _/\_ |
> >
> > Arzexp mailing list
> > [email protected]
> > http://lists.slow.tk/listinfo.cgi/arzexp-slow.tk
> --
> Gabriel Zea
> mailTo <zeaATrandomlab.net>
> http://zea.randomlab.net
> http://randomlab.net
>
> _______________________________________________
> ____ ____ ___  ____ _  _ ___
> |__| |__/   /  |___  \/  |__]
> |  | |  \  /__ |___ _/\_ |
>
> Arzexp mailing list
> [email protected]
> http://lists.slow.tk/listinfo.cgi/arzexp-slow.tk
>
_______________________________________________
____ ____ ___  ____ _  _ ___
|__| |__/   /  |___  \/  |__]
|  | |  \  /__ |___ _/\_ |

Arzexp mailing list
[email protected]
http://lists.slow.tk/listinfo.cgi/arzexp-slow.tk

Responder a