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 » Compiler. besides the gcc?

December 03, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Does anyone know of a quick and easy replacement for avrgcc/winavr? I just tried IAR, don't ask me who they are i just grabbed it off the net. Their compiler doesn't recognize any of the nerds makefiles, so i think it's useless, unless you go "their" way.

December 03, 2009
by hevans
(NerdKits Staff)

hevans's Avatar

Farmerjoe,

I have never used IARs products, however a cursory look through their site indicates they provide a full workbench for working on embedded systems. It is very likely a very powerful tool, but for learning and experimenting avr-gcc does a fantastic job. I think the way to go is to try to get your avr-gcc up and running again. Please email us screenshots or descriptions of the errors you are getting, and as always we will help you get to the bottom of the issue.

Humberto

December 04, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Hi Humberto,

Make wasn't working and I did a complete uninstall/reinstall and that part of it works again. It's the same error as before over and over again.

December 04, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Me again, how does a guy compile from programmer's notepad or the studio?

December 04, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Me again, again. Just discovered the compiler brings the same error (application has requested runtime to terminate unusual manner, contact applications support) when none of the programmers are plugged. The ports still work for everything else. I definatly need a different compiler.

December 04, 2009
by Rick_S
Rick_S's Avatar

When and from what application are you getting this error?? WinAVR is a bundle of programs NOT just a compiler. If this error is coming up during make, it could be the gcc compiler or avrdude. If it's coming up in Programmers Notepad, it may be neither the compiler or avrdude.

December 04, 2009
by hevans
(NerdKits Staff)

hevans's Avatar

Grant,

This is actually a big step forward. A consistent error message is at least something we can work from. I don't think you need a new compiler, I do think we need to figure out what is wrong with avr-gcc. I am putting up your screen cap of what I believe is the error you are now consistently getting, so that the wisdom of the community can help us out. Let us know if this is not the error you are getting.

runtime requested to terminate

As Rick_S said above this WinAVR is a whole suite of programs, it could be the make program itself is acting up, it could be avr-gcc, or it could be neither and perhaps the things you are trying to compile have been corrupted somehow.

First thing to try is downloading a new copy of the Code folder from the website, and try compiling that.

Next, try this. cd your way into the initialload folder. Then type:

avr-gcc -g -Os -Wall -mmcu=atmega168 -Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscanf -lscanf_flt -lm -o initialload.o initialload.c ../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o

and hit enter. This is manually typing what the makefile would otherwise do. See what kind of error you get there.

If it still doesn't work, try

avr-gcc -v

this should tell avr-gcc to print out its version information.

Take a screenshot of that and post it so we can take a look.

If anybody else has any ideas, let us know.

Humberto

December 04, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Rick, That error is from the command line. Can you give me a quick rundown on compiling with programmer's notepad. I fail to see how that works.

Humberto, New files and the shitty pic is because windows doesn't have a screen shot and i had to be farther way to get it all in. Your make code first, avr-gcc -v next. alt image text

December 04, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

What's going on with that anyway? I put the address in should there be something else?

December 04, 2009
by Rick_S
Rick_S's Avatar

If WinAVR installed correctly, when you select tools/make all it will run make as if you did it from the command line. Also, one thing I have noticed on my Vista boxes. If I am not logged in as a FULL administrator (not just a user with administrative privileges) It will not install properly. Just a heads up. You might try to un-install then re-install under the administrator login.

Secondly, On a windows pc just press the print screen key to capture the entire screen in the clipboard or press alt+printscreen to capture the active window in the clipboard. You can then open paint and paste the contents and save it as a jpg or bmp.

December 04, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Mr Maintenance, Substitute this please. alt image text

December 05, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Thank's for the tip on the ole print screen. So i've just loaded a makefile in programmer's notepad and it's the same error from there too. I also plugged my external hdd in all the ports and the ports are fine. I'm almost sure now it's the gcc so I need another compiler, if you happen to know where i can pick one up cheap, i'm listening.

