Go Down

Topic: Uploading sketch to pro mini using mega2560 (Read 597 times) previous topic - next topic

bigone5500

My understanding is that you have had two separate problems so far:
  • Trying to use the Upload command to upload via an ISP programmer.
  • Trying to do a serial upload after you erased the bootloader via Upload Using Programmer.


There has not been anything done that would change either of those issues in all the years I've worked with Arduino.

The easiest way to work with the Pro Mini is to buy a USB to TTL serial adapter board or cable that plugs right into the 1x6 header that's along one of the short edges of the Pro Mini. The Pro Mini comes with the bootloader installed so you can just plug in the adapter and hit Upload. You can buy the USB to TTL serial adapter boards on eBay for $1.28 USD w/ free shipping from China. They're also a really useful tool to have on hand. It's well worth spending $1.28 to save all the hassle and wasted time of trying to use an Arduino as ISP or a jerry rigged Uno to upload. I like these ones:
https://www.ebay.com/itm/382715233411

So I went on ebay and bought the module you posted. I have a couple of those already but none with the ftdi chip. The two I have use the CH340G and probably clone Prolific chips. They do not work for me. I can't figure out why but I think the drivers are for genuine chips and not clone chips.

Anyway I ordered the one you posted and another with the FTDI chip that ships a bit faster.

I will wait for them to arrive and try them out. I'll post back with my results.

Thanks.

Juraj

So I went on ebay and bought the module you posted. I have a couple of those already but none with the ftdi chip. The two I have use the CH340G and probably clone Prolific chips. They do not work for me. I can't figure out why but I think the drivers are for genuine chips and not clone chips.

Anyway I ordered the one you posted and another with the FTDI chip that ships a bit faster.

I will wait for them to arrive and try them out. I'll post back with my results.

Thanks.
do you reset the mini right before upload to activate the bootloader?

pert

I have a couple of those already but none with the ftdi chip. The two I have use the CH340G and probably clone Prolific chips. They do not work for me.
The CH340 are good too. I haven't used the Prolific chips as much, but they should do the trick. The biggest problem you'll find with these USB to TTL serial adapter boards is that many of them don't use the standard "FTDI header" pinout:
  • DTR or RTS
  • RX
  • TX
  • 5V
  • CTS
  • GND

You need that pinout in order to be able to plug the adapter right in to the Pro Mini. Sure, you can use some jumper wires to adapt a non-standard adapter pinout, but that's a hassle and introduces the opportunity for miswiring.

Worse, some of the adapter boards don't even break out the DTR or RTS pin, which is needed for the auto-reset during uploads. You can always manually reset the Pro Mini at just the right time, but who wants to do that when you can pay a few cents for for an adapter that does it automatically?

There are adapter boards with chips other than the FTDI FT232 which have the correct pinout, and those will work just as well. They take a bit more searching on eBay to find and the price is about the same, so I default to the FT232 boards.

I think the drivers are for genuine chips and not clone chips.
The truth is that the $1.28 FT232 boards have counterfeit chips. That was a problem some years ago when FTDI released a version of their Windows driver that "bricked" the counterfeits (actually you could revive them with a bit of effort), but there was a lot of negative reaction to that so FTDI soon released a new driver version that doesn't brick the counterfeits. So I don't think you'll have any problems caused by the counterfeit FT232. I've been using these for years with no problems.

I haven't heard anything about clone or counterfeit CH340. I think that chip would not be an attractive target, since the original ones are already so cheap.

I have heard that there was an issue with driver support for either the counterfeit PL2303 or CP2102 (I can't remember which one).

bigone5500

do you reset the mini right before upload to activate the bootloader?
Yes, I have tried the reset trick but I can't seem to get it right. I have also read that you need to use the DTR pin somehow but I don't really know. I have tried a few ways to connect it to my serial adapter but nothing. I pressed the pins of the adapter into a mini breadboard and pushed jumper wires through the holes in the pro mini into the opposite side of the breadboard. I then jumpered to the adapter and played around with it a while. I got frustrated so I quit for a while to think about it. I have since ordered a couple different adapters with the FTDI chips and when they arrive I'll try it out then. The first one should be here monday.

I'll post back with my results.

Thanks for all the help!

pert

If you connect the DTR pin from the USB to TTL serial adapter to the pin marked "GRN" on the Pro Mini, it will be automatically reset at the right time in the upload.

If you can't make this connection, then you need to watch the black console window and press the reset button as soon as you see the lines like:
Code: [Select]
Sketch uses 2944 bytes (9%) of program storage space. Maximum is 30720 bytes.
Global variables use 271 bytes (13%) of dynamic memory, leaving 1777 bytes for local variables. Maximum is 2048 bytes.

The confusing thing is that you might think you should press reset as soon as you click the "Upload" button. However, the Arduino IDE compiles the sketch before starting the upload. The bootloader only runs for a short time before timing out, so if you press the reset button too soon, then it may have already exited the bootloader before the upload process starts.

bigone5500

#20
Mar 29, 2019, 10:45 pm Last Edit: Mar 29, 2019, 10:49 pm by bigone5500
I got one of my adapters in the mail today. I connected it to the board I have been working with. I could not get it to work so I got a different pro mini. The pinout is a bit different on it but I connected it with jumpers as I have before and could not get it to work. I stopped and thought about it a bit and realized the new one has the same pinout as the adapter board. So I simply inserted the pins of the adapter in the pro mini and pressed upload. It worked. So I jumped online and loaded my aerator sketch and the online IDE worked like a charm. I don't know what I am doing wrong but I'm glad it works now.

I now have the tiny size board I wanted and can install it into a small project enclosure and implement it into my boat.

Thank you to all who have helped me with this.

Here is a photo of the two boards I worked with. The one on the left is the one I can't get to work. The new adapter is at the top.

https://photos.app.goo.gl/2enJUHJwSzi6HRiv8

pert

Wow, I've never seen a Pro Mini that uses a pinout other than the standard FTDI header. That's quite unfortunate. Maybe it was made to match the non-standard pinout of a USB to TTL serial adapter board sold by that company. I don't know why people wouldn't just use the well established standard that always exists, but that seems to be the way of things.

Anyway, I'm really glad to hear that you were able to "plug and play" with one of your boards at least.

If you had your connections all correct with the jumper wires when it wasn't working, you might check the continuity of the jumper wires. Sometimes the wires inside get broken (or come pre-broken). That can be quite confusing.

So I simply inserted the pins of the adapter in the pro mini and pressed upload. It worked.
Be aware that just poking the male pins on the adapter into the holes on the board doesn't provide a very reliable connection. You can make it work long enough for an upload if you press the adapter down at an angle to make sure all pins have contact, but I wouldn't want to go through that when using it for longer periods of time while printing debug output. The best thing to do is to solder a 1x6 female header on to the board, which the adapter will plug right in to. If you only have longer female headers on hand, you can cut them down to size with some wire cutters. I usually just buy the 1x40 headers and cut them to the size I need because it's a bit cheaper and more versatile that way. You do lose one pin at the cut, but that's no big deal.

Go Up