Go Down

Topic: Other Atmega on the UNO (Read 14170 times) previous topic - next topic

alparent

Jan 13, 2011, 05:38 am Last Edit: Jan 13, 2011, 05:38 am by alparent Reason: 1
OK I don't know if this is the right location for this question?
I've just purchased a UNO and was wondering if I can use other controllers on it?

Yes I did search this site and Google also......but I'm so green it's not even funny!

I think from what I've read that the 168 is a simple switch.
But I was looking at the Atmega8 and 88.
I want to make stand alone projects and 4k or 8k would be good enough.

How to I get a bootloader and the sketches on them?

If it's doable please educate me  :-[ I basically need a step-by-step, this is what you need to do, kind of approach.  I'm green I tell ya!

Just got my board one week ago and I can't put it down.
Lucky for me...my programmer friend also got one. And he is helping me a lot!

Thanks in advance for any help you can give me.  

westfw

You should be able to drop an ATmega168 or ATmega8 (with appropriate bootloader) onto an Uno, with no other modifications (to the Uno.)  You would have to either buy these chips with a bootloader pre-installed, or have some other mechanism for installing the bootloader.

In the "board" menu, you would need to select the board based on the chip and bootloader used, rather than using "Uno."  So an Uno Board with atmega168 and the old bootloader would be called a "Diecimila ... with mega168"

alparent

#2
Jan 13, 2011, 03:09 pm Last Edit: Jan 13, 2011, 03:21 pm by alparent Reason: 1
OK, so if I install the bootloader using the Arduino as an ISP/breadboard method. I should then be able to use any of these chips. Right?
How to I select what bootloader to install?

From what I can read the Atmega88 is not supported?
Is the Atmega48 supported?

One more "kinda" related question.
If i want to use the atmega chip outside the Uno board, but I want it to use it's internal clock. Do I need a special bootloader?

And if I install a bootloader on a chip using the Arduino as an ISP/breadboard method without a crystal. Will is be usable on my Uno running at 16mhz? Not sure if my question is clear?

So many questions?  :-[
Thanks for your time.

It's very reassuring to have a place like this. There is so much to learn........it's wonderful to have access to a forum like this. Full of knowledgeable folks, willing to help.  :)

bill2009

Quote
OK, so if I install the bootloader using the Arduino as an ISP/breadboard method. I should then be able to use any of these chips. Right?
How to I select what bootloader to install?

From what I can read the Atmega88 is not supported?
Is the Atmega48 supported?

One more "kinda" related question.
If i want to use the atmega chip outside the Uno board, but I want it to use it's internal clock. Do I need a special bootloader?

And if I install a bootloader on a chip using the Arduino as an ISP/breadboard method without a crystal. Will is be usable on my Uno running at 16mhz? Not sure if my question is clear?


google "todbot blog" and look for a good post on building standalone arduino clones with atmega8's and where to get bootloaders.

I believe you can use the arduino environment to program for the atmegas you mentioned as well.  If you have a programmer to burn the bootloader you might consider using it to burn your sketch and forget about the loader alltogether.

using the internal oscillator rather than the external crystal is set with fuses on the chip.  Once you've set the fuses correctly you could, conceivably, still use the chip in your uno - you'd need a custom boards.txt entry - see the todbot blog.  This doesn't affect any other chips that you might plug in.

I have spent a lot of time fooling with attiny's, as have others here.  The more I play with other chips, the more i respect the original decision to use the atmega8.  It was a real sweetspot for capability vs size and it's grown nicely with the 168/328.  What i mean by that is: consider sticking with the full-size processor for ease of use unless you need an awful lot of them.

retrolefty

Look at the boards menu on the Arduino IDE, these are the only processor/bootloader/speed options available for an unmodified Arduino IDE. You may burn the bootloader using any of the five devices listed in the burn bootloader menu.

If other AVR processors are desired or bootloaders you will have to venture into the land of command line AVRDUDE program, that can burn most any ATmel processor and use any bootloader hex file you are able to locate or write yourself, and can use a ton of different hardware programers.

Once done, you will have to have the needed modifyed files for the Arduino IDE if you wish to utilize your new chip/bootloader/speed combination with the standard IDE platform, or utilize standalone tools/other IDE platforms.

It can get a little complex, but if you clearly state the end condition of what hardware and what tools you you wish to use, there is usually a path to that goal.

Lefty

alparent

#5
Jan 14, 2011, 04:11 am Last Edit: Jan 14, 2011, 04:12 am by alparent Reason: 1
Thanks for the replies.

OK, let me clearly state the end condition of what hardware and what tools I wish to use, so you can guide me on the right path to my goal.