December 05, 2009
by Rick_S
Rick_S's Avatar

I don't know anything about other C compilers as this is my 1st real experience with C at all.

There is a very good basic compiler for micro-controllers called BASCOM. I used it exclusively prior to the nerdkit.

Bascom-AVR can be found at MCS Electronics Bascom download page.

If you know basic this compiler works great and the demo will compile up to 4k of code.

But back to the topic at hand...

Did you type the line in Humberto told you to when he said this:

"Next, try this. cd your way into the initialload folder. Then type:

avr-gcc -g -Os -Wall -mmcu=atmega168 -Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscanf -lscanf_flt -lm -o initialload.o initialload.c ../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o

"

If so, what were your results?

It seems you are determined to prove us wrong rather than trying what we suggest. I know you are getting very frustrated at this point as it's obvious from your many posts. However, diagnosis of problems is a process. That process typically starts with simple elimination of possible issues until the issue at hand can be identified to fix it. You have the luxury of being able to see what is on your screen at a given time. We do not have that same luxury. That is why suggestions are made of things to try. Alberta is a long way from where I live so it's not like we could meet and try to hash this out over some coffee. I've made suggestions based on my own known issues and experiences. I've seen suggestions from others including Humberto and Mike based I'm sure on their experiences I don't know what more to tell you other than START OVER.

As the administrator login of your pc NOT your regular user login.

Remove WINAVR.

Re-download WINAVR(in case their was some corruption in your copy) and as the administrator, re-install WINAVR.

Log back in as your regular user.

Re-download the code.zip file from nerdkits.com members area and extract the file.

DO NOT MODIFY ANYTHING THERE YET.

Do what Humberto told you above and report back with the results.

Keep in mind, the software portion is only 1/2 of the issue. The other half is the electronics portion. The fact that you were using AC adapters that were supplying WAY beyond the maximum operating conditions of the micro-controller and have yet to clarify if you've corrected that is another topic altogether.

Keep up the fight, I know you can get this but it has to be taken steps at a time. I hope my words haven't peeved you. I tend to be somewhat tactless at times. My apologies up front if I came across that way! :)

Rick

December 05, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Goodmorning, ya'all,

Thank's for the compiler, that'll give me something to play with until my xp cd arrives. No sence installing linux again, the cd was supposed to get here yesterday. So i'm betting with a new install of everything will fix my problems. I mentioned it before but windows said no more, i've had enough, no more of your experimenting with your new found code. Therefore there's a complete and total ban on the gcc compiler, until further notice. Which probably means never. Signed Bill Gates. I'll give the new compiler a shot and post again. thx all.

Farmerjoe

December 05, 2009
by Rick_S
Rick_S's Avatar

FarmerJoe,

The Bascom compiler I spoke of will NOT compile the C code of the nerdkit. It is a compiler for the BASIC programming language. Sorry if I misled you.

As I said in the very 1st line of my last post, I don't know anything about other C compilers.

Oh, and BTW, Good Morning to you as well!

Rick

December 05, 2009
by pbfy0
pbfy0's Avatar

here's the picture

error

December 05, 2009
by JKITSON
JKITSON's Avatar

FJC

HAVE YOU USED THE NERDKITS MANUAL AND STARTED FROM THE BEGINNING? I DON'T KNOW OF A BETTER WAY OF LEARNING "C" AND LEARNING HOW TO USE THE USB/SERIAL ADAPTER TO THE 168 MCU.

THIS IS MY FIRST TIME WITH "C" AND COMPILERS. WINAVR WORKED VERY WELL AFTER I FOLLOWED THEIR MANUAL AND DID THE VERY SIMPLE PROJECTS. PLEASE HELP YOURSELF AND THE REST OF US AND TRY THIS APPROACH AGAIN....

THANKS JIM

December 05, 2009
by Rick_S
Rick_S's Avatar

