Go Down

Topic: arduino software sketches without arduino hardware (Read 942 times) previous topic - next topic

nightcrawler218

hello,

I am a newbie in avr series microcontrollers. I am learning how to write code & burn microcontroller via avrstudio & usbasp serial programmer. I want to learn the arduino language to upload my own sketches to atmega8 & use it in specific boards for embedded projects. I have the arduino software & a usbasp serial burner(6pins)

is there any way to upload sketches directly to the atmega8 via the usbasp? or is there any way to get the arduino software generated hex file, so that I can burn it via extremeburner & usbasp?

kindly help.
"Imagination is more important than knowledge."
-Einstein

Osgeld

yes you can change boards.txt for your MCU to use AVRISP or USBASP to upload direct from the IDE or the hex file is usually stuffed away in a temp folder somewhere

exactly where is dependent on your OS
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

nightcrawler218

Thanks for your response. will you kindly explain the steps...
I have already viewed the pages but they either use an arduino board or a boot-loader preloaded atmega chip. so they are of no help to me. :(

http://tutorial.cytron.com.my/2011/09/30/how-to-program-arduino-by-using-avr-usbasp-programmer/
http://revoltlab.com/projects/perfduino/


I have a fresh atmega8 chip (I can get an atmega328 if needed), usbasp, arduino software1.0.3 & a will to learn the arduino language.
"Imagination is more important than knowledge."
-Einstein

Osgeld

well if you want to just upload through the IDE what you would do is find the boards.txt file (on my computer its under C:\Users\user\Desktop\arduino-1.0\hardware\arduino)

edit it with something like notepad ++ or wordpad if your in the windows world, finding a section that looks like

Code: [Select]
##############################################################

atmega8.name=Arduino NG or older w/ ATmega8

atmega8.upload.protocol=arduino
atmega8.upload.maximum_size=7168
atmega8.upload.speed=19200

atmega8.bootloader.low_fuses=0xdf
atmega8.bootloader.high_fuses=0xca
atmega8.bootloader.path=atmega8
atmega8.bootloader.file=ATmegaBOOT.hex
atmega8.bootloader.unlock_bits=0x3F
atmega8.bootloader.lock_bits=0x0F

atmega8.build.mcu=atmega8
atmega8.build.f_cpu=16000000L
atmega8.build.core=arduino
atmega8.build.variant=standard


and change

Code: [Select]
atmega8.upload.protocol=arduino
to
Code: [Select]
atmega8.upload.protocol=usbasp

now if your chip is hooked up right when you hit upload in the ide it should go though the usbasp to program the atmega target
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

nightcrawler218

I have made the exact changes that you suggested. I am gettting the following error while uploading a sketch via usbasp.

==========================================================
Binary sketch size: 914 bytes (of a 7,168 byte maximum)
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.
==========================================================

"Imagination is more important than knowledge."
-Einstein

James C4S

If you turn on verbose output you'll get some more debugging information and the location of the HEX file the IDE generates.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

nightcrawler218

"Imagination is more important than knowledge."
-Einstein

nightcrawler218

I am trying to write the arduino bootloader hex file (ATmegaBOOT_168_atmega328.hex) in a fresh Atmega328 chip. When I load the hex file in the extremeburner software, the hexfile shows only FFFF. The hexcode is full of FFFF codes, no other hex number is there. Is it ok or is there any issues in the hex file...? Kindly explain the issue.
"Imagination is more important than knowledge."
-Einstein

nightcrawler218

In file included from sketch_feb26a.ino:2:
C:\Program Files\arduino-1.0.3\hardware\arduino\cores\arduino/Arduino.h:213:26: error: pins_arduino.h: No such file or directory
 


What to do...?
"Imagination is more important than knowledge."
-Einstein

Osgeld

that file should be in

(arduino location)\hardware\arduino\variants\standard

if it IS, it should be picking it up in the environment variables, what you could do is copy and paste it into

(arduino location)\hardware\arduino\cores\arduino

though I dont know what kind of greif that will cause you in the future with other arduinos (ie arduino mega), but maybe a quick fix for now
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

nightcrawler218

"Imagination is more important than knowledge."
-Einstein

Go Up