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 » Not working

August 04, 2010
by Razvan
Razvan's Avatar

I just got my USB nerdkit, made the LCD setup, than pushed the switch up, reseted it, and than I changed the word Congratulations! To a different word to see if it works.but when i entered the makefile it won't go successfully. I reseted it several times, then restored the folder with the initialload folder In it. Now my nerdkit won't show anything but some black squares. I don't know what to do. PS: I'm a Mac user.

August 04, 2010
by mongo
mongo's Avatar

Are the black squares on lines 1 and 3 of the LCD?

August 05, 2010
by Razvan
Razvan's Avatar

Yes.

August 05, 2010
by Ralphxyz
Ralphxyz's Avatar

You are in Programing mode!!

Switch your switch.

Ralph

August 05, 2010
by Razvan
Razvan's Avatar

I did, but it wont work. Is there any way that I can reset it to factory settings?

August 05, 2010
by Ralphxyz
Ralphxyz's Avatar

Are you getting errors when compiling? What are the errors?

Are you getting random black squares or solid black lines on row 1 and 3?

Solid lines indicate programing mode.

Random black squares sometimes mean a wire has come lose, recheck your wiring.

Ralph

August 05, 2010
by Razvan
Razvan's Avatar

Last login: Wed Aug 4 21:50:46 on ttys000 /Users/Razvan/Desktop/Code/tempsensor/Makefile ; exit; Razvan-Chiriacs-iMac:~ Razvan$ /Users/Razvan/Desktop/Code/tempsensor/Makefile ; exit; /Users/Razvan/Desktop/Code/tempsensor/Makefile: line 1: -Os: command not found /Users/Razvan/Desktop/Code/tempsensor/Makefile: line 2: -lprintf_flt: command not found /Users/Razvan/Desktop/Code/tempsensor/Makefile: line 3: avr109: command not found /Users/Razvan/Desktop/Code/tempsensor/Makefile: line 4: ../libnerdkits/lcd.o: No such file or directory /Users/Razvan/Desktop/Code/tempsensor/Makefile: line 6: all:: command not found /Users/Razvan/Desktop/Code/tempsensor/Makefile: line 8: tempsensor.hex:: command not found make: *** ../libnerdkits: No such file or directory. Stop. avr-gcc: tempsensor.c: No such file or directory avr-gcc: no input files avr-objcopy: 'tempsensor.o': No such file /Users/Razvan/Desktop/Code/tempsensor/Makefile: line 13: tempsensor.ass:: command not found avr-objdump: 'tempsensor.o': No such file /Users/Razvan/Desktop/Code/tempsensor/Makefile: line 16: tempsensor-upload:: command not found

avrdude: no programmer has been specified on the command line or the config file Specify a programmer using the -c option and try again

logout

[Process completed]

thats what I get when I compile. the squares are all over rows 1 and 3

August 05, 2010
by Razvan
Razvan's Avatar

I figured out what it was. I misplaced a wire. Now it shows the initial message. but I don't know how to change it, or to make it show me the temperature. Can anybody help me please?

August 05, 2010
by Ralphxyz
Ralphxyz's Avatar

Are you seeing the "Welcome message"?

You have to setup the breadboard with the temperature sensor and then load the tempsensor project.

Ralph

August 05, 2010
by Razvan
Razvan's Avatar

the temp sensor is in the right but I cant change anything on the screen. I dont know programming and I dont know what to do with the code file or with the makefiles.

August 05, 2010
by hevans
(NerdKits Staff)

hevans's Avatar

HI Razvan,

Lets take a step back and figure out where you are, and where you are getting confused. You say the "Congratulations" message is still being displayed, this leads me to believe you never really flashed any other program onto the chip.

When you were getting two black bars on the LCD, it means you are in programming mode. This is important, and you should be able to flip the programming switch, reset the battery power, and have the chip boot up into programming mode. Then flip the switch back, reset the power again, and have the chip boot up and run your program.

Place the chip into programming mode, then go through the programming process on your PC. Let us know what errors you get on the command line, and we will be able to help you diagnose the problem.

Humberto

August 05, 2010
by Razvan
Razvan's Avatar

How do I go to the programing process?

August 05, 2010
by Razvan
Razvan's Avatar

if i go to the initialload folder, and double click on the Makefie, I get a terminal window that says this:

