3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Arduino on all sorts of Atmels

Arduino on all sorts of Atmels
Hello,

this is my first instructable, so I hope someone can do anything good with it.

So, what exactly is this about?
Imagine: You are working on a project. You want to program in the Arduino language because of the simplicy. But you don't want to use a 28 pin monster. Or you need peripherals like CAN or similar what the normal Arduino supported MCUs don't have. So, what to do? Where are two alternatives:
1. Just don't use the Arduino language and use things like bits and ports what you can't understand.
2. Or continue reading this!


So, this instructable is going to show how to use the core files available from avr-developers.com. I'm also going to show you how to program the different MCUs and how to connect them to do so. At the end I'm going to give some ideas on what you can to with your new knowledge earned from this.


As a little side note I want to say something; I'm just 14 years old, so please, if something is not as good as if an 40 year old engineer had done it, have mercy, write a comment about it and I will try to fix it.

If you have any problems, feel free to post a comment or drop me an email (jan[at]dalheimer[dot]de). If you can't figure out what to use instead of the [at] and [dot], I don't want an email from you.

I just saw that some MCUs use the ArduinoISP as default and some use the USBtinyISP as default. To see how to change, see step 5.

I want to say a big thank you to Mark Sproul for the modified core files at avr-developers.com. THANK YOU!

So.... Let's get started!

IMPORTANT: I give no warranty in any way for anything in this instructable. Some names like Atmel, ATmega etc. belong to their owners. Also almost all pictures do NOT belong to me.
 
Remove these adsRemove these ads by Signing Up
 

Step 1A list of that Atmels can be programmed with this and that is needed

A list of that Atmels can be programmed with this and that is needed
«
  • atmega128.jpg
  • at90usb646.jpg
  • attiny45_2313.jpg
  • ArduinoUno.jpg
Now you know something about that this is about, but you wonder; what MCUs exact can I program using this instructable? First of all, only ATmegas, AT90s or ATtinys. Perhaps some day, PICs to. Or ARM. Or.. Or..
But for now, just MCUs from Atmel.

The frequency for each MCU can be found by choosing your MCU here, opening up the boards.txt file and then searching for your MCU. There will then stand yourBoard.bootloader.low_fuses=fuse and yourBoard.bootloader.high_fuses=fuse. Then copy the number that stands instead of fuse into the fields at the bottom of the page. Click "Apply Values" and then you can see what type and speed of crystal to use in the drop down menu further up on the page.

To find out that type of upload you should use, go to the AVR developers page and look that stands there.

So, here is a list of working MCUs, sorted by type and number:

Name:

== ATmega:

ATmega8
ATmega8u2
ATmega16
ATmega32
ATmega32u4
ATmega48
ATmega64
ATmega88P
ATmega128
ATmega128rfa1
ATmega165
ATmega165P
ATmega168
ATmega169
ATmega324P
ATmega328P
ATmega640
ATmega644
ATmega644P
ATmega645
ATmega1280
ATmega1281
ATmega1284P
ATmega2560
ATmega2561
ATmega3290P
ATmega8515
ATmega8535

== ATtiny:

ATtiny26
ATtiny45
ATtiny85
ATtiny2313

== Others:

AT90CAN128
AT90CAN32
AT90CAN64
AT90USB1286
AT90USB1287
AT90USB162
AT90USB646
AT90USB647


Now you know what MCUs you will be able to program with this. But what do you need?