OK, you obviously did not do what I said to do. Because you are NOT in the initialload folder you are in the heart folder. Even though you have placed this heart folder in a folder named code it is obvious since gcc can't find the ../libnerdkits folder that your code folder is not a fresh unzip from a fresh download.

C'mon FarmerJoe, PLEASE follow the basic instructions. QUIT trying to do it your way. We already know that isn't working for you. Instead try to follow step by step what has been described to you.

When avr-gcc says: avr-gcc: ../libnerdkits/delay.o: No such file or directory

That means that the folder above wherever you are currently does not contain what avr-gcc is looking for. The default download has those files. You obviously do not have them there.

Take it a step at a time and quit trying to jump ahead of yourself. avr-gcc can only do what is being fed to it. And the old computer addage -- "Garbage in - Garbage out" is still as true today as it ever was.

December 05, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Geez guy's I thought I had this under control. Rick, i've done everything i can for now. There is a new code folder there but if i'm going to flash the chip I wanted the heart on it, that's all. Here's a better pic. alt image text

My first clue, the gcc/make was working fine 3mo's ago. (I was doing 90% of my work on linux since switching.) and when I got my new programmer I came back to windows and make didn't work, why? I know all the in's and out's of folders etc, but it wouldn't work. So whatever part of that program that quit is still quit. This is uninstalled/reinstalled twice. How much of that power surge got to the port? I know it's far fetched but what else, I didn't touch anything else with that program. I'll post when I get my xp disk.

December 05, 2009
by pbfy0
pbfy0's Avatar

here's the image:

error

December 05, 2009
by hevans
(NerdKits Staff)

hevans's Avatar

Hi guys,

@pbfy, thanks for fixing the image.

@Rick_S, thanks for all your input so far. We are slowly making progress on this together.

@Farmerjoe, in order to minimize the places something could be going wrong, you should stick to trying to get initialload on the chip (a fresh version that has not been messed with). After we get that on there we can move to getting other code on your chip.

A little googling of that problem brings up a bunch of threads with people trying to run programs made with Visual Basic on specific versions of XP. Farmerjoe, have you tried installing the latest version of WinAVR from their site. Since none of our newer customers are having any similar issues, there might be some mismatch between the version of WinAVR on your CD and some update of Windows you downloaded at some point. Try downloading and installing the latest version of WinAVR from here.

Keep us updated Farmerjoe. Let us know if new errors popup, and post screenshots.

Humberto

December 05, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Hi, Sorry i'm late, night owl you know.

I thought halloween was over. There's something very spooky going on here. Can't quite figure how make works but the rest of it doesn't, and honest these files haven't been played with, by me anyway, you'll have to ask the spook on this one. Seriously, if I had something on my system that was interfereing with the gcc, i have no idea what that would be. There's been lots of stuff come and go over the last year or so, could be some piece of code another program ate, who knows for sure. You know i just remembered i defragmented right after the first time i took it out. When they reinstall they go back to the same place on the disk and the defragmenter moved one of those pits. The reinstall doesn't put it back where it can find it. What?

December 06, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Good news Bad news?

I started over. Got rid off all the avrgcc and started at the bottom instead of at the top. I got to the 20030312 release and we got life. Don't know if it's friendly yet.

So it must be where the image is coming from, from gimages they show up. alt image text

December 06, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

So assuming the error means no bootloader I put in another new chip and it brought the same error. This my first attempt at loading the foodloader. I'm using the parallel port hack. Somebody got a better way of inserting images? alt image text

December 06, 2009
by hevans
(NerdKits Staff)

hevans's Avatar

Hi Farmerjoe,

My bet is not on a de-fragment, but a windows update you did that might have broken a dll somewhere.

That error you are now getting actually means avr-gcc has no idea what chip you are talking about. I think it is because you went back to a release from 2003, and not the latest release. Please install the latest version of WinAVR, here is a direct link to it

Humberto

December 06, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Humberto, Your getting to be like me, owl! Here's a picassa pic any diffrence? alt image text

December 06, 2009
by hevans
(NerdKits Staff)