Last login: Thu Aug 5 18:19:45 on ttys000 /Users/Razvan/Desktop/Code/initialload/Makefile ; exit; Razvan-Chiriacs-iMac:~ Razvan$ /Users/Razvan/Desktop/Code/initialload/Makefile ; exit; /Users/Razvan/Desktop/Code/initialload/Makefile: line 1: -Os: command not found /Users/Razvan/Desktop/Code/initialload/Makefile: line 2: -lprintf_flt: command not found /Users/Razvan/Desktop/Code/initialload/Makefile: line 3: avr109: command not found /Users/Razvan/Desktop/Code/initialload/Makefile: line 4: ../libnerdkits/lcd.o: No such file or directory /Users/Razvan/Desktop/Code/initialload/Makefile: line 6: all:: command not found /Users/Razvan/Desktop/Code/initialload/Makefile: line 8: initialload.hex:: command not found make: *** ../libnerdkits: No such file or directory. Stop. avr-gcc: initialload.c: No such file or directory avr-gcc: no input files avr-objcopy: 'initialload.o': No such file /Users/Razvan/Desktop/Code/initialload/Makefile: line 13: initialload.ass:: command not found avr-objdump: 'initialload.o': No such file /Users/Razvan/Desktop/Code/initialload/Makefile: line 16: initialload-upload:: command not found

avrdude: no programmer has been specified on the command line or the config file Specify a programmer using the -c option and try again

logout

[Process completed]

.......And the LCD does not change anything. What do I do?

August 05, 2010
by hevans
(NerdKits Staff)

hevans's Avatar

Hi Razvan,

We walk through the process in the NerdKits Guide starting at around page 37. It is quite involved for me to describe the whole thing here, but if you follow the steps in the NerdKit Guide you should be able to get pretty far. If you encounter errors on the command line let us know what those are (if you include the complete text it will really help us out). If you get stuck and have questions describe to us how far you got, and where you are getting confused.

Humberto

August 05, 2010
by Razvan
Razvan's Avatar

Well... I get confused at page 42. Where is the /dev file?

August 05, 2010
by Razvan
Razvan's Avatar

So, what do I hane to do after I assemble the nerdkit, plug it into usb, push the swich fur progrsmming, and reset the battery? I copied all the contents of the initialload.c file, and pasted it into a terminal window, but this is what I get:

Last login: Thu Aug 5 19:21:40 on ttys000 Razvan-Chiriacs-iMac:~ Razvan$ // initialload.c -bash: //: is a directory Razvan-Chiriacs-iMac:~ Razvan$ // for NerdKits with ATmega168 -bash: //: is a directory Razvan-Chiriacs-iMac:~ Razvan$ // mrobbins@mit.edu -bash: //: is a directory Razvan-Chiriacs-iMac:~ Razvan$ Razvan-Chiriacs-iMac:~ Razvan$ #define F_CPU 14745600 Razvan-Chiriacs-iMac:~ Razvan$ Razvan-Chiriacs-iMac:~ Razvan$ #include <stdio.h> Razvan-Chiriacs-iMac:~ Razvan$ Razvan-Chiriacs-iMac:~ Razvan$ #include <avr/io.h> Razvan-Chiriacs-iMac:~ Razvan$ #include <avr/interrupt.h> Razvan-Chiriacs-iMac:~ Razvan$ #include <avr/pgmspace.h> Razvan-Chiriacs-iMac:~ Razvan$ #include <inttypes.h> Razvan-Chiriacs-iMac:~ Razvan$ Razvan-Chiriacs-iMac:~ Razvan$ #include "../libnerdkits/delay.h" Razvan-Chiriacs-iMac:~ Razvan$ #include "../libnerdkits/lcd.h" Razvan-Chiriacs-iMac:~ Razvan$ Razvan-Chiriacs-iMac:~ Razvan$ // PIN DEFINITIONS: -bash: //: is a directory Razvan-Chiriacs-iMac:~ Razvan$ // -bash: //: is a directory Razvan-Chiriacs-iMac:~ Razvan$ // PC4 -- LED anode -bash: //: is a directory Razvan-Chiriacs-iMac:~ Razvan$ Razvan-Chiriacs-iMac:~ Razvan$ int main() { -bash: syntax error near unexpected token (' Razvan-Chiriacs-iMac:~ Razvan$ // LED as output -bash: //: is a directory Razvan-Chiriacs-iMac:~ Razvan$ DDRC |= (1<<PC4); -bash: syntax error near unexpected token1' Razvan-Chiriacs-iMac:~ Razvan$
Razvan-Chiriacs-iMac:~ Razvan$ // turn on LED -bash: //: is a directory Razvan-Chiriacs-iMac:~ Razvan$ PORTC |= (1<<PC4); -bash: syntax error near unexpected token 1' Razvan-Chiriacs-iMac:~ Razvan$ Razvan-Chiriacs-iMac:~ Razvan$ // fire up the LCD -bash: //: is a directory Razvan-Chiriacs-iMac:~ Razvan$ lcd_init(); -bash: syntax error near unexpected token;' Razvan-Chiriacs-iMac:~ Razvan$ lcd_home(); -bash: syntax error near unexpected token ;' Razvan-Chiriacs-iMac:~ Razvan$ Razvan-Chiriacs-iMac:~ Razvan$ // print message to screen -bash: //: is a directory Razvan-Chiriacs-iMac:~ Razvan$ // .Spotlight-V100/ Network/ .Trashes/ ORP-1.2-BETA-OSX/ .fseventsd/ Resources/ .vol/ System/ Applications/ The Sims 3.localized/ Call of Duty 4/ TheVolumeSettingsFolder/ Dymo 30252 Add Lbl - Home Adr.txt User Guides And Information/ Dymo 30252 Add Lbl - Work Adr.txt Users/ Dymo 30256 Ship Lbl - Home Adr.txt Volumes/ Dymo 30256 Ship Lbl - Work Adr.txt bin/ Dymo 30256 Visitor Lbl.txt cores/ Dymo 30321 Add Lbl - Home Adr.txt dev/ Dymo 30321 Add Lbl - Work Adr.txt etc/ Dymo 99012 Adr Lbl - Home Adr.txt home/ Dymo 99012 Adr Lbl - Work Adr.txt net/ Dymo 99012 Ship Lbl - Home Adr.txt private/ Dymo 99012 Ship Lbl - Work Adr.txt sbin/ Dymo 99014 Ship Lbl - Work Adr.txt tmp/ Dymo 99014 Ship Lbl- Home Adr.txt usr/ Library/ var/ Razvan-Chiriacs-iMac:~ Razvan$ // .Spotlight-V100/ Network/ .Trashes/ ORP-1.2-BETA-OSX/ .fseventsd/ Resources/ .vol/ System/ Applications/ The Sims 3.localized/ Call of Duty 4/ TheVolumeSettingsFolder/ Dymo 30252 Add Lbl - Home Adr.txt User Guides And Information/ Dymo 30252 Add Lbl - Work Adr.txt Users/ Dymo 30256 Ship Lbl - Home Adr.txt Volumes/ Dymo 30256 Ship Lbl - Work Adr.txt bin/ Dymo 30256 Visitor Lbl.txt cores/ Dymo 30321 Add Lbl - Home Adr.txt dev/ Dymo 30321 Add Lbl - Work Adr.txt etc/ Dymo 99012 Adr Lbl - Home Adr.txt home/ Dymo 99012 Adr Lbl - Work Adr.txt net/ Dymo 99012 Ship Lbl - Home Adr.txt private/ Dymo 99012 Ship Lbl - Work Adr.txt sbin/ Dymo 99014 Ship Lbl - Work Adr.txt tmp/ Dymo 99014 Ship Lbl- Home Adr.txt usr/ Library/ var/ Razvan-Chiriacs-iMac:~ Razvan$ // 20 columns wide: -bash: //: is a directory Razvan-Chiriacs-iMac:~ Razvan$ // 01234567890123456789 -bash: //: is a directory Razvan-Chiriacs-iMac:~ Razvan$ lcd_line_one(); -bash: syntax error near unexpected token;' Razvan-Chiriacs-iMac:~ Razvan$ lcd_write_string(PSTR(" Congratulations! "));-bash: syntax error near unexpected token PSTR' Razvan-Chiriacs-iMac:~ Razvan$ lcd_line_two(); -bash: syntax error near unexpected token;' Razvan-Chiriacs-iMac:~ Razvan$ lcd_write_string(PSTR("****"));-bash: syntax error near unexpected token PSTR' Razvan-Chiriacs-iMac:~ Razvan$ lcd_line_three(); -bash: syntax error near unexpected token;' Razvan-Chiriacs-iMac:~ Razvan$ lcd_write_string(PSTR(" Your USB NerdKit "));-bash: syntax error near unexpected token PSTR' Razvan-Chiriacs-iMac:~ Razvan$ lcd_line_four(); -bash: syntax error near unexpected token;' Razvan-Chiriacs-iMac:~ Razvan$ lcd_write_string(PSTR(" is alive! "));-bash: syntax error near unexpected token PSTR' Razvan-Chiriacs-iMac:~ Razvan$ Razvan-Chiriacs-iMac:~ Razvan$ // turn off that LED -bash: //: is a directory Razvan-Chiriacs-iMac:~ Razvan$ PORTC &= ~(1<<PC4); -bash: syntax error near unexpected token(' Razvan-Chiriacs-iMac:~ Razvan$ Razvan-Chiriacs-iMac:~ Razvan$ // busy loop -bash: //: is a directory Razvan-Chiriacs-iMac:~ Razvan$ while(1) { -bash: syntax error near unexpected token {' Razvan-Chiriacs-iMac:~ Razvan$ // do nothing -bash: //: is a directory Razvan-Chiriacs-iMac:~ Razvan$ } -bash: syntax error near unexpected token}' Razvan-Chiriacs-iMac:~ Razvan$
Razvan-Chiriacs-iMac:~ Razvan$ return 0; -bash: return: can only return' from a function or sourced script Razvan-Chiriacs-iMac:~ Razvan$ } -bash: syntax error near unexpected token}' Razvan-Chiriacs-iMac:~ Razvan$

and the display is not changed.

August 05, 2010
by Ralphxyz
Ralphxyz's Avatar

I am sorry but who told you to "I copied all the contents of the initialload.c file, and pasted it into a terminal window,"?

All you have to do is to follow the NerdKit tutorial, not doing anything else and it will work for you.

If you do other things you "think" might work you will be disappointed. Just follow the instructions until you learn what you are doing.

Ralph

August 05, 2010
by hevans
(NerdKits Staff)

hevans's Avatar

Hi Razvan,

Please slow down and take the time to read through the steps in the guide. I know it can be quite involved, but it is worth it in the end. On the command line you should always be typing in commands yourself, the NerdKits Guide will not ask you to copy paste any commands into the command line.

You do not need to copy the contents of initialload.c into the command line (or the contents of the Makfile). initialload.c is a C file with code in it. From the command line you need to navigate to your Code folder, then type

make

The make program will read the Makefile and follow the instructions in the Makefile. These instructions will compile the initialload.c file and then upload the resulting .hex file onto the chip. Does that make sense? If you are getting confused feel free to ask questions, we will do our best to clarify the process.

Humberto

August 05, 2010
by Razvan
Razvan's Avatar

Can anybody tell me how do I complete the steps on page 43 on the guide?

August 06, 2010
by Ralphxyz
Ralphxyz's Avatar

What is it you do not understand or canot follow on page 43 of the user Guide?

Here are all of the steps on my MAC mini so you should see the same results: (do not enter comments //)

miniMac:/ Me$ cd /developer/nerdkits/code/tempsensor                                     // change directory to tempsensor folder                                       
miniMac:tempsensor Me$ make                                                              // type make

avrdude -c avr109 -p m168 -F -b 115200 -P /dev/cu.PL2303-0000101D -U flash:w:tempsensor.hex:a

Connecting to programmer: .
Found programmer: Id = "FDL v02"; type = S
    Software Version = 0.2; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x35

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9406
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "tempsensor.hex"
avrdude: input file tempsensor.hex auto detected as Intel Hex
avrdude: writing flash (10252 bytes):

Writing | ################################################## | 100% 10.89s

avrdude: 10252 bytes of flash written
avrdude: verifying flash memory against tempsensor.hex:
avrdude: load data flash data from input file tempsensor.hex:
avrdude: input file tempsensor.hex auto detected as Intel Hex
avrdude: input file tempsensor.hex contains 10252 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.29s

avrdude: verifying ...
avrdude: 10252 bytes of flash verified

avrdude done.  Thank you.

miniMac:tempsensor Me$

That's it. It is really that simple.

You will need to switch between programing and run mode.

You will need to unplug your USB cable to run the program.

You might need to re-boot your computer at times.

Just take it a step at a time and move slowly.

Do not be surprised that you have to repeat and check yourself all of the time.

The instruction manual has worked literally for thousands of us!

Ralph

August 06, 2010
by Razvan
Razvan's Avatar

Thank you! It worked

Post a Reply

Please log in to post a reply.

Did you know that our USB NerdKit comes with everything you need to get started with microcontrollers? Learn more...