I recently bought three boards that claimed to be Nanos. They would not connect to the IDE when I selected Nano as the board type. I am able to use them when I select “Atmel ATMega328p xplained mini”. I am able to download sketches to the board now and they do work. The problem is the pin out of the two boards are different. The “Nano” pins are labeled with the correct labels for a real Nano so I believe I can just download a Arduino boot loader and it will act like one.
My question is I would like to use the Optiboot bootloader to have access to the extra flash memory but I am concerned about whether I will be able to use the two extra A/D pins that are available on the Nano if the sketches compile to the Uno architecture.
These boards use the CH340 chip instead of the standard FTDI chip the Nano uses but it is my understanding that they will still work correctly.
I have just started using my Uno as a training platform for my granddaughter but I have considerable experience with other microcontrollers and microprocessors. I am quite excited to be learning some new things myself along the way.
Thank you in advance for any advice. Also if you can warn of any pitfalls I may encounter that would be greatly appreciated.
You will be able to use the A6 and A7 pins with UNO selected in the Arduino IDE. Note that these pins are only usable for analog input, there is no hardware on the chip to use as digital input/output.
The current ("new") Nano bootloader is the exact same bootloader file used on the UNO, but the fuses are set to allocate 2048 bytes of flash memory. The "old bootloader" used on the Nano actually needed the larger memory allocation, and it was not changed when the bootloader was updated.
Above is the link to what I bought. I also got the info about setting it up as an xplained board from one of the reviews.
Not sure about the CH340 driver but I am guessing I have it since the board connects with the current bootloader. Unless it will make a difference when I burn them to Arduino bootloader. Using Windows 10 on my PC.
As far as the extra memory I doubt it will ever matter with the types of projects I do, and the extra speed of downloading and running will not really be a great advantage at this time so I could just use the new bootloader for the Nano.
I intend to use my Uno in Arduino as ISP mode to burn the bootloader. I have watched several YouTube videos on burning bootloaders to various boards and chips. Some mention using a ten microfarad cap on the reset pin of the programmer Uno while burning the target. Some don’t. I am going with using it unless someone can say not to.
Thanks for the info, David. I haven’t gotten into the data sheet to any extent yet but I do know some of the analog pins can be used as digital I/O. I also doubt I will need all the analog inputs but you never know.
This makes no sense to me. You should be able to see the Nano on a USB port, and then be able to load with one of the two processor selections for the ATmega 328P.
If optiboot is already loaded as the bootloader, you could also make the board selection a UNO and download as that device.
The reviewer said that they had to select the xplained as the board type in the IDE. That also works for me. I just want to use the Nano bootloader so that other Nano software will run correctly. For example the “Blink” sketch downloaded and ran but the LED on my boards does not blink because the LED on the xplained board is wired to a different pin than the one on the Nano.
The thing I wonder about is why they didn’t just put the Nano bootloader on or leave it blank. Who knows maybe they had a pile of chips that were already loaded with the xplained loader.
Here is the review I am referencing.
Surprisingly works as described. To get it working simply set the board to "Atmel atmega328p Xplained mini" on Arduino IDE. Don't need to download anything externally. It worked fine with baud rate set to 4800. Used it to power a servo.
I have to admit that I also had trouble with a bad USB cable when I first tried connecting. So by the time I got that sorted out I may not have tried connecting it as a Nano. I might even have success if I change the baud rate to 4800. I obviously have a few things to try now.
The bootloader is not relevant for the use of pins A6 and A7. The boards package however is. Can you tell us which additional board url you have added to get the xplained-mini.
I'm a bit surprised that is works; the (official) xplained-mini uses an integrated debugging chip which is not a CH340.
Can you please enable both show verbose output during compilation and verbose output during upload under file → preferences, perform an upload fr the xplained-mini and provide the full output here (using code tags,please).
By "would not connect", do you mean the uploads failed? If so, the reason is that you didn't select "ATmega328P (Old Bootloader)" from the Tools > Processor menu when you had the "Arduino Nano" board selected from the Tools > Board menu.
The "Atmel atmega328p Xplained mini" board definition just happens to use the 57600 baud rate for uploading that is required by the bootloader that came on your Nano boards. You will get that same upload baud rate by selecting the "ATmega328P (Old Bootloader)" option with the Nano board definition.
Sterretje, I didn’t have to add a URL to my preferences. I just searched for “xplained” in the boards list. The IDE did however download something because a quick message flashed on the screen to that effect when I selected the board.
I think that is reasonable. Even though it can be nice to regain that extra 1.5 kB of flash memory by switching to the Optiboot bootloader with the 0.5 kB boot section, the bootloader the boards shipped with should be perfectly fine for the purposes of getting your granddaughter started in the wonderful world of embedded systems.
If you end up needing that extra flash later on down the line we'll be happy to provide assistance for flashing the boards with the Optiboot bootloader.
The only concern is that when you compile or upload with Tools > Board > Arduino AVR Boards > Arduino Uno selected in Arduino IDE, the NUM_ANALOG_INPUTS macro is set to 6:
but this macro is only used by a few libraries that you might never use so it is likely this incongruity wouldn't even impact you.
If that macro value does impact you, there is an excellent 3rd party board platform MiniCore that provides Optiboot with the correct 0.5 kB boot section size configuration and the appropriate NUM_ANALOG_INPUTS value. But I wouldn't recommend adding in the extra complexity of using a 3rd party boards platform while your granddaughter is just getting started with Arduino.
Thank you for the added input. I should add that this is also an educational process for myself as well. I have been entranced with using microprocessors ever since I took a course based on the Heathkit Motorola 6808 microprocessor trainer. Other than that course and several training courses on specific PLC’s and DCS’s all of my learning on programming has been self taught.
I have done a lot of assembly programming and spent several weeks learning “C”. I started learning BASIC on a TI99. (Yes, I am that old). I feel challenged by all the learning opportunities presented by Arduino. And you have just introduced another; Learning how to configure the IDE to do what I want it to do.