hevans's Avatar

Farmerjoe,

We do what we can for customer service. If I see an opportunity to help a customer, no matter what time of night, we will do it.

Direct image inserts will only work if the link is to the image itself, not to a page that contains pictures. Please use the Links syntax (without the exclamation points) so that we get links to your images.

I was able to see your pictures before, and your new images are the same images, just uploaded to a different site. Please try what I suggested, installing the new version of WinAVR instead of the very old one that you installed from 2003.

Humberto

December 06, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Goodmorning anyway. Bad news, i just put in the latest and were back to square one. You sure i shouldn't have built up to it?

December 06, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Well guy's, thank's for all your effort. Why the gcc is broken will remain a mistery. I still think it was the defragmenter, but i've been know to be wrong before. Just one last request for this post, pbfy0 would you please post the two not three images, thx.

Farmerjoecoledge (Alias Grant 06122009)

December 07, 2009
by hevans
(NerdKits Staff)

hevans's Avatar

Farmerjoe,

I'm pretty sure you do not need to build up to it. When you are doing the uninstall of the previous version, how are you removing it? Try using the Windows Add/Remove programs feature from the Control Panel to remove WinAVR and then install a new copy. There is really no reason why that should be more effective at uninstalling a program, but at this point it is worth a shot.

Humberto

December 07, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Humberto, Yeah, I just used their uninstaller from the start menu, I just went to add/remove and the link there is the same uninstaller. So it's still broken.

December 07, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Hey Guy's,

What if I did a system restore to before when the gcc worked? I don't have disks for this machine either and my new cd didn't get here today either. So no problem backling things up but there's been a fair amount of stuff come and go in the last 2-3mo's. Very leary of this idea, you too?

December 08, 2009
by pbfy0
pbfy0's Avatar

here's the image

foodloader

FJC:

you're making the image a PHP page instead of the actual image. Try dragging the image on the page that you put in the image, and then copying that address.

December 08, 2009
by pbfy0
pbfy0's Avatar

image 1: image 1

image 2:

image 2

image 3:

image 3

December 08, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Hi Mike,

We got too many images now, 3 are the same, thx.

The system restore didn't fix it either, amazing program that one, one minute i was back a mo, diffrent desktop etc and the next minute i'm back where i was, what did it do with the files it replaced? I think it basicly didn't remove anything it just changed it back to the copy it made for that date, and unrestoring just moved it back ahead.

December 19, 2009
by BobaMosfet
BobaMosfet's Avatar

Farmerjoecoledge--

Slow down. STOP. Don't make large leaps and desperate jumps uninstalling, reinstalling, changing software, etc-- all that does it make everything worse. Please.

Instead of trying to do big steps, take very small steps and make sure each step worked before proceeding to the next.

I would recommend, if you are willing to allow someone else to log onto your computer remotely for a short period to just help you get some things straightened out, that you try installing "TeamViewer 4" on your system and sending them the other piece of it. They can call, and you can grant them passworded access (which you can stop at any time).

Some problems can only be solved if a more knowledgeable person can do hands on-- there are so many things an experienced person looks for that someone else won't see-- and it takes WAY (OH MY GOD) TOO many words to try to talk someone through who is frustrated. Team Viewer could allow someone to help you and have you stable in maybe an hour, instead of all this back and forth that could take days/weeks/months.

Plus. they can talk to you on the phone at the same time and show you things "live"...

It's a thought. I would offer, but I don't know Makefiles well enough to do it myself-- I use AVRStudio 4, with WinAVR underneath.

I also recommend you install something like Anvir Task Manager (Free)- because it will show you EVERYTHING that's going on in memory-- so you can see if you might have something like a virus operating, or something else not playing fairly.

December 20, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Hi Boba,

Not to worry I got a xp cd and installed it in my laptop which was previously kubuntu. So now the gcc works but my two new programmers don't. I'm presently trying my hand at isp programming, so far i got a led to blink. It's a different twist most tutorials use different chips. I found a compiler for hex files but no code to make the hex. If you know of some projects for the atmega168 with a isp programmer, pass it on. thx

