Pages: [1]   Go Down
Author Topic: Arduino with ATmega48-20AU  (Read 868 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey

i wanna know how i can use a ATmega48-20AU as arduino.

It has just 4kb flash but i dont wanna run big skrips on it.

I wanted to controll it with an other arduino with i²C.

Can I use the Arduino Bootloader on this little thing ?


* IMAG0915.jpg (1314.6 KB, 3264x1840 - viewed 24 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you want to program the ATmega48-20AU using an arduino board like Arduino Uno or you have means to program the ATmega48 and you are just looking for information about how to interface an Arduino Uno with an Atmega48, to make them talk on I2C?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have 3 ATmega48-20AU and an Arduino UNO.

Now i wanna controll the ATmega48-20AU with my Arduino, with the Wire include.

Upload a little script on the ATmega48-20AU and controll it then...


sorry for my bad english i'm a german smiley-wink



* IMAG0919.jpg (641.46 KB, 3264x1840 - viewed 19 times.)
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23607
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Save a copy of your boards.txt and avrdude.conf.
Put these in their place.
Select Uno48 as the board type, I think it will get you there.
I updated the files from those found in IDE 1.0.2, should be close.
Not 100% sure I have max size correct, may be set too low, that may need some adjusting depending on the bootloader.

Haven't tried it with actual device, only checking that it would compile.
My sketch was way too big, you can be the tester for a small sketch.

http://www.atmel.com/Images/2545s.pdf

* boards.txt (20.64 KB - downloaded 17 times.)
* avrdude.conf (584.66 KB - downloaded 9 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Full Member
***
Karma: 0
Posts: 109
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Another way to program an Atmega48 using Arduino Uno is to follow this help page. No bootloader is needed. You can save space.
The instructions are for programming an Atmega328p but they can easily be adapted to Atmega48 since the two microcontrollers share the same pin configuration.
Also do not forget to change the option -p m328p to -p m48.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23607
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow, that''s a lot of steps.

If bootloader is not needed, upload the sketch with the File:Upload Using Programmer command.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino 1.0.1->File-> Upload using programmer is a command I do not fully understand.

Let's say I have 4 different AVR controllers: Attiny84, Attiny85, Attiny13, Atmega48 that I want to program using an Arduino Uno as ISP programmer.

I connect Arduino Uno SS, MOSI, MISO, SCK to the target controller pins RESET, MOSI, MISO, SCK, respectively and press Upload using programmer.
Where does this command know which of the four AVR is my target microcontroller on the breadboard? Is it able to automatically detect the AVR?
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23607
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Before  you upload to a chip/board, you have to select
Tools:Board and click the part you are using.
Then select
Tools:Programmer and click your programmer.

After that:
I generally do Tools:  Burn Bootloader to set the fuses correctly with a brand new part.
Then File: Upload Using Programmer to wipe out the bootloader and load the sketch for immediate start after a reset.

I've not had luck using avrdude commands to do all that manually, other folks have.

The IDE does not support these chips
Attiny84, Attiny85, Attiny13, Atmega48
I have been experimenting to add them in.
I think the files I attached above will to do the '48/48A/48V & 48P/48PA/48PV,
but I don't know for sure as I don't have chips.

I'll see if the Attiny parts can be added in a similar manner.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks for the reply.


But i'm new here ...


So i must connect my ATmega48-20AU with my arduino with follow pins:

Arduino UnoATmega48-20AU
SS(Pin10)Reset(Pin29)
MISO(pin11)MISO(Pin16)
MOSI(Pin12)MOSI(Pin15)
SCK(pin13)SCK(pin17)


now i just need the 20 MHz Crystal and two 22pF Capacitors.
Logged

Pages: [1]   Go Up
Jump to: