NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » I am about ready to give up on using WinAVR.

August 20, 2011
by JTram
JTram's Avatar

I need a straight answer of how to load a program from compiling to making to loading to the micro-controller. Please someone break down this winAVR in which I have never used.

August 20, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi JTram,

I'm not sure what part of WinAVR is tripping you up, but if you explain the errors you are getting or what you are seeing that is strange I and plenty of other folks here are more than happy to help.

There is a quick walk through for first time users of the command line on this Library post: http://www.nerdkits.com/library/command_line/

Humberto

August 20, 2011
by dgikuljot
dgikuljot's Avatar

@ JTram, Seriously man dont give up. Almost all of us have been very frustrated in the beggining's. Usually because we had the programming cable plugged incorrectly or we were mispelling the commands. So just tell us what you need help with, what errors/ or problems your having and well guide you thru everything. I remember when i was using the kit for the first time i had 2 wires reversed, and kept swearing that i had everything wired correctly and everyone on the forums helped me fix the problem :)

August 21, 2011
by mongo
mongo's Avatar

JTram,

I had similar problems with WINAVR at first too. I was trying to run things from the wrong places and had files in the wrong directories. Simple little errors that made the first two weeks a living hell. Since I have been here for a long time now, almost since the dawn of the kits it seems, I have seen a lot of folks with the same kind of experiences and they all have had a good outcome so far. There weren't as many here then and less forum help available but I managed to figure it out. You have it much easier with all the people here willing to help, so giving up is no answer. All it takes is a little patience. Make sure you follow the instructions very carefully and have all the files in the right places.

August 22, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi JTram,

I got a couple of emails from you, but I'm still don't really know exactly where you are getting confused. I'm moving this conversation here so that others can offer their opinions too.

I think the issue might be that you are not unzipping the Code.zip file. You need to open up the Code.zip file and drag the Code folder out onto a folder in your hard drive (Desktop works well for some people, others put in the root C: folder). If you include a screen shot of the command line where you are getting stuck we will do our best to help.

Humberto

August 22, 2011
by JTram
JTram's Avatar

Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:UsersJassen Trammell>cdUsersJassen TrammellDesktop

C:UsersJassen TrammellDesktop>cdUsersJassen TrammellDesktopinitialload The system cannot find the path specified.

C:UsersJassen TrammellDesktop>cdUsersJassen TrammellDesktopinitialload#1 The directory name is invalid.

C:UsersJassen TrammellDesktop>cdUsersJassen TrammellDesktopCode

C:UsersJassen TrammellDesktopCode>dir Volume in drive C has no label. Volume Serial Number is 0822-8F92

Directory of C:UsersJassen TrammellDesktopCode

08/22/2011 06:43 PM <DIR> . 08/22/2011 06:43 PM <DIR> .. 08/22/2011 06:42 PM <DIR> first load code 0 File(s) 0 bytes 3 Dir(s) 186,765,737,984 bytes free

C:UsersJassen TrammellDesktopCode>cdUsersJassen TrammellDesktopCodeCode

C:UsersJassen TrammellDesktopCodeCode>dir Volume in drive C has no label. Volume Serial Number is 0822-8F92

Directory of C:UsersJassen TrammellDesktopCodeCode

08/22/2011 06:42 PM <DIR> . 08/22/2011 06:42 PM <DIR> .. 08/22/2011 06:42 PM <DIR> bootloader168 08/22/2011 06:42 PM <DIR> bootloader328P 08/22/2011 06:41 PM <DIR> dip_arithmetic 08/22/2011 06:42 PM <DIR> dip_arithmetic_edu 08/22/2011 06:41 PM <DIR> initialload 08/22/2011 06:42 PM <DIR> led_blink 08/22/2011 06:41 PM <DIR> libnerdkits 08/22/2011 06:41 PM <DIR> tempsensor 08/22/2011 06:41 PM <DIR> tempsensor_edu 08/22/2011 06:41 PM <DIR> trafficlight 0 File(s) 0 bytes 12 Dir(s) 186,765,729,792 bytes free

C:UsersJassen TrammellDesktopCodeCode>cdUsersJassen TrammellDesktopCode Codeinitialload

C:UsersJassen TrammellDesktopCodeCodeinitialload>dir Volume in drive C has no label. Volume Serial Number is 0822-8F92

Directory of C:UsersJassen TrammellDesktopCodeCodeinitialload

08/22/2011 06:41 PM <DIR> . 08/22/2011 06:41 PM <DIR> .. 08/22/2011 06:41 PM 969 initialload.c 08/22/2011 06:41 PM 643 Makefile 2 File(s) 1,612 bytes 2 Dir(s) 186,765,729,792 bytes free

C:UsersJassen TrammellDesktopCodeCodeinitialload>

what now?

August 22, 2011
by JTram
JTram's Avatar

The real thing that I am trying to do is load the OBD2 computer interface project code.I am figuring that I need to do the initial load before I load the OBD2 code. yes/no?

August 22, 2011
by missle3944
missle3944's Avatar

Yes and No.

Yes, you should probably go through the nerdkits guide and learn with the labs that they made. It will also help you understand a lot of problems you might face if you choose not to go through the guide. Also its really fun.

No, the initial load program is not necessary I don't think for other programs to run.

Just a suggestion

-Dan

August 22, 2011
by missle3944
missle3944's Avatar

Yes and No.

Yes, you should probably go through the nerdkits guide and learn with the labs that they made. It will also help you understand a lot of problems you might face if you choose not to go through the guide. Also its really fun.

No, the initial load program is not necessary I don't think for other programs to run.

Just a suggestion

-Dan

August 22, 2011
by JTram
JTram's Avatar

C:UsersJassen TrammellDesktopCodeCodeinitialload>make avrdude -c avr109 -p m168 -b 115200 -P /dev/ttyUSB2 -U flash:w:initialload.hex:a

avrdude: ser_open(): can't open device "/dev/ttyUSB2": The system cannot find th e path specified.

make: *** [initialload-upload] Error 1

C:UsersJassen TrammellDesktopCodeCodeinitialload>

This is the error that I am getting. any ideas please.

August 22, 2011
by JTram
JTram's Avatar

Can anyone just help me set up the obd 2 code off of the nerdkits website so I can load it to my micro-controller? That is all I want to do right now.

August 22, 2011
by missle3944
missle3944's Avatar

OK. Have you gone through the guide ? Becuase alot of these problems can be touched on in the guide. Are you running windows or Linux or Mac. If you are running win then you need to change the /dev/tty on your make file to your com port which looks like from your post is com2 like this

GCCFLAGS=-g -Os -Wall -mmcu=atmega168 
LINKFLAGS=-Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscanf -lscanf_flt -lm
AVRDUDEFLAGS=-c avr109 -p m168 -b 115200 -P COM2
LINKOBJECTS=../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o

all:    initialload-upload

initialload.hex:    initialload.c
    make -C ../libnerdkits
    avr-gcc ${GCCFLAGS} ${LINKFLAGS} -o initialload.o initialload.c ${LINKOBJECTS}
    avr-objcopy -j .text -O ihex initialload.o initialload.hex

initialload.ass:    initialload.hex
    avr-objdump -S -d initialload.o > initialload.ass

initialload-upload: initialload.hex
    avrdude ${AVRDUDEFLAGS} -U flash:w:initialload.hex:a

You dont have to type make avrdude and all that stuff. Once you've located the file that has the program just type "make" and it should work. And in the command prompt you use "cd" which is change directory to navigate to the file you need to go to.You can go to the nerdkits library and find the command prompt tutorial. You must extract the whole code folder to some file or on your desktop or something like that. This is what mine looks like ., .

Mine just wont upload becuase my serial to usb plug is not plugged into com3 port It also might help if you post a picture of what you need help with so we can get a better understanding becuase I don't know if you are cutting stuff out of your command line text or what?

-missle3944

August 22, 2011
by JTram
JTram's Avatar
Device code: 0x27 = (unknown)
Device code: 0x0d = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)
Device code: 0x0a = (unknown)

And it just keeps on going? anyone seen this before?

August 23, 2011
by missle3944
missle3944's Avatar

I'd recheck your wiring mabey. I've never seen this.

-Dan

August 23, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi JTram,

It would help us to see a screenshot of your Device Manager, just to make sure your driver looks to have been installed correctly, and that you have the right COM port. If you put up your makefile for us to take a look at, it would also be helpful.

As others have cautioned you, jumping straight ahead to one of the more complex project will often lead to frustration. We have take great care to design the guide to build from the ground up. This hard stuff you are learning here, and there are no shortcuts. Make sure you enjoy the process of learning this electronics as much as the end result. There is actually quite a bit of value in the debugging when something goes wrong, but we will do our best to get you up and running in no time.

Humberto

Post a Reply

Please log in to post a reply.

Did you know that talking to the microcontroller over the USB/Serial link is easy under Windows, Linux, and OS X? Learn more...