Go Down

Topic: program Atmel chips using Arduino Uno- guidance requested (Read 2 times) previous topic - next topic

takao21106

Apr 02, 2012, 04:17 pm Last Edit: Apr 02, 2012, 04:20 pm by takao21106 Reason: 1
Hello I have recently received Arduino that I purchased.
It has been added to the Arduino group on flickr (LED display Arduino)
However the LED display isn't connected electrically right now.

I have downloaded the software (from the link here on this site),
and have tried out a few simple sketches. All good so far no problems.
The PCB also has an imprint "Uno Compatible".

Now what I want to do (eventually) is to program additional Atmel chips,
using this Arduino.

My questions:

-what chip numbers can be programmed?
-what is the software that I need to write programs (I guess Atmel AVR Studio)?
-How can I actually flash the hex file using the Arduino? Are there any tutorials or links that you know?
-What are the electrical connections that are needed for ICSP is there any tutorial or web page for this?

This is the Arduino PCB: http://www.flickr.com/photos/takao21203/6883403766/

Actually, the Microcontrollers category is more appreciate I guess.
I didn't post it in the right category  :smiley-roll-sweat:
I also have PIC related web domain.

xl97

hi..

Im a beginner to all this, so take my advice for whats its worth. :)

however I have flashed many blank chips.. both DIP and QTFP ATmega328P's..

Using my Arduino as an ISP... (and FTDI) programmer..

I have used it to flash the Arduino bootloader to many minimal/standalone set-ups on a breadboard....

but recently.. I was advised to use Optiloader sketch to 'bootload' blank chips.

I dont think I'll ever look back!  ;)

The optiloader sketch finds your device ID and then loads the appropriate .hex file/bootloader to the chip.

I think it has support for multiple types of chips.. plus there have been many posts about how to add/edit for support for others.


Bascially you take you REAL Arduino board...set itup normally. correct COM PORT... correct BOARD type chosen..etc
and upload the Optiloader sketch to your Arduino..

(this for lack of better/longer explanation turned you Arduino into a device that will now flash bootloader onto other chips.)

power down..  hook up your blank chip, minmal Arduno/ATmega circuit  (chip, crystal, some caps..etc)

Arduino  >>>   Blank/Target Circuit

D10   >>>     RESET PIN
D11   >>>     D11
D12   >>>     D12
D13   >>>     D13

GND   >>>    GND
5v+   >>>    5v+


and once you power back up.. the Arduino sketch will search/see this blank (target) chip..and flash it automaically with the correct bootloader.

takao21106

OK thanks for your explanation.

I think my board has the Opti bootloader already.
Or is it a seperate sketch that is used to flash other chips?

Do I have to disconnect the USB interface?

Using your explanation I could flash a bootloader.
How can I flash a sketch?
Or do I have to use the AVR studio to generate a hex file?

I only have one USB interface right now, the one that is on the board.
Should I get another USB interface for the external chips?

I don't want to mess up the board more than neccessary and your advice maybe can save me from hours of experiments.

Or maybe I should get a seperate flash writer they are not expensive.
I also have PIC related web domain.

xl97

IU'll try to answer best I can.. :)


OK thanks for your explanation.

I think my board has the Opti bootloader already.
Or is it a seperate sketch that is used to flash other chips?


this was a bit odd for me too..
it is 'both' (sorta).. you FLASH your real/true (already working Arduino) with the Otiloader sketch.

this sketch turns your Arduino into an ISP.. so you can flash other boards/chips connected to it.




Do I have to disconnect the USB interface?


no.. I leave my REAL (the Arduino I just wrote the Optiloader sketch to) plugged into my USB cable to whole time (unless I am hooking up things to the I/O headers of course)..

this allows me to be powered by the USB 5v+ as well as go to the Serial Monitor and watch the Optiloader sketch results (see if my other blanks boards/chips are being flashed correctly)


Using your explanation I could flash a bootloader.
How can I flash a sketch?
Or do I have to use the AVR studio to generate a hex file?


So you CAN flash the bootloader to your new/blank chips?  or not?  What makes you think yes (or no?)  have you watched the serial monitor output?

