piclist 2004\04\24\205754a >
Thread: Still having problems with WinAVR
www.piclist.com/techref/index.htm?key=still+having+problems
flavicon
face BY : Herbert Graf email (remove spam text)

part 0 46 bytes
This is a multi-part message in MIME format.

part 1 3279 bytes content-type:text/plain; (decoded 7bit)

> > as: unrecognized option `-cu=atmega128'
>
> I think that the "as:" part is the assembler - check the following line in
> the makefile, especially the -mmcu part to make sure you didn't
> accidentally change it to -cu.
>
> ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
>
> As far as the warnings go, please paste the first 5 or ten lines
> of test.c into your next message, it appears your missing some
> function prototypes and it would be easier to
> see what is actually there.

       I'm actually now trying with the exact example that comes with the package
(after syntax corrections):

#include <avr/io.h>
#include <avr/delay.h>
int main (void)
{
       unsigned char counter;
       //set PORTB for output
       DDRB =0xFF;
       while (1)
       {
               //set PORTB.2 high
               PORTB |=1<<2;
               //wait (10 *120000)cycles =wait 1200000 cycles
               counter =0;
               while (counter !=5)
               {
                       //wait (30000 x 4)cycles =wait 120000 cycles
                       _delay_loop_2(30000);
                       counter++;
               }
               //set PORTB.2 low
               PORTB &=~(1<<2);
               //wait (10 *120000)cycles =wait 1200000 cycles
               counter =0;
               while (counter !=5)
               {
                       //wait (30000 x 4)cycles =wait 120000 cycles
                       _delay_loop_2(30000);
                       counter++;
               }
       }
       return 1;
}

And the result of 'make all':

Compiling: test1.c
avr-gcc -c -mmcu=atmega8535 -I. -g -Os -funsigned-char -funsigned-bitfields
-fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=test1.lst
-Ic:\winavr\avr\include -std=gnu99 -Wp,-M,-MP,-MT,test1.o,-MF,.dep/test1.o.d
test1.c -o test1.o
as: unrecognized option `-cu=atmega8535'
make.exe: *** [test1.o] Error 1

FWIW I've tried different processors all with similar errors (i.e. if I sub
atmega16 the error becomes -cu=atmega16)

I have checked that line in the makefile:

ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)

I've attached the complete makefile to this message (it's very small).

> I'm disappointed that you're having so many problems.  I'm working
> on a project for the circuit cellar contest and was going to
> mention how easily and quickly I was able to get winavr up and
> running (actually had zero problems - I know, just what you wanted to
> hear!).
>
> Ken

       Well I have no problem debugging problems that are mine. Debugging problems
that aren't mine generally aren't something I will do unless absolutely
necessary, and trying to debug defective software is about the lowest on my
scale.

       If it weren't for the circuit cellar contest I wouldn't have bothered to
try for this long.

       Thanks for your help. TTYL

----------------------------------
Herbert's PIC Stuff:
http://repatch.dyndns.org:8383/pic_stuff/

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body




part 2 3951 bytes content-type:application/x-zip-compressed; (decode)
<NAEALEBPNOHNGKFACEHAGEJOJKAA.mailinglist2@farcite.net>

In reply to: <002701c42a5d$445fca30$0801a8c0@kl600>
See also: www.piclist.com/techref/index.htm?key=still+having+problems
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Still having problems with WinAVR

month overview.

new search...