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 » Mac problems with programming

September 13, 2010
by vargona
vargona's Avatar

I am trying to do the first steps in programming my microcontroller with the temperature project in the PDF book. It is telling me to use terminal which I am not familiar with, and I need to find the file with AVRDUDEFLAGS which I cannot find, any tips? I am very new to programming.

September 13, 2010
by hevans
(NerdKits Staff)

hevans's Avatar

Hi vargona,

The file you need to find is the Makefile. The Makefile is the set of instructions that compile and upload the code to the chip. Every project you put together will have its own separate Makefile which is found inside each projects folder (along with the C code). To find and take a look at the Makefile open up the Code folder you downloaded, double click the initialload folder, and there you will find the Makefile.

Let me know if something doesn't make sense.

Humberto

September 13, 2010
by Ralphxyz
Ralphxyz's Avatar

Just type Terminal in spotlight. It should be your Top Hit or look down through the returned files for it.

Then cd to your project. Search the Nerdkit forum for Terminal for more instructions.

Ralph

September 13, 2010
by vargona
vargona's Avatar

I found the Makefile, now is the USB cable supposed to show up on my desk top as a device? If it is then that is where my problem is and I need to check my wiring. Im just having trouble understanding where the files are located and if they are the right ones. Thanks for your help!

  • Nick
September 14, 2010
by Ralphxyz
Ralphxyz's Avatar

No it will not be on your desktop, see my reply from Aug 29th. This should get you started.

You have to find your USB connection in the /dev folder. In Terminal type in ls /dev/cu* the device that looks like /dev/cu.PL2303-0000101D is your Nerdkit USB. Copy this into your MakeFile as such:

AVRDUDEFLAGS=-c avr109 -p m168 -F -b 115200 -P /dev/cu.PL2303-0000101D.

Your port might be different of course. Also there have been reported problems plugging into USB hub so plug directly into your mac.

The files are located wherever you put them. Type Code into the Spotlight, the Top Hit "should" be your code folder with your projects inside. You can see the full path by leaving your mouse over the Top Hit.

Ralph

September 14, 2010
by vargona
vargona's Avatar

Ok, so as an update I have changed the AVRDUDEFLAGS in text edit and saved it: I typed in the port number it gave me when I typed in ls /dev/cu*. Now on step 10c it is asking me to open up the command line and go to a folder. I'm getting confused on where I should be. I though that to go to the command line you had to open up terminal. I typed in "make" in terminal but it says no makefile found. This is turning out to be harder than I thought! Sorry for all the questions..

-Nick

September 14, 2010
by Ralphxyz
Ralphxyz's Avatar

No problem we have all gone through this, at least I certainly did.

Where are you when you are in Terminal? If you are not in your project folder then no MakeFile will be found.

You need to cd to your project folder.

I unzipped the Nerdkit source files to /developer/nerdkits so I do a:

cd /developer/nerdkits/code/initialload for the welcome program

or

cd /developer/nerdkits/code/tempsensor for the tempsensor project.

Within the code folder is the libernerdkits folder.

So if you change the MakeFile in the initialload folder to match your USB port then in Terminal cd to the initialload folder you just enter:

make

The compiler will connect and off you go "Welcome"!

Ralph

Post a Reply

Please log in to post a reply.

Did you know that signed numbers need to be sign-extended when chaging variable sizes? Learn more...