You flash a sketch the normal way you would yoru target board...  by either using an FTDI cable.. (home made one from a cell phone data cable).. or you can use you Arduino to uploade sketchs to you target board/chip.. (but popping out the current 329 DIP chip in there.. and using the RX/TX/DTR & 5V/GND lines.. the IDE will send code THROUGH your Arduino withthe chip missing.. onto the target board/chip...

I have never used AVR Studio or AVR Dude..etc.. outside of what may used through the Arduino IDE..


I only have one USB interface right now, the one that is on the board.
Should I get another USB interface for the external chips?


nope.. you can use your REAL Arduino for everything you need.. You can turn it into an ISP programmer to get bootloader software on other chips..  or... use it as a 'pass through' device to send sketchs form the IDE through the board onto the target chip/board..etc


I don't want to mess up the board more than neccessary and your advice maybe can save me from hours of experiments.
Or maybe I should get a seperate flash writer they are not expensive.


Nothing should be messed up.. things can all go back to normal once you NEW/BLANK board is all set up..

basically once you flash whatever bootloader you want onto the blank chip.. it 'IS' an Arduino.. (meaning on reset, hardware or software.. the bootloader will run for a few seconds allowing a sketch to be uplaoded)

hop this helps..


takao21106


nope.. you can use your REAL Arduino for everything you need.. You can turn it into an ISP programmer to get bootloader software on other chips..  or... use it as a 'pass through' device to send sketchs form the IDE through the board onto the target chip/board..etc


Thanks your explanation is very helpful. So I have to select "Arduino as ISP" from the menu?
Right now it shows AVRisp mkII. And then upload the sketch by selecting "Upload using programmer"?

I will order some chips soon. Is it possible for instance to use the ATMEGA8, or does it have to be ATMEGA328? My board shows up as Arduino pro, 5v, 16 Mhz, ATMEGA328.
I also have PIC related web domain.

xl97

again..this is far from my strong point here.. I just chimed in, because I recently used Optiloader approach.. and also had run this same process with a custom board).


For your first step..

getting a bootloader onto your new/blank chips (when they arrive)..

1.) you will need to decide HOW you want to do this?... you can choose:

     a.) use Arduino as ISP approach
     b.) Optiloader approach

     **Note.. if you like.. more advanced users do not even use a bootloader, and they write sketches directly to their boards...to take advantage of more space, that the bootloader usually consumer..however that is beyond me


for approach 'a' above.. there are many tutorials..and diagrams..
such as this one: http://arduino.cc/en/Tutorial/ArduinoISP
(google will probably yield eve more)



for approach 'b' above...  you will do as I outline in the previous post(s)  :)


If you want to do other chips.. I suggest learn how to you use the Optiloader approach.. I think it can do/detect different chips. (ask to be sure though)...

takao21106

I'll get some ATMEGA8 as well ATMega328 as soon as some extra funds become available (that I don't need for other projects).

The 328 actually is quite expensive, costs 4.50 Euro from my local vendor, and they are a professional supplier not a hobby shop. I didn't see it for less than $6 on eBay as well.

I don't mind I am interested to try develope some gadgets based on the 328 however for this price I can buy a PIC32 already. So the cheaper ATMega8 is also interesting or any other kind of Atmel chip that can be programmed using the Arduino.

Actually, is it possible to use an USB/serial converter to program these Atmel chips? Because I have some of them around.
I also have PIC related web domain.

Erni

Quote
Actually, is it possible to use an USB/serial converter to program these Atmel chips


Yes, if you first burn the bootloader.

If you are looking for cheaper AVR's take a look at fx.: Attiny85

takao21106

All your replies are helpful. I am just starting using the Atmel platform, and it's not all obvious to me.

So the USB/serial converters can program the 328 for instance, using the bootloader?
Is it wrong the Arduino also is capable to write the bootloader on a blank chip?
What I don't fully understand there also only seems to be some kind of USB/serial converter IC.

I am more interested to flash chips directly, not using a bootloader.
Or what is the advantage of having a bootloader? I have been thinking about that but did not figure out why people use a bootloader.
I also have PIC related web domain.

Go Up