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 » Problems locating "makefile"

December 15, 2011
by Tohyj
Tohyj's Avatar

Hi All,

I am new here and i am not really good at programming. I tried to assemble up the nerdkit and everything is working fine.

However, on step 10b, it says "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."

The problem is, i cant really find the Makefile.

Can anyone help me in this ?

Thanks !

December 15, 2011
by Tohyj
Tohyj's Avatar

Sorry guys, i manage to find the "makefile" in the code folder downloaded from the web.

Correct me if i am wrong. I opened the "makefile" using Programmer's Notepad and make the correction in step 10b.

am i doing the right thing ?

I have another issue, in step 10c, i opened up the command line, i typed "dir" to list down the diretory. after which i cant locate a file name "Makefile".

Can anyone tell me how can i locate that file ?

Regards, Tohyj

December 16, 2011
by met_fredrik
met_fredrik's Avatar

Hi! You should put your makefile in the same directory as your .c file. And then when you have changed the /dev/ttyUSB0 to whatever COM port you are using. And the filenames to the name of your .c file.(Should be 14 places to rename in total)

In addition you can just compile from Programmer's Notepad by going Tools -> Make All instead of using commandline.

I am assuming your using Windows since you haven't specified otherwise.

December 16, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi Tohyj,

In addition to listening to met_fredriks awesome suggestions above, you might also want to take a look at this library article about the the command line. It is a quick introduction to moving around with the command line.

Humberto

December 16, 2011
by Tohyj
Tohyj's Avatar

Hi met_fredrik and Humberto,

Thanks guys ! i think i got it !

Now i am cracking my brain to understand the C programming part, as i am trying to do a programm for piezoelectric sound meter.

What does ADCSRA, ADPS1, ASPS0 means ?

regards, Tohyj

December 17, 2011
by met_fredrik
met_fredrik's Avatar

ADCSRA is the Analog to Digital Converter(ADC) register.

ADPS2, ADPS1 and ASPS0 is the bits for the clock prescaler, and as you can see on page 258 in the datasheet if you set all of them high you are getting a clock division of 128, which means that the ADC will run on 115,2 kHz.

I recommend that you read from page 49 in the nerdkits guide to get some thorough explanation. And also page 257 in the atmega168 datasheet the register is explained.

Hope this was of some help!

December 17, 2011
by Tohyj
Tohyj's Avatar

thank you so much met_fredrik !

i will take your recommendation =)

January 04, 2012
by tchilzer2
tchilzer2's Avatar

Hi I am having a very similar problem. When I run Make, I get the following error... "cant open device "com2": the system cannot find the file specified." My computer is recognizing the usb connection as com 2. My makefile is in the same directory as the .c file (initialload) right? Where is this file that the computer is looking for? do I keep /dev/ttycom2 ? or is it just com2 or the whole path like ex: c:Prgfiles/tc/cami/code/initialload/makefile/dev/ttycom2 or something? any help with this would be greatly appreciated. is there a specific file this port or ttybus or com2 is in?

January 04, 2012
by tchilzer2
tchilzer2's Avatar

oh and I currently have the "ttyusb0" line changed to just "com2" and it still gives the same error. thank you so much

January 05, 2012
by hevans
(NerdKits Staff)

hevans's Avatar

Hi tchilzer2,

Does your Device Manager tell you your cable is connected to COM2? If so then your makefile should be left at COM2.

Perhaps the issue is a permissions issue here. On Windows 7 and Vista sometimes you have to open the command line as administrator. I believe you can right click the icon and choose open as administrator, give that a try and let me know if it works.

Humberto

Post a Reply

Please log in to post a reply.

Did you know that a square wave sounds different than a sine wave? Learn more...