Arduino nano bootloader

So I got a couple of Arduino nano boards. One comes with SL CP2102 TTL USB adapter, the other with PL21XX (no win 8 driver). I was checking out what boot loader might be on this board. Under the Arduino IDE menu I chose Arduino nano with ATMEGA328 and was able to upload blink. I then opened boards.txt to see what the difference between uno and nano:

uno.name=Arduino Uno uno.upload.protocol=arduino uno.upload.maximum_size=32256 uno.upload.speed=115200 uno.bootloader.low_fuses=0xff uno.bootloader.high_fuses=0xde uno.bootloader.extended_fuses=0x05 uno.bootloader.path=optiboot uno.bootloader.file=optiboot_atmega328.hex uno.bootloader.unlock_bits=0x3F uno.bootloader.lock_bits=0x0F uno.build.mcu=atmega328p uno.build.f_cpu=16000000L uno.build.core=arduino uno.build.variant=standard

nano328.name=Arduino Nano w/ ATmega328

nano328.upload.protocol=arduino nano328.upload.maximum_size=30720 nano328.upload.speed=57600

nano328.bootloader.low_fuses=0xFF nano328.bootloader.high_fuses=0xDA nano328.bootloader.extended_fuses=0x05 nano328.bootloader.path=atmega nano328.bootloader.file=ATmegaBOOT_168_atmega328.hex nano328.bootloader.unlock_bits=0x3F nano328.bootloader.lock_bits=0x0F

nano328.build.mcu=atmega328p nano328.build.f_cpu=16000000L nano328.build.core=arduino nano328.build.variant=eightanaloginputs

So the nano is not using optiboot, wasting 1.5KB of FLASH and uploads more slowly. I was prototyping a small board with the ATMEGA328P-AU that is also used on nano. I loaded my board with optiboot and didn't experience a problem so far.

So can I conclude that I can simply load optiboot to my nano, and create a new board entry to mimic UNO except that I use eightanaloginputs variant. Will it work? Thanks.

Sure it will work. And if you don't care about the two extra analog pins you can just call it a uno board and it will run fine.

One comes with SL CP2102 TTL USB adapter, the other with PL21XX (no win 8 driver).

So; clones...

I was checking out what boot loader might be on this board.

One of the "errors" that has shown up relatively frequently in clones is that they don't have the "correct" bootloader. So nanos show up with optiboot, for example. If it has optiboot, you should be able to upload to it as if it were an Uno. If it actually has the old bootloader, you should be able to upload using the "Arduino Nano with m328" board entry. (You don't HAVE to have access to the extra analog pins.)

Great thanks! I do need both A6 and A7.I'll load with optiboot and make a new board name :)

Another question: I was just testing the A6 and A7. Maybe I'm wrong but the voltage I got only makes sense if there is an internal pullup around 40Kohm. So how do I disable their internal pullup? digitalWrite(A6,LOW); ? That doesn't seem to work.

Sorry, I miscalculated.

1.1.9 ADC7:6 (TQFP and QFN/MLF Package Only) In the TQFP and QFN/MLF package, ADC7:6 serve as analog inputs to the A/D converter. These pins are powered from the analog supply and serve as 10-bit ADC channels.

So these two pins have no internal pullup, right? Good thing my design doesn't rely on internal pullup.

They shouldn't have an "internal pullup." A-D converters sometimes have a defined input impedance that can interfere with accurate voltage measurements of "weak" sensors, but I think the AVRs are pretty high-impedance. (some PICs are down around 10k, IIRC.)

liudr: Great thanks! I do need both A6 and A7.I'll load with optiboot and make a new board name :)

Another question: I was just testing the A6 and A7. Maybe I'm wrong but the voltage I got only makes sense if there is an internal pullup around 40Kohm. So how do I disable their internal pullup? digitalWrite(A6,LOW); ? That doesn't seem to work.

Sorry, I miscalculated.

1.1.9 ADC7:6 (TQFP and QFN/MLF Package Only) In the TQFP and QFN/MLF package, ADC7:6 serve as analog inputs to the A/D converter. These pins are powered from the analog supply and serve as 10-bit ADC channels.

So these two pins have no internal pullup, right? Good thing my design doesn't rely on internal pullup.

Correct in that those two 'extra' analog input pins do not have any digital pin capability like being a digital input or output or internal pull-up like the other analog input pins do, they are just two extra analog inputs only.

Great!

Kind of bad news: I probably blew a diode on the nano when a 9V battery cap touched the board. New I can either power the board from ICSP header or vin but not on USB anymore. And it is soldered to my board with the diode on its under side :(

It's not too bad since I don't want the board fed with USB "5V" anyway :)

Now that I understood the bootloader questions, time to move on to coding :)