Can I use a 5v Arduino Uno as ISP to program 3.3v Pro Mini?

Discussion in 'Embedded Systems and Microcontrollers' started by Grum, May 7, 2018.

  1. Grum

    Thread Starter New Member

    Apr 30, 2018
    23
    0
    I have been able to do this previously with a 5v Pro Mini, by simply connecting pins 11-13 (MOSI, MISO, and SCLK), Vcc, and GND on the Uno to the same pins on the Pro Mini, and pin 10 on the Uno to Reset on the Pro Mini. After loading the 'Arduino as ISP' sketch to my Uno, I can then load my required sketch via the Uno to the Pro Mini. All good (most of the time...). I know there is also another method - based on removing the actual ATMEGA chip from the Uno, but that relies on you having a removable chip - which unfortunately, mine doesn't.

    The problem comes when the cheapskate author inadvertently buys a bunch of 3.3v Pro Minis in error - thinking "Wow, these are really cheap!!"
    I have read various contradicting reports about programming them, saying things like
    • the 3.3v Pro Mini doesn't mind having the data pins overdriven to 5v - and - the absolute max logic high voltage is Vcc + 0.5v (i.e. 3.8v)
    • the 3.3v Pro Mini can be programmed at 5v as long as the Vcc from the Arduino is not connected - and - the 3.3v Pro Mini needs the voltage regulator disconnected so that it can be programmed with 5v Vcc :eek:
    • the 3.3v Pro Mini must use logic level shifters for programming from 5v Uno - and - both 5v and 3.3v Pro Minis use the same chip so (as long as all 3.3v peripherals are disconnected) it makes no difference!
    It all seems very vague and confusing - then I've also heard of people 'doing the right thing' and buying voltage switchable FTDI programming boards, only to find the voltage switch was wired the wrong way by the manufacturer, and splurged 5v when 3.3v was selected, and releasing magic smoke!

    My understanding is that the 3.3v Pro Mini boards are designed simply to allow easier interfacing with 3.3v sensors and peripherals - the board itself is the same with the exception of the on board regulator, and oscillator/crystal. So it seems to me that the argument about both 5v and 3.3v Pro Minis using the same ATMEGA328P chip is valid - the only difference being that the operating voltage affects the clock speed (hence why 3.3v Pro Minis are only clocked at 8MHz). That being the case - my thinking is that to program the 3.3v version, I should be safe passing it 5v logic levels during programming, as long as the 5v Vcc from the Uno is connected to the RAW voltage input of the Pro Mini, rather than Vcc, and I select the 3.3v 8MHz board in the IDE. At least, that's my theory...

    I would be keen to hear from anyone else that has actual experience programming 3.3v Pro Minis - specifically using the 'Arduino as ISP' method, and has already worked through this issue.
    I don't have the time nor money to buy replacement 5v versions of the Pro Minis, nor do I really want to go down the route of having to purchase additional modules/cables etc., unless this mechanism is debunked as absolutely 100% unsuitable for use on 3.3v Pro Minis... These units will be programmed once, and then left to their own devices - so I really don't want to buy kit to program them that will be used once and then left in a drawer, if I can do it using a few dupont cables and an Uno.

    Thanks for any advice...
     
  2. shteii01

    AAC Fanatic!

    Feb 19, 2010
    4,436
    703
    5-3.3=1.7

    Assuming “generic” diode with Vf of 0.7. Then two diodes 0.7+0.7=1.4

    Just put two diodes on each line. That will drop 5-1.4=3.6 and you are below 3.8v.
     
  3. Grum

    Thread Starter New Member

    Apr 30, 2018
    23
    0
    Hi shteii01. Thanks for this suggestion - I have considered something similar using a couple of resistors on each line, acting as voltage dividers. However, I was worried that there may be two-way communication on those lines during the programming setup, and my resistor networks might affect the returned voltage - diodes would preclude this direction of data travel altogether.
    Is your suggestion based on actual experience of programming a 3.3v Pro Mini, or hypothetical based on knowledge of diodes one their voltage drops? Your solution certainly handles the voltage issue one way, but do you know for certain that the programming data traffic is all one way only? I don’t know for certain, but I am guessing that the MOSI/MISO pair are complimentary in their data flow directions?
    Cheers
    Grum
     
  4. dl324

    AAC Fanatic!

    Mar 30, 2015
    7,434
    1,759
    I'd recommend doing it the right way and use a level shifter.

    Since this image is from Sparkfun, I'll plug their product:
    upload_2018-5-7_13-37-51.png

    https://www.sparkfun.com/products/12009

    You can get them for about a tenth of Sparkfun's price if you shop around.
     
  5. shteii01

    AAC Fanatic!

    Feb 19, 2010
    4,436
    703
    U r right. My solution is one direction.

    I have seen a circuit to hook up 3.3v tft display to 5v uno. They just used a single resistor on each line to drop some voltage so that uno can talk to display. I don’t recall the value of the resistor. I will post a link to that setup so u can examine it for yourself. That is probably the simplest ways to do it. Like u noted. Anything up to 3.8v would be acceptable.

    If I recall correctly. There is a bidirectional circuit that uses common transistors that is floating around internetz. It is basically level shifter circuit built with discrete components instead of one ic.

    I have 3.3v pro mini boards that I need to assemble. I also bought programming boards for them. But I need the voltage selector changed from 5v to 3.3v on the programming boards (it is two pads on pcb connected by solder). So I am basically in the same boat as u. Only further behind.
     
    Grum likes this.
  6. Grum

    Thread Starter New Member

    Apr 30, 2018
    23
    0
    [QUOTE="You can get them for about a tenth of Sparkfun's price if you shop around.[/QUOTE]
    Thanks dl324. I do like the sound of that - I must admit that their price tag was putting me off. I will take another look around, but I fear that availability in the US may be a very different beast from Australia - we have very few local options, delivery from the US is ridiculously expensive, and delivery from cheap eBay sellers generally takes between 3 weeks and 2 months (longer if you then get a dud and have to go through the whole refund/replace scene). I’d love to do it the ‘right’ way, but only for the right price... like I said, this is a one-off project and whatever I use to do the programming is subsequently redundant.
     
  7. Grum

    Thread Starter New Member

    Apr 30, 2018
    23
    0
    Many thanks for the input - I will check out the option you suggested here. Good luck with your project too.
     
  8. dl324

    AAC Fanatic!

    Mar 30, 2015
    7,434
    1,759
    If you have logic level N channel MOSFETs you could build your own.

    I took a chance and bought mine from AliExpress. Free shipping, but takes about a month transit time.
     
  9. be80be

    AAC Fanatic!

    Jul 5, 2008
    1,696
    334
    Dear god the Pro Mini is a 5 volt chip running at 3.3 volts with a 8 mhz osc
    you just power the Pro Mini Vin pin and program it there is a diode to bock the 3.3 regulator
    just don't power the Pro mini from nothing else but the uno to your done.
    [​IMG]
     
    Last edited: May 7, 2018
    shteii01 and Grum like this.
  10. Grum

    Thread Starter New Member

    Apr 30, 2018
    23
    0
    Hmm - I briefly thought the home build option may not be out of the question - until I saw that those mosfets are in the region of $10 each here in Australia :—( I’ll keep looking at other suppliers and options. I will give AliExpress a look too. Thanks for the options.
     
  11. Grum

    Thread Starter New Member

    Apr 30, 2018
    23
    0
    Many thanks be80be - this was my thought process too - I am glad to hear someone is thinking the same way. Maybe we are all overthinking the problem trying to match voltages, or wanting to have the option to do the programming with all other circuitry still connected?
    I am happy to program the pro mini in isolation, so what you suggest fits my needs perfectly - many thanks.
     
  12. shteii01

    AAC Fanatic!

    Feb 19, 2010
    4,436
    703
    well. I figured out problem with that setup. When Uno talks to 3.3v tft, the 510 Ohm resistor drops some voltage to about 3.3v level. When 3.3v device (in this case tft) talks back to Uno, the 510 Ohm resistor will drop some voltage, the signal will be below 3.3v level and 5v Uno might not recognize the incoming signal as anything meaningful because incoming signal is below standard 2.7 or 2.8v for digital 1, so all Uno will see are digital 0s.
     
  13. Grum

    Thread Starter New Member

    Apr 30, 2018
    23
    0
    That was what I was thinking with my original voltage divider idea - works fine one-way... but it also works just as fine in the opposite direction - detrimentally :(
     
  14. Grum

    Thread Starter New Member

    Apr 30, 2018
    23
    0
    So far - I like be80be's answer the best :D, as it reflects exactly my conceptual understanding of the 3.3v Pro Mini.

    @be80be - are you suggesting I connect the Uno's 5v Vcc to the Pro Mini's Vcc, and drive it temporarily at 5v (except selecting 3.3v 8MHz as the target board in the IDE), or should I connect the Uno's 5v Vcc to the Pro Mini's RAW - thereby utilising the onboard 3.3v regulator to convert that to the lower Vcc? I guess the latter option is where I could start running into overvoltage issues given that statement about the maximum logic high voltage being measured relative to the chip's Vcc..?

    Am I correct in believing that the 3.3v operating voltage of these Pro Minis, is simply reducing the performance and logic high voltage of the 328P for interfacing to external 3.3v peripherals and their logic levels - and has nothing to do with anything on the Pro Mini board itself? If so - then by ignoring the RAW voltage input and 3.3v regulator, and connecting Vcc on the Pro Mini to a 5v supply, I would effectively have a Pro Mini 5v 8MHz hybrid combo (the worst of BOTH worlds - LOL) - is that the case?
     
  15. be80be

    AAC Fanatic!

    Jul 5, 2008
    1,696
    334
    You got it.
     
  16. Grum

    Thread Starter New Member

    Apr 30, 2018
    23
    0
    Eggselent! Thanks for confirming my few remaining brain cells are still functioning at some level that allows me to conceptualise
     
Loading...