December 20, 2009
by Rick_S
Rick_S's Avatar

FarmerJoe! Welcome back, It's been a while.

What do you mean by the gcc works but your two new programmers don't? How did you get an LED to blink if no programmer worked? Or do you mean the serial (bootloader) programmers don't work but the ISP does?

Sounds like you are getting close.

By the way, the type of programming interface has nothing to do with the creation of the hex file. All the ISP or Serial "programmer" does is transfer the hex file to the chip.

When you said " I found a compiler for hex files but no code to make the hex " what exactly were you saying?

BTW, GOOD to see you back!

December 20, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Hi Rick, thx

You are right about the isp. Right now i'm trying to sort this protocol out. Do you know if the bootloader can be erased? Just read ardrino's boot is locked, can't be changed for anybody else's code. The fuses are set by the bootloader, but at the same time i just flashed it and a led blinks. I'm not sure what's going on. It said the fuses were ok before flashing.

What i would like is to run some more code but none of the nerds works. thx

Grant

December 20, 2009
by Rick_S
Rick_S's Avatar

Arduino's can be changed I've bought tw0 mega328p's from ebay and changed the arduino bootloader to the nerdkit bootloader. All you have to do is re-program the fuses and rewrite the bootloader.

And yes, the nerdkit bootloader can also be erased. Again, fuses may have to be changed to do so but it can be erased. If the chip is programmed via ISP it does not HAVE to have the bootloader there. The bootloader is only there for serial programming.

Serial programming is definitely the preferred method for beginners as there is a much lower likelihood of making a chip un-usable. This is because a serial bootloader cannot change the fuse settings. ISP programmers can change fuse settings and as such require a bit more caution.

I'm not exactly sure why the NK code wouldn't work when sent over via the ISP. What hex file were you trying to send and how did you go about trying to send it?

December 20, 2009
by BobaMosfet
BobaMosfet's Avatar

FJC--

I'm going to clear some things up here and help you (hopefully). By the way, CONGRATS on getting this far, that is a MAJOR ACCOMPLISHMENT for anyone! :D I kid you not!

First Let's explain some things about the chip and bootloader.

  1. The bootloader was put on the chip SOLELY so that the chip had a program installed on it that could self load code, when connected to a serial connection. Your chip does NOT NEED a bootloader of any kind to operate. It has all it's underlying brains (circuitry built in- including enough intelligence to respond to your ISP programmer, which utilizes the "Memory Programming" method described in the ATMEGA168 data sheet- Section 27. See subsection 8 "Serial Downloading" for the protocol.

  2. When you write code to the chip, the chip starts at the only location it knows about.... zero. From there, your code is read and executed.

  3. C is a high-level language (meaning 'human understandable'.) Assembly (.asm) is a medium level language-- meaning it is also understandable-- but it has extra things in it-- white space, comments, lables, and so forth-- to help you understand it-- but it isn't as verbose or friendly looking as 'C'All. Hex, .Obj, .bin-- this are all object or binary code the same. Ones and zeros at the smallest useful value.

When you flash your program to the chip, the compiler has converted it from a high-level language, stripped out all the comments, whitespace, semicolons, everything that the chip wouldn't understand, and reduced it to binary. At the same time, they may output a .asm file-- but that is to display the interim assembly version (so you can see that the compiler converted your 'C' code correctly to the necessary binary code) yet still contain enough extras in it to be understandable.

This is why a piece of C code that might be 2K in character count, can be reduced to maybe 200 bytes when it sits on a chip. All the "air" is taken out of it.


If you erase your chip- it will sit there fat and happy-- it just can't do anything-- but it's still alive. Clock crystal will keep oscillating, circuitry will keep operating (enough to read the serial connection to the ISP) and the chip will be happy-- just in a truly primitive state of mind.


I think an important point to bear in mind, is that learning to program a chip is not the holy grail- that is fine if you want to be an embedded programmer, with a finite task and limits-- but (in my opinion) I believe the nerdkits is presenting a larger opportunity- be a circuit designer AND an embedded programmer, meld the two, and do truly AMAZING things. In other words, knowing how to program a chip is of possibly limited value, unless you also know how to design a circuit AROUND that chip to do something with it.


You're doing great, don't give up... just keep putting one step in front of the other, and before you know it... you'll be amazing yourself with what you can do!!!

December 20, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Thanks Boba, I've traveled too far to give up now.

I'm hung up on the fuses, I came across a tutorial that gives the fuse settings, The nerd bootloader has already set the fuses. So when i flashed the chip with the isp did it not change the fuses? I'm aware the bootloader isn't needed, but it's already there.

Rick, I ran the hex from the trafficlight and i forget what the error was there, but no go. I figured that one would work, once flashed just remove the isp set the leds and apply power.thx

December 20, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Good morning,

I should mention that i'm only dabbling with this isp protocol because i don't have a serial programmer. I can see why they skip this part. Now there's also the clock/crystal to worry about. So until i get another serial you guy's can get me straight. That reminds me, I got off on the wrong foot right away with this by buying an almost odd ball avr/isp/usb programmer, there's two different drivers for it, seems the drivers depend on the toolchain i use. I installed the manufactures recommended driver, and uninstalled it, put in the driver for eXtreme Burner-avr and the one and only sucessful flash produced a rapidly blinking led.

December 21, 2009
by Rick_S
Rick_S's Avatar

The fuses should not be changed by transferring a hex file to the chip via ISP.

What software on your PC did you use to transfer the blinking program to the chip?

Did you use AVRdude to transfer it to the chip?

If you used AVRdude did you set up a make file to do it or just run it command line?

OR... did you use a different program altogether?

It seems you are real close to having a working environment again. I'm assuming you have straightened out your voltage issues??

Rick

December 21, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Hi Rick,

The software I got to work is eXtreme Burner-Avr it's made by a guy who was unsatisfied with avrdude.

Both, I added the programmer and the -P to usbasp, to the trafficlight makefile. I tried through the command line and PN.

I'm not 100% sure, but right now the isp is powered by the usb. If you mean the regulator? I just checked it and the output is not 5v it's 3.9v that's got me puzzled. thx

December 21, 2009
by Rick_S
Rick_S's Avatar

Since the eXtreme burner-avr seems to have been able to program using your isp programming interface, have you tried using it to send the trafficlight.hex file to the chip?

You don't have to use avrdude to send the file over if you can't get it to work with your programmer. If eXtreme burner-avr will take an existing hex and transfer it to the chip, you can modify your nerdkit makefile to just complile by commenting out the portions you don't need (with a pound (#) sign) and changing the all: command. For example for the trafficlight program, your make file could look like this (see the all:, the original is commented out and the new one is right below it):

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
LINKOBJECTS=../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o

#all:   trafficlight-upload
all:    trafficlight.hex

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

#trafficlight.ass:  trafficlight.hex
#   avr-objdump -S -d trafficlight.o > trafficlight.ass

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

This would just complie the program into your hex file. You could then use eXtreme burner AVR to send it over.

Just a thought.

Rick

December 21, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

This angle is no fun at all. The eXtreme will not do anything now, the gcc produced a hex and it cannot connect to the programmer. I just wish this would just work, I'm trying to get on one path and the software is letting me down again.

December 21, 2009
by Rick_S
Rick_S's Avatar

Are you still using your isp programmer??

If so, what did you change the -c option in the AVRDUDEFLAGS to in the makefile? It is set at avr109 by default for the nerdkits programmer. Did you try replacing that with avrisp to see if it would program via ISP?

December 21, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

This is my avr isp http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=360175902591&ssPageName=ADME:X:AAQ:US:1123

