Pages: [1]   Go Down
Author Topic: Making My Own Board With Atmega2560 from Scratch  (Read 1494 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I am trying to fab my own PCB to make and arduino with an Atmega2560 chip.  Would anyone be so kind as to tell me what I need? I am planning to start with a blank TQFP atmega2560, so I know for starters I will need to put the arduino bootloader on it. I have looked all over the internet and some people say that it can be done with another arduino (that's what it looks like here http://www.gammon.com.au/forum/?id=11635) and some say I need the AVR ISP II programmer. Can someone tell me if I need to buy the programmer?

Then, when I solder the chip to my board (which will have traces to all the pins), I assume it is as simple as lining up all of the ISCP pins, (MISO-MOSI etc.), is this correct? Do I need to put in ICSP headers or can I just connect my programmer to the PCB traces?

Then, I can open the arduino IDE and select my programmer and click burn bootloader?

Also, can anyone tell me if I need any extra components more than what I needed to make my own Arduino using the atmega328p (following this tutuorial http://arduino.cc/en/Main/Standalone), and if it is totally necessary to use icsp headers?


Ideally the finished product would look like an arduino mega board but with headers where I want them, etc.

Thank you for your time.
Logged

Show Your Work
Offline Offline
Edison Member
*
Karma: 14
Posts: 1098
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think the best advice, hardware wise, is to clone the Mega 2560 R3 schematic but make whatever changes you require (you mention repositioning headers, etc.)

http://arduino.cc/en/uploads/Main/arduino-mega2560-schematic.pdf

You don't need the programmer if you don't want, you can use an Arduino and a special sketch to make it act as an AVR ISP programmer.  You hook it up to the target's ISP pins and away it goes.

http://arduino.cc/en/Tutorial/ArduinoISP
Logged

I have only come here seeking knowledge. Things they would not teach me of in college.

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

Thank you very much for your reply. I read that tutorial, and it looks great, but on the forum I found this thread, http://arduino.cc/forum/index.php/topic,49481.0.html

On the fourth or fifth post it says "It's definitely possible that the ArduinoISP sketch has troubles programming the Mega 2560.  The chip with more than 128 KB memory have slightly different behavior in certain respects because you can't fit memory addresses in 16 bits any more (they're word addresses, so 2^16 = 65536 is 128 KB)."

The OP then says he got an "Olimex AVR 500 and it is uploading correctly, probably because it is talking stk500v2."

This makes it sound like I do need one of these nice (spendy) avr programmers, do you think this is correct?

Nick Gammon has listed something that looks similar to the arduinoisp for the atmega2560, but I am not sure if I need a programmer at some point or not, advice would be appreciated.  http://www.gammon.com.au/forum/?id=11635

I am assuming that I can use wires to the pins instead of using icsp pins (as I Plan on making my own board, I am not sure I will have icsp headers at all and am wondering if I can just go directly to the affiliated pins)

Also, thank you for the schematic copy suggestion. If I do this, would I just select the arduino mega 2560 board (even though it will be on my own board)?

Logged

Peoples Republic of Cantabrigia
Offline Offline
God Member
*****
Karma: 6
Posts: 722
Arduino happiness
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No you don't need a very expensive programmer, you just need the right one. For example, the AVR ISP MKII programmer works just fine and costs about $30. Some of the programmers on e-bay retail for less than that and work also. You may want to search around here for posting from folk like crossroads re: the e-bay programmers they have used.

[corrected to reflect Crossroads post further down, apologies!]
« Last Edit: April 09, 2013, 01:23:32 pm by Constantin » Logged

Show Your Work
Offline Offline
Edison Member
*
Karma: 14
Posts: 1098
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also, thank you for the schematic copy suggestion. If I do this, would I just select the arduino mega 2560 board (even though it will be on my own board)?

Yes, absolutely.  You will be just like the Chinese clone-makers at that point.  If you have the same hardware and bootloader it's the same, assuming you got everthing right.  I agree on the AVR ISP MKII, that supports all of the tiny and mega chips and while it isn't as full featured at debugging as the higher end programmers, it programs everthing that can be programmed via ISP fine.

I'm surprised nobody has updated the Arduino As An ISP Programmer sketch that so it can write to the 2560s too.  The physical interface is the same, but there must be some difference in the way the data is supplied.

I am assuming that I can use wires to the pins instead of using icsp pins (as I Plan on making my own board, I am not sure I will have icsp headers at all and am wondering if I can just go directly to the affiliated pins)

I am not sure I can visualize this.  If you are making a board how do you get to those pins on the uC without a header or something like it.  Are you planning on test points on the board you can just temporarily solder the wires to?  The fact is you need to bring 6 wires from the programmer to the target board and any way you can get there that keeps those wires relatively short is fine.  If there is a problem with higher speeds because of interference or something just lower the speed until it works.  I have put a 6 pin header on every board I have made so far except for the ones that have required JTAG (10 pins).
« Last Edit: April 09, 2013, 11:50:34 am by JoeN » Logged

I have only come here seeking knowledge. Things they would not teach me of in college.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27114
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

I don't buy stuff from e-bay in general. No patience for 3 week delivery from China.
My preferred sources (in no particular order) are Mouser.com (best prices on Atmega chips, and also where I got my Atmel AVR ISP MKii), Digikey.com, Avnet.com (for TPIC6B595s), Dipmicro.com, Taydaelectronics.com, Pololu.com, Phoenixent.com, sparkfun.com, mdfly.com, gravitech.us, nkcelectronics.com, and for PCBs, iteadstudio.com, internationalcirciuts.com.
I will occasionally get a part elsewhere, or samples from a manufacturer.

If I didn't have a dedicated programmer (MKii)
(and several others that I stopped using (also Not from e-bay) when I ran into issues with 1284Ps and got a MKii, altho the issue was likely serial speed mismatch between bootloader and IDE boards.txt file)
I would be using Nick Gammon's Ardiuno as standalone bootload programmer (and westfw's version before that).
« Last Edit: April 09, 2013, 12:06:19 pm by CrossRoads » 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.

Peoples Republic of Cantabrigia
Offline Offline
God Member
*****
Karma: 6
Posts: 722
Arduino happiness
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Apologies, Crossroads. I have corrected my post above. Thank you also for the long list of potential shops to source things from.
« Last Edit: April 09, 2013, 01:24:33 pm by Constantin » Logged

Show Your Work
Offline Offline
Edison Member
*
Karma: 14
Posts: 1098
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

On the subject of programmers.  When I wanted to program an Altera CPLD and saw what they want for their simple USB-Blaster programmer, I got the 100% compatible product that Terasic makes at a sixth the price ($50 vs $300).  And Terasic is a reputable firm which is stocked by distributors, not a fly-by-night eBay firm.  For Atmel, they make their programmers available at very reasonable prices.  The AVR ISP II has been a joy to use and it was all of $35.  I have a Dragon too which gives you high voltage programming and debugging and that was $50.  If you are doing Atmel programming I recommend either of those and I think the money is reasonable.



* USBBlasterPrices.png (14.51 KB, 910x160 - viewed 164 times.)
« Last Edit: April 09, 2013, 01:49:46 pm by JoeN » Logged

I have only come here seeking knowledge. Things they would not teach me of in college.

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

Thank you all for you help so far. To clarify the question "Are you planning on test points on the board you can just temporarily solder the wires to?"
What I was planning to do was to put jumper wires into my programmer and then temporarily insert them into the corresponding pin holes (sck, miso, mosi, gnd, vcc) then remove them once the device is programmed (which means once I have installed firmata).  Does this sound acceptable?  I am planing to eventually ad 6 headers to the icsp pins on my atmega2560 but I am trying to avoid that at first (because I want the pcb as flat as possible)



Crossroads "If I didn't have a dedicated programmer (MKii) ...I would be using Nick Gammon's Ardiuno as standalone bootload programmer"

Does this mean that I could use Nick Gammon's Arduino as a standalone bootload programmer with the 2560 (and its higher flash capacity). It looks like it, but I was hoping for confirmation as this means I wouldn't have to get the MKII at all. You think I can use his code and method to bootload a blank atmega2560 on my own board?
Logged

Show Your Work
Offline Offline
Edison Member
*
Karma: 14
Posts: 1098
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you all for you help so far. To clarify the question "Are you planning on test points on the board you can just temporarily solder the wires to?"
What I was planning to do was to put jumper wires into my programmer and then temporarily insert them into the corresponding pin holes (sck, miso, mosi, gnd, vcc) then remove them once the device is programmed (which means once I have installed firmata).  Does this sound acceptable?  I am planing to eventually ad 6 headers to the icsp pins on my atmega2560 but I am trying to avoid that at first (because I want the pcb as flat as possible)



Crossroads "If I didn't have a dedicated programmer (MKii) ...I would be using Nick Gammon's Ardiuno as standalone bootload programmer"

Does this mean that I could use Nick Gammon's Arduino as a standalone bootload programmer with the 2560 (and its higher flash capacity). It looks like it, but I was hoping for confirmation as this means I wouldn't have to get the MKII at all. You think I can use his code and method to bootload a blank atmega2560 on my own board?

OK, so you are going to expose the ISP pins on headers that are exposing all the pins and just use short jumpers between the programmer and the headers.  That's fine.  Worst case is you have to lower the ISP speed a little but no big deal I think.
Logged

I have only come here seeking knowledge. Things they would not teach me of in college.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27114
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

Yes, as JoeN says, if you can access the pins reliably, you can download the bootloader/sketch via the MKii or via Nick's programmer.
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.

Pages: [1]   Go Up
Jump to: