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 cannot get the Code to load/ Any Help??

January 02, 2010
by kellogg49450
kellogg49450's Avatar

Ok, I am lost. I got the unit all running and went to do the first code programming. When I try to type in make in the cmd prompt I get this message:

G:Documents and SettingsDustin>cd g:Documents and SettingsDustinMy Document sinitialload

G:Documents and SettingsDustinMy Documentsinitialload>dir Volume in drive G is Main Drive Volume Serial Number is 1CD1-1A7F

Directory of G:Documents and SettingsDustinMy Documentsinitialload

01/02/2010 08:49 PM <DIR> . 01/02/2010 08:49 PM <DIR> .. 01/02/2010 08:51 PM 964 initialload.c 01/02/2010 08:50 PM 643 Makefile 2 File(s) 1,607 bytes 2 Dir(s) 159,283,425,280 bytes free

G:Documents and SettingsDustinMy Documentsinitialload>make make -C ../libnerdkits make: ../libnerdkits: No such file or directory. Stop. make: [initialload.hex] Error 2

Now.. what I did was change in the make file the com port. Here is what I changed. AVRDUDEFLAGS=-c avr109 -p m168 -b 115200 -P /dev/ttycom4

I did this because in my computer it shows my USB cable in COM4. Now I have tried changed the enture /dev/tty into just /Com4 with the same error. Also, I changed the initialload file and typed in my own words where it said "congratulations" to my own wording and saved both of those using the programmers notepad. this is all I have done but it gives me the same error everytime. I am totally lost and new at this. Thanks for any help

January 02, 2010
by Rick_S
Rick_S's Avatar

Two possible issues:

  1. Instead of /dev/ttycom4, just use COM4
  2. It appears you have placed the initialload folder directly in your My Documents folder. The NK programs have dependencies that are in a folder called libnerdkits. When you download your code file, place it intact with all folder structure maintained. Then compile within that structure. I think that may fix your problems.

Rick

January 03, 2010
by kellogg49450
kellogg49450's Avatar

Thank you Rick, I deleted the entire "code" file and replaced it with a newly downloaded one and started from scratch. This time I left it in the "nerdkit" file I made and left all the other files in the code file along with my revised initialload file. This time it all worked. So I guess the problem was I took the initialload file out of the "code" file and isolated it. Thanks so much for your help, this was driving me mad.

January 03, 2010
by Rick_S
Rick_S's Avatar

Not a problem...

I'll be looking forward to seeing what new and exiting ideas you come up with. If you have any other issues, no matter how small you may feel they are, feel free to post here and ask. There is always someone that has been there before who is happy to lend a helping hand.

Rick

January 12, 2010
by DAVIDLEBARON
DAVIDLEBARON's Avatar

Hello,

I am having some trouble with the following step.

"4. Open up Programmers Notepad. Then from initialload folder open the file initialload."

I open programmers notepad and do not know what to do, or where to do it.

Also I do not know what to do with the next step.

"If you are on Windows you need to check what COM port the USB cable loaded as. This might change every time you connect it. Go to the Device Manger from Control Panel. Expand the Ports (COM & LPT) section and see what is next to the “Prolific USB-to-Serial” line. It should be COM5, COM6, or some other number. You need to open the Makefile in a text editor and edit the line that begins with AVRDUDEFLAGS. At the end you need to change “/dev/ttyUSB0” to “COM5” or whatever you saw in the previous steps."

David

January 13, 2010
by Farmerjoecoledge
Farmerjoecoledge's Avatar

I couldn't find the make all either, it's under tools in PN.

Change the highlighted line of the makefile to your com port via Device Manager. Load the makefile and hit Make All.

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 /dev/ttyUSB0 "to your com?" LINKOBJECTS=../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o

January 13, 2010
by hevans
(NerdKits Staff)

hevans's Avatar

Hi Davidlebaron,

I answered an email from you that I hope clears your questions up and gets you going, but I'm going to post here too just in case people have the same question.

Programmers Notepad is just an nice text editor that makes editing code easy. It also happens to have built into it a way to run Make and compile and upload the code. For beginners we like to encourage you to use the command line so you get an idea of what is really happening behind the scenes.

The Device Manager can be found on Windows from the Control Panel. Double click on System, then click the Hardware tab, you should see a Device Manger button. Once you know what COM Port number has been assigned to your cable, you will need to edit the Makefile in the proper code folder according to Farmerjoe's instructions above.

Let us know if we skipped anything, or if any part of it still doesn't make sense, we will do our best to clear it up!

Humberto

January 13, 2010
by DAVIDLEBARON
DAVIDLEBARON's Avatar

Hello Humberto,

Is there a difference in the steps we follow when using windows xp 5.0.. and windows 6.0..?

David LeBaron

January 13, 2010
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Hi David,

Your new at computers like really new, I'm thinking you started by chewing off too much. For starters there is no xp 5.0 or windows 6.0. Your off on the wrong foot, WindowsXP is just that operating system, Windows7 is the latest, There's different versions of xp home,pro etc but the os is not your problem. Get to know your comp, and then tackle this stuff, it's not easy.

Grant

January 13, 2010
by DAVIDLEBARON
DAVIDLEBARON's Avatar

Grant,

I very well know the difference between the different versons of windows. I addressed Humberto. He has helped me with useful tips which shed light on a few points. I would like help from Humberto or anyone. The reason I asked this question is, I also received a tutorial attatchment from Humberto, which has screen shots, step by step. What was shown in the screen shots, does not match what my pc shows. I do not know how to create screen shots. If I did I could have sent some screen shots back, and asked a question off line. I think it would be great to post this stuff to the forum so others may benefit. In fact I began to post things in detail. When I did there was a problem. I could not exactly post what I am dealing with. When I would review, things were not the same. I tried other things to show exact examples with no success. I ended up bumping the wrong button and the whole post was lost. I became frustrated and fired off a short post that did not have precise names for the different windows versions. My question seems like a good one but I might be wrong.

Now I am back to where I started, with more detail. Sorry about the lack of clarity when giving details about windows. To me there are windows 5,6,7etc... In the news you hear the launch of windows 7. The question is still unanswered.

May I suggest you pause before you reply to others, and try to find out what you could do to offer useful points.

David

January 13, 2010
by Farmerjoecoledge
Farmerjoecoledge's Avatar

David,

Yeah, that's a real bummer when you lose the post your working on. It just happened to me the other day, good thing it was a short post, the time before that I just about had a heart attack, one click off the page and GONE.

One of the possible reasons why the shot's don't match is there probably taken from a linux os. On xp it's the print screen key, paste it into MsPaint and save as jpg.

It's extremely hard to convey some of this stuff, we've all been there, and that's why were taught from the beginning to DIY. The Nerd's Philosophy.

Sorry if I offended you, keep up the spirit!

Grant

January 14, 2010
by Rick_S
Rick_S's Avatar

David, Farmer is correct about a simple screen shot in windows. Simply press print screen key to capture your entire desktop in the clipboard. This can then be pasted into any photo editing software or for ease, paint. You can also press ALT+Print Screen to capture only the active window.

Once captured and saved, if you want to post them here on the forum, simply save them in an online account (I use photobucket) then use the markup shown below in the yellow(don't forget the ![] ).

I too have lost posts accidentally. When I'm doing a big writeup, I type it up off line and copy/paste it into the forum. That help me sometimes.

Also, I've run the software on XP and Vista -- haven't tried on my 7 box yet -- but on both those, they behaved the same. One thing, when installing WINAVR, make sure under vista to install it using the (run as administrator) option (right click the install file select run as administrator) I have had instances where the different core portions of WINAVR did not install correctly. Also, make sure to reboot the machine following the install to ensure windows has all the path information updated properly.

Lastly if you have any other questions or still are having a problem, post as detailed question as possible and someone will step in and do our best to help out. We try to keep this forum as friendly and helpful as possible.

Rick

Post a Reply

Please log in to post a reply.

Did you know that the printf format string "%.3f" will show three digits after the decimal point? Learn more...