And since it doesn't come with any documentation, this (below) is as close as i could come to a match. I'm banging my head on the wall every option fails. The only flash i got doesn't do it again either. I think maybe i'll set this aside until i can get another serial. Mine "avr"-isp-usb, theirs "Atmel"-isp-usb same name two different things??!!

http://www.fischl.de/usbasp/

December 22, 2009
by Rick_S
Rick_S's Avatar

Ok, did you try to replace the avr109 in the make file with usbasp ? That seems to be a good possibility for the ISP programmer you purchased.

Knowing you have avrgcc producing a hex file is a big plus. Now if we can get the programming software to recognize your programmer, you'll be rolling again.

Get an original NK makefile for the trafficlight project.

Change this line from:

AVRDUDEFLAGS=-c avr109 -p m168 -b 115200 -P /dev/ttyUSB0

TO:

AVRDUDEFLAGS=-c usbasp -p m168 -b 115200

Do not change anything else in the file.

Then try to program with the ISP programmer.

One other thing I just thought of, what does the circuit look like when you are attempting to program? That can make a big difference when programming via ISP. For the best results, you shouldn't have anything connected to the pins that the ISP is using. For instance if you have the wire on pin 1 that NK ties to 5v, that will prevent the ISP programmer from toggling the reset line and it will fail. That wire would have to be removed and pin one would have to be attached to the ISP programmer only.

We'll get there. If you want to send me a e-mail with photo's (good close ups of your setup), I'd be glad to try to help more. You can mail me at "rick at shear dot name" substituting the at and dot with the appropriate symbols :).

Rick

December 22, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

This must have something to do with the reset. Both programs recognize the programmer now and both the same "cannot connect with target" error. I found two wiring schemes one connects all the grounds the other only the main ground. Right now all the grounds are connected, does that have something to do with it?

I just put a brand new chip in and the compilers "won't connect with target" with that too. I also have a 100ohm resistor on pin 1 to vcc, yes? no? depends on who you listen to? Good thing i knew a little bit of this before the isp, I pitty anyone who takes this stuff on from scratch.

December 22, 2009
by Rick_S
Rick_S's Avatar

For ISP programming, I would remove the resistor from pin one altogether. A 100 ohm resistor is too small for a pullup anyway. You would typically want something more in the 10K or larger range. But for programming, remove it.

If by "all the grounds are connected" you mean the ones on the 10 pin ISP plug, you could just connect one of those to ground on your breadboard. They are most likely interconnected on the programmer anyway.

If it were me, I'd remove everything from the circuit except the power connections to the chip and the crystal. I would then wire the ISP programmer to the chip. If your programmer supplies power to the chip, run the power from the programmer to the target chip and do not use any other power. If not, use the external regulated supply you would use to operate. Then try to program.

You are getting real close I believe.

December 22, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

Doesn't matter what i do it will not "connect to target chip" I got some other type of life running on the chip. With the original led on pin 27 when i plug it to the usb the led comes on, goes off then has 4 stages of brightness up and back down again. What could that be? So there's something running on the chip and it hasn't been programmed with anything. Which is why it can't connect? It's got to be reset somehow I think.

December 22, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

PROGRESS! I hooked the lcd took the extra grounds off and a FLASH! The traffic light is functioning, but only hooked to the isp. Unhook it and apply regulated power and it don't work. But i'm trilled it's FINALLY doing something.

December 22, 2009
by Farmerjoecoledge
Farmerjoecoledge's Avatar

I'm on the road again! One of my voltage reg's is only putting out 3.9v the other is running the trafficlight without the isp. Well Rick your a great help! you kept me going, I was going to just put it aside for a rainy day but thanks to you i'm back, thanks to all of you. And MERRY CHRISTMAS! from the north pole. (Edmonton)

Grant

December 22, 2009
by Rick_S
Rick_S's Avatar

GREAT!!! I'm very happy to hear you finally got it going. I knew you could do it!!

Merry Christmas to you and yours, as well as a Happy New Year!

Rick

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...