Arduino mega with pins on bottom and offboard programming controller

Hi, I am looking to use an Arduino mega in such a way that I want it to have its pins (not pin holes) sticking out the bottom so that it can socket into another, larger PCB. The other, more important thing I am looking for is one with an offboard program loader. Since, in my specific use case, the board itself is going to be in a rather tight area and having the ttl conversion happen on the host PCB, as apposed to the mega would be really helpful for space saving. Lastly, in my (admittedly specific) case, I need to be able to load programs onto the Arduino using either usb or rs232. Does anybody know of a way to do this, or maybe tweak the PCB of the mega somehow to support this?

If it would be too much of a hassle to remove the ttl converter from the board, is there at lease a way to load programs onto the chip using rs232. (optimally without a usb->rs232 converter), maybe with something like aa max232?

You can check out this board sold by our own forum member @CrossRoads:
http://www.crossroadsfencing.com/BobuinoRev17/#:~:text=new%20"mini"%20card%20types%2C%20mini%202560

ok, that looks pretty good. only a few questions,
1: would I be able to program it with rs232 using a max232 to one of ttl ports, or would i need to do the “reset button dance” that some people said I need to do to get ttl serial programming working.
2: would it be possible to get a footprint of the pins or something that I could put into some kind of pcb design software, since I want to make the larger host board have all the the pin holes to be able to socket this board without any soldering.
3: what is “dtr enable” and “ftdi header” that were mentioned in the listing for this board? (sorry I am a bit of an idiot)
4: since this one doesn’t have any kind of usb port baked in, is there still a way to send data to a usb port on a PC (maybe using some of the digital pins?
5: is there a documentation anywhere that would give a bit better pin labeling when working to design the host board in kicad or something?

(1) and (3)
The communication for an upload via serial requires 3 signals; obviously TX and RX but also DTR; this line connects to the reset pin of the micro (see original schematics for Uno and Mega) so the boot loader is activated when a serial connection is opened.

Note that factory 2560 processors don’t come with a boot loader; you’ll have to burn that via the SPI pins and a dedicated programmer (an other Arduino can be used for that) first; you can also directly load your program via the SPI pins (again, see the original schematics).
(4)
How were you planning to use the MAX232; sounded to me like that would provide the interface to the computer.

I am planning to use MAX232 as an interface to the PC (thank god for com headers still being on motherboards) however, I don’t see the dtr header on the max232, so I assume I would be wiring that pin directly from the rs232 port. However wouldn’t the dtr from the rs232 serial port be transmitting 12v, which would kill the board?

I want to use the max232 both for programming, a computer interface (for serial println output and stuff) as well as potentially for the computer sending commands to the device while the code is running.

as for not having the bootloader, I know. I am trying to get my parallel port programmer to work so i can do that but it is being really finicky, not sure if you could help with this

On my board, there are two dedicated headers, one for ICSP that is used to bootload the chip and set the fuses, or program it via Upload Using Programmer, that is the 2x3 gray cable in the picture
and the FTDI header, for connecting a USB/Serial adapter, that is the red adapter board in the picture, for serial downloads.

Serial downloads require the DTR connection on the serial port to reset the board and start the downloader.
If you connect a MAX232 kind of chip for RS232 to Serial, then you’ll have to play the reset button dance to make the reset happen at the right time if you are using the bootloader.

DTR Enable connects the DTR signal from the FTDI header. There may be times when you don’t want the PC resetting the board, so you would the DTR enable jumper off.

I could certainly send you the more info on the layout. As you can see, it is simply a 15 x 15 grid on 0.1" spacing.


This section of the attached file is one way to use the IO pins:

const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
	// PORTLIST		
	// -------------------------------------------		
	PE	, // PE 0 ** 0 ** USART0_RX	
	PE	, // PE 1 ** 1 ** USART0_TX	
	PE	, // PE 4 ** 2 ** PWM2	
	PE	, // PE 5 ** 3 ** PWM3	
	PG	, // PG 5 ** 4 ** PWM4	
	PE	, // PE 3 ** 5 ** PWM5	
	PH	, // PH 3 ** 6 ** PWM6	
	PH	, // PH 4 ** 7 ** PWM7	
	PH	, // PH 5 ** 8 ** PWM8	
	PH	, // PH 6 ** 9 ** PWM9	
	PB	, // PB 4 ** 10 ** PWM10	
	PB	, // PB 5 ** 11 ** PWM11	
	PB	, // PB 6 ** 12 ** PWM12	
	PB	, // PB 7 ** 13 ** PWM13	
	PJ	, // PJ 1 ** 14 ** USART3_TX	
	PJ	, // PJ 0 ** 15 ** USART3_RX
	PH	, // PH 1 ** 16 ** USART2_TX	
	PH	, // PH 0 ** 17 ** USART2_RX	
	PD	, // PD 3 ** 18 ** USART1_TX	
	PD	, // PD 2 ** 19 ** USART1_RX	
	PD	, // PD 1 ** 20 ** I2C_SDA	
	PD	, // PD 0 ** 21 ** I2C_SCL	
	PA	, // PA 0 ** 22 ** D22	
	PA	, // PA 1 ** 23 ** D23	
	PA	, // PA 2 ** 24 ** D24	
	PA	, // PA 3 ** 25 ** D25	
	PA	, // PA 4 ** 26 ** D26	
	PA	, // PA 5 ** 27 ** D27	
	PA	, // PA 6 ** 28 ** D28	
	PA	, // PA 7 ** 29 ** D29	
	PC	, // PC 7 ** 30 ** D30	
	PC	, // PC 6 ** 31 ** D31	
	PC	, // PC 5 ** 32 ** D32	
	PC	, // PC 4 ** 33 ** D33	
	PC	, // PC 3 ** 34 ** D34	
	PC	, // PC 2 ** 35 ** D35	
	PC	, // PC 1 ** 36 ** D36	
	PC	, // PC 0 ** 37 ** D37	
	PD	, // PD 7 ** 38 ** D38	
	PG	, // PG 2 ** 39 ** D39	
	PG	, // PG 1 ** 40 ** D40	
	PG	, // PG 0 ** 41 ** D41	
	PL	, // PL 7 ** 42 ** D42	
	PL	, // PL 6 ** 43 ** D43	
	PL	, // PL 5 ** 44 ** D44	
	PL	, // PL 4 ** 45 ** D45	
	PL	, // PL 3 ** 46 ** D46	
	PL	, // PL 2 ** 47 ** D47	
	PL	, // PL 1 ** 48 ** D48	
	PL	, // PL 0 ** 49 ** D49	
	PB	, // PB 3 ** 50 ** SPI_MISO	
	PB	, // PB 2 ** 51 ** SPI_MOSI	
	PB	, // PB 1 ** 52 ** SPI_SCK	
	PB	, // PB 0 ** 53 ** SPI_SS	
	PF	, // PF 0 ** 54 ** A0	
	PF	, // PF 1 ** 55 ** A1	
	PF	, // PF 2 ** 56 ** A2	
	PF	, // PF 3 ** 57 ** A3	
	PF	, // PF 4 ** 58 ** A4	
	PF	, // PF 5 ** 59 ** A5	
	PF	, // PF 6 ** 60 ** A6	
	PF	, // PF 7 ** 61 ** A7	
	PK	, // PK 0 ** 62 ** A8	
	PK	, // PK 1 ** 63 ** A9	
	PK	, // PK 2 ** 64 ** A10	
	PK	, // PK 3 ** 65 ** A11	
	PK	, // PK 4 ** 66 ** A12	
	PK	, // PK 5 ** 67 ** A13	
	PK	, // PK 6 ** 68 ** A14	
	PK	, // PK 7 ** 69 ** A15	
	PJ	, // PJ 2 ** 70 ** D70
	PJ	, // PJ 3 ** 71 ** D71
	PJ	, // PJ 4 ** 72 ** D72
	PJ	, // PJ 5 ** 73 ** D73
	PJ	, // PJ 6 ** 74 ** D74
	PJ	, // PJ 7 ** 75 ** D75
	PH	, // PH 2 ** 76 ** D76
	PH	, // PH 7 ** 77 ** D77
	PG	, // PG 3 ** 78 ** D78
	PG	, // PG 4 ** 79 ** D79
	PE	, // PE 2 ** 80 ** D80
	PE	, // PE 6 ** 81 ** D81
	PE	, // PE 7 ** 82 ** D82
	PD	, // PD 4 ** 83 ** D83
	PD	, // PD 5 ** 84 ** D84
	PD	, // PD 6 ** 85 ** D85

};

pins_arduino.h (13.0 KB)
Installing MegaCore to the IDE will also give you access to all pins.

I didn’t put D0 to D85 type numbers on the board so prevent any confusion as to what mapping was used, at the time nothing had been standardized for the extra pins.


This is probably easier to read

ok, thank you for the information. The DTR jumper sounds very useful, especially if I could wire it to a switch on the back of my device (that could also be connected to the dtr from the serial port) next to the serial port as like a “programming toggle” switch and just to confirm, all pins 0-49 can be used a simple digital IO pin

thanks for the spacing as well. Since it is uniformed I suppose, if I wanted to be really over the top I could make an AMD style socket with a retention arm lol.

Yes, all 86 IO can be used as simple digital IO.

ZIF socket, I suppose you could, first one I came across at Digikey is $84!
https://www.digikey.com/en/products/detail/aries-electronics/225-PRS15001-12/103005
I think I would go with socket strips like this.

Use 4 lengths of 15 pins, 4 lengths of 11 pins.
And then mating pins on the 2560 board.

I did the same here to mount a MegaProMini to a Mega Screw Terminal board

ok, that looks good, I assume those would be more durable than the pin holes found on normal boards, for example, the UNO connections. And when implementing this socket into the pcb design, I would just want a bunch of holes 2.54mm spacing in the above mentioned layout. How wide should each pin hole be though?

Sorry if any of these questions are basic, I am very much a noob to pcb design so I just want to be sure I get everything right.

I also would like to have a socket for the iscp and dtr enable header if possible, what would be the spacing of those relative to the rest of the board?

Here is the info on the placements of the thru holes

Part Value Package Library Position (inch) Orientation
ICSP 3x2M 2X03 SmartPrj (1.78220005 1.294) R270
JP1 M02PTH 1X02 SparkFun-Connectors (1.722 0.184) R270
JP2 M02PTH 1X02 SparkFun-Connectors (1.822 0.794) R90
U1 ATMEGA2560_DIP ATMEGA2560_DIP ATMEGA2560_DIP (1.642 1.642) R180
USB FTDI_BASICPTH FTDI_BASIC SparkFun-Connectors (1.822 0.584) R270

Numbers are relative to 0,0 at the lower left corner.
If you use 0.039" for hole diameters, they will accept 0.025" square posts.
Review the diameter of the socket pins you select and see what diameter they need. For example, for 0.02" diameter pin you might use a 0.025" or 0.03" hole.

ok, this is good thank you, do you have a kicad object footprint/object for the SIP socket/socket pins? because I couldn’t find ATMEGA2560_DIP in kicad objects or online, and I assume there is no kicad footprint for it

No, I created it in Eagle.
Does Kicad import Eagle Libraries?

from what I can tell, no, but there are some online tools that can supposedly convert eagle to kicad are there any universal libraries that would be just the single per pin SIP sockets?

If so, what sized pins do you recommend I have socketing into the socket (I was thinking 0.03" round pins?)

*I assume eagle is better and easier to work with, but I don’t think I could afford it

Any tool can be easy to work with, with enough practice. I’ve been using Eagle since late 2010, and had used other schematic capture only tools before that (futurenet back in the late 80s early 90s).

Pretty sure you can create your own symbols in Kicad. I don’t know it well, it seemed too toylike for me without the hard connection between electrical symbol and board footprint that Eagle enforces.
In Eagle, you start with the schematic, and the board file is created from there with the footprints for you to place and then route the schematic connections. Traces to be made are shown airwires that disappear as nets are connected, either with the autorouter, or manually.

well an autorouter does sound nice, especially since the pcb I am making will involve a 105 keyboard which I’m sure will be a joy to wire by hand… I see that kicad allows the creation of custom symbols. To make the symbol for just one of the SIP socket pins would I make a 0.1"box with a 0.025 hole in the middle?

In terms of pin size, what do you recommend for the board you have? (note that I will be soldering by hand, so pins that are nearly the same size as the holes in the board would be best)

Yes, 0.1" box with 0.025" hole for the machine sockets would be okay.
I think I these as pins in the board.
Larger side goes in the board, smaller side goes into the machine socket.

Ok, so the pins you just linked would go into the socket you linked a while ago then?

by larger side goes in the board, I assume you mean the ticker side, not the longer side, right?

would the sizing of 0.019" pins in 0.025" holes provide a certain amount of tension in the socket, so the board wouldn’t fall out if the host board were to be upside down or something?

and lastly, in relation to 0.024" pins that will be soldered to the board, how big are the holes in the board? since I don’t want some pins to be offset in the hole

Yes, the smaller diameter pins go into the sockets, the larger diameter pins go into the 2560 board.
The holes are sized to accept 0.025" square posts.
The larger round pins fit nicely, the smaller diameter plugs snugly into the machine sockets.
This picture shows the 3 types.


Well, you’ll have to trust me, I can’t get a clear picture.

Ok, I understand. Now I just have to get to designing the board, which will be quite a learning experience for me. I’m having a real hard time understanding footprints Vs symbols and the difference no between the PCB designer and circuit designer. I also have to figure out where and how to connect an SDL 6 port to run xt protocol as one of the board functions.

If you have any tips for designing the board or circuits surrounding this, please let me know:)

Ok, other programs may be different, here is how Eagle does it:
Each part that is used has a library (.lbr file) that captures what it is:
The electrical Symbol. That is the part you see on a schematic.
Here is one I made for a N-channel MOSFET


The circles are the pins that get connected to other symbols. Those connections are called nets. For example, all the VCC connections would be made and called the 5V net. If you ran a netlist report, the 5V net would list all the pins on all the devices that were connected to 5V.
Next is the Package, or Footprint, of the physical device. If you right click on a pad, you will see its properties: name, layer of the board it is on, size, etc. This is the part you see on the board layout.

Finally, there is the Device, this is what ties to Symbol pins to the Package pins.

A library may consist of several parts. I can not keep track of what inside different libraries, so I make each part its own library.
Now, when you start a schematic, you open the library for a part, select a part,


and the symbol gets added to the schematic, and the package gets added to the board. As connections are made in the schematic, airwires show up on the board that need to be routed.
Here is an example of 2 MOSFETs with some schematic connections; I routed one on the board, and left the other as an airwire.

I have tried working boards that were made in Kicad and needed changes. I finally gave up and redid them in Eagle because whoever created them in the first place did not understand the need to map the schematic to the board, so changes made on one did not show up in the other, so documenting what was done became impossible.

So before I retired as an Electrical Engineer, I would create the schematic, the Mechanical Engineers would create all the footprints, and a PCB engineer would tie them together and make all the connections on the board, which I would then review for completeness, bring up any routing concerns, like clock lines running too close to sensitive data lines or something.
Now, I do all three. Create the schematic, layout the parts, make all the connections, use the error checking tools to make sure there are no open connections, no traces overlapping, nothing too close to the edges of the board, any marking like names are correct, legible, and not going to overlap vias or other holes in the board, etc.

2 Likes