1. An ISP programmer. This instructable will use an Arduino as ISP, but I will add a category on how you can use other ISP programmers at the end of the instructable.
2. An USB <-> Serial converter or an RS232 <-> UART converter (only needed for programming MCUs with bootloader).
3. An breadboard. You can also solder on a perfboard or a custom PCB, but that is up to you and will not be covered here.
4. An computer. (I think you have one, otherwise you couldn't read this :))
5. The Arduino program. It can be downloaded from here .
6. The core files available at avr-developers.com . See the next step for how to install it right.
7. The MCU to program.
8. Some really cool idea on that you want to do after reading this. (Optional, but recommend)

« Previous StepDownload PDFView All StepsNext Step »
49 comments
1-40 of 49next »
Apr 30, 2012. 8:53 PMHiggs Boson says:
I have been having a lot of trouble getting my computer to get any core files in the IDE. I have tried following this instructable and some others to add core files, but when I save the files to where the preference menu says my sketchbook is in, or even directly into the hardware folder in my arduino file nothing gets added. What could I be doing wrong?
Apr 6, 2012. 10:04 AMLord Fawful says:
Would it be possible to change the fuses so the chip can use the internal Oscillator?
Apr 6, 2012. 10:54 AMLord Fawful says:
what would i need to change?
Oct 27, 2011. 2:04 PMsarveshk says:
Another thing, I also tried to flash ATmega32. I chose Penguino Board from the list, as it uses ATmega32 mcu. But the pin mapping of this board is totally messed up. You can find it's pin mapping at http://wiki.icy.com.au/Documentation/PenguinoAVR/Arduino%20Compatibility

I wish to add another board for ATmega32 with std pin mapping as shown in this instructable. How can do that? Do I just have to add another board profile in "boards.txt" or do I also need to add a pin mapping file in the core folder?
Oct 27, 2011. 8:28 AMsarveshk says:
Please elaborate the pin outs. I am confused. Please make an PDF if possible for convinience.
Oct 27, 2011. 12:30 PMsarveshk says:
Nice! Keep it up buddy!

Well, I am not able to compile servo program for Atmega16. Do you know how to solve it? It gives me the following errors

..\arduino-0022\libraries\Servo\Servo.cpp: In function 'void initISR(timer16_Sequence_t)':

..\arduino-0022\libraries\Servo\Servo.cpp:159: error: 'TIFR1' was not declared in this scope

..\arduino-0022\libraries\Servo\Servo.cpp:160: error: 'TIMSK1' was not declared in this scope
Oct 17, 2011. 11:25 PMjekkerdieschmekkerdie says:
Hi There,

If an MCU doen´t appear in your list does that mean it won`'t work or that you haven´t tried yet?

I´d like to use a AT90PWM (which one exactly I'm not sure yet). you think that would work as the other AT90's?

Thanks in Advance
Oct 15, 2011. 2:25 AMfjohn says:
ader.file=ATmegaBOOT.hex
arduino_attiny2313.bootloader.unlock_bits=0x3F
arduino_attiny2313.bootloader.lock_bits=0x0F

arduino_attiny2313.build.mcu=attiny2313
arduino_attiny2313.build.f_cpu=8000000L
arduino_attiny2313.build.core=arduino

thats wat i got so now wat should i do ???? id idnt understand wat u wrote so help??
Oct 14, 2011. 4:53 AMfjohn says:
i need to upload code to the attiny 2313 frm the arduino!!
and one more thing
can we just use the normal coding we use for arduino (arduino ide code?)
Oct 14, 2011. 4:51 AMfjohn says:
hey i downloaded the software the avr developers and then these came
bootloader
cores
firmware
.DS_store
boards.txt
programmers.txt

after that wat should i do ????
Jul 28, 2011. 12:40 PMdustinandrews says:
Fantastic instructable. Two questions:

Do just the controllers with "USB" or "CAN" in the name have USB or CAN built in respectively?

What is CAN?
May 18, 2011. 8:34 AMespert92 says:
what would happen if I didn't connect CTS to ground?
May 19, 2011. 11:08 AMespert92 says:
I just programmed the bootloader for my atmega8 using the "Arduino NG or older w/ Atmega8". everything works fine until I upload the sketch. it says "avrdude: stk500_getsync(): not in sync: resp=0x30". help please? :P
May 19, 2011. 1:21 PMespert92 says:
I checked everything and everything seems to be okay. I used a generic usb-to-serial cable by the way. is that different from the ftdi cable?
May 23, 2011. 9:36 AMespert92 says:
http://students.iitk.ac.in/snt/roboclub/Circuits/RS-232-Level-Converter.bmp

is this a reliable design for a converter?
May 23, 2011. 10:43 AMespert92 says:
works like a charm. thanks. but I still need advice.

before your rs232-uart advice, my working setup was:
compile arduino programs into hex files using (https://linvinus.ru/dokuwiki/doku.php?id=robot:arduino_makefile)
upload using usbtinyisp

the advantage of my usbtinyisp setup and disadvantage of the serial connection was:
no need to press reset button, and program runs right after programming,( unlike for the serial connection, program runs around 8 seconds after hitting reset, and reset needs to pressed before uploading

the advantage of the serial/official method, which is the disadvantage of the usbtinyisp/makefile method is:
all library files are used in compiling using the original IDE. unlike for my makefile which doesn't include certain libraries. also the original IDE works as planned in both linux and windows

so. is there anything I can do for the resetting dilemma? or the library dilemma?
May 23, 2011. 11:15 AMespert92 says:
amazing. I just edited the boards.txt file to use usbtinyisp intead. thanks 02JanDal. nice work
May 23, 2011. 10:50 AMespert92 says:
I heard that pin4 of the rs232 is auto-reset, is that correct? so my only problem now is how to remove the ~8 second waiting time for the program to run. do you have an idea on how to remove this wait time?
May 23, 2011. 9:25 AMespert92 says:
can you post a larger picture :p
Mar 20, 2011. 5:46 AMthemroc says:
This is a great Instructable and I´ll give you 5 Stars, when you´ll edit it in a few steps.

Please be careful taking images from other sources (Atmel-Logo etc.) I don´t know the law for sure, but I think they are not free too use).

You are a really smart boy, but consider the reader is not as smart as you. Some steps need a little bit more Explanation. Try to explain Step by Step in an example (ATtiny2313 or other).

themroc
Mar 20, 2011. 6:52 AMthemroc says:
Look at your Step 5. You wrote about finding the MCU in boards.txt. I guess you mean finding the MCU and then changing the programmer-option for the apropriate programmer (for Example AVRISP etc.) ? Please do an example.

If you have the permission for the images ok.

Sorry in my version of this instructable the yellow fields in Step 6 only show the pins not the MCU.

If you need a Attiny2313, I´ll send you two (under 20g).

Themroc
Mar 20, 2011. 7:50 AMthemroc says:
If your Instructable really works (and I think it will) see this as a kind of fee for your efforts. I´ll contact you per e-mail.

I didn´t find another source about that issue in the web and the avr-developers site is great, but the explanation is worse (it is not for beginners).

On what kind of AVR did you try it?

1-40 of 49next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
9
Followers
2
Author:02JanDal
I'm only 14 years old, so don't expect my instructables to be as good as if a 30 year old engineer had done them. I like to do things my self and see what's inside things. I really like Arduino and AV...
more »