I have a Uno with a 328 chip. I've finished programming it. I want to take it out of the Uno and make a stand alone of it.

But my part supplier is out of 328's, but he as 88's in stock. My sketch is only 4k.

If he had 328's I would get those...... .60 cents more is not a big deal!
But he's out! Heck! Everybody's out!

As for the internal clock part. If it's simpler to keep it at 16mhz, I will (it's like .50 cents of part anyway) But my curious mind want's to know.

All I have is the Uno. So I was thinking of using it to put the bootloader on the 88 via a breadboard (with a crystal setup I guess, if it's simpler?)

Thanks again! Man learning is fun.  :)

bill2009

Ok, here's the todbot item on standalone arduinos with atmega8's.http://todbot.com/blog/2009/05/26/minimal-arduino-with-atmega8/ it covers the bootloader and crystal vs internal issue and may give you some help.

atmega88's are pin compatible with atmega8's but have some internal differences. per this http://www.atmel.com/dyn/resources/prod_documents/doc2553.pdf

westfw

Quote
atmega88's are pin compatible with atmega8's but have some internal differences. per this http://www.atmel.com/dyn/resources/prod_documents/doc2553.pdf

In theory, the 88 is the same as 168/328 (MORESO than the mega8), only with less memory.  In reality, the Arduino supports mega8 for historical reasons, but does not directly support the 88.

Mark S

I have support for a LOT of different vesions of the ATMEGA chip in my version of the libraries. Refer to

http://www.avr-developers.com/

bill2009

Quote
I have support for a LOT of different vesions of the ATMEGA chip in my version of the libraries. Refer to

http://www.avr-developers.com/


That's a great resource - thank you very much.  I found this in pins_attiny45.c - I guess this would hold for the '85 - right?

Code: [Select]



// ATMEL ATTINY45 / ARDUINO
//
//                  +-\/-+
// Ain0 (D 5) PB5  1|    |8  Vcc
// Ain3 (D 3) PB3  2|    |7  PB2 (D 2)  Ain1
// Ain2 (D 4) PB4  3|    |6  PB1 (D 1) pwm1
//            GND  4|    |5  PB0 (D 0) pwm0
//                  +----+



So I take it that we have 4 analog input pins, 6 digital I/O, 2 analog out (overlapping obviously).

How do you handle the timers and other internal differences?  Should most libraries work?  What about specifically software serial and servos?

alparent

#10
Jan 17, 2011, 07:42 pm Last Edit: Jan 17, 2011, 08:20 pm by alparent Reason: 1
I know your site Mark. I've been reading and re-reading it.
I'll be ordering some atmega48, 88 and 168 tonight.

I was hoping I could bug you for some clarifications?!

For some reason I can't scroll up and down your HUGE list of supported devices in the Arduino IDE. So I cleaned some out.

What I want to end up with is a simple list of devices I need.

My board = Uno
Devices I want to use (and load bootloaders on)  = Atmega 48v running at 10mhz, 88, 168 and 328.
Method = breadboard with crystal connected to Uno board.

From what I can read this should not be hard to do (with all the work you and others have already done)

All I need is a guiding hand to help me put it all together.

Thanks for your time guys!  :)


bill2009......where are you in Ottawa? I live in Gatineau, but I work at L'Esplanade Laurier (corner of Bank and Laurier)

bill2009

Quote
My board = Uno
Devices I want to use (and load bootloaders on)  = Atmega 48v running at 10mhz, 88, 168 and 328.

those are all in the list.  Note that the 48 won't support a bootloader.

Quote
Method = breadboard with crystal connected to Uno board.

I have fumbled around with using arduinos as programmers with variable success.  I eventually bought a programmer.

Once the bootloader is on are you going to plug these into the arduino to load a sketch then plug them into some other circuit to run in?

I'm a little leery of the 10mhz crystal, some of the arduino stuff is fine with oddball speeds, some of it insists on either 8mhz or 16mhz.  Also, if these are factory fresh chips they're likely set up to run on the internal oscillator so you could skip the crystal on your breadboard.

As you note, I'm geographically close (Orleans) and I don't mind helping physically.  You could mail me chips for programming or maybe a phonecall would help.  PM me if you want to follow up.

alparent

Thanks for the offer bill2009. I will keep it in mind in times of distress!

Don't worry, I won't become your new nightmare!!!
I'm just happy when I find people close to me with the same passions.

I think I'm just going to get some 88's for now and stick to 328 when they are back in stock.

westfw

Quote
Note that the 48 won't support a bootloader.

That's not QUITE true.  The 48 does not support a separate bootloader section, and the current bootloaders won't work on it, but it DOES have self-programmable flash, so it COULD support a bootloader of a sort...

Go Up