Help Replacing Buttons with IR Remote Control

@arduarn. As you've taken the trouble to install the libraries etc. so you can at least get the sketch to build, then it is probably best if I take a back seat here because I'm not going to go that far.

What did you do incidentally about this:
#include "Font_Data.h"
which appears to be in the sketch folder. Can you be sure you used the same as the OP ?

This from your build is clearly very tight (Uno):

Sketch uses 31338 bytes (97%) of program storage space. Maximum is 32256 bytes.

So the extra 1.5kB or so taken by the (old) Nano bootloader is crucial here.

Edit

Also note that the OP has hacked out some debug print statements since the last full sketch was posted (but I guess only about 100 bytes) so it may be good to get a fresh sketch.

I used the Font_Data.h from the project link in the sketch, so probably the same.

To friends 6v6gt and arduarn:

I give up trying to burn Arduino Uno Bootloader on Nano;

I did it in a variety of ways: with the Nano serial and ICSP pins (I even memorized how to wire), I even used Nick Gammon's famous sketch - Atmega_Board_Programmer but, in the report, in addition to several errors, at the end shows the message: Programming mode off.

I suspect (from my inexperience) that Arduino Nano is locked for Bootloader recording but don't worry about me!

If friend '6v6gt' or even 'arduarn' wants to 'clean' the sketch to make it smaller, I appreciate it, but if you can't or don't have time for it, thanks too!

You already did enough for me! Thank you very much!

PS. Sorry for my English!

I suggest making a separate thread:
“Problems installing optiboot bootloader on a Nano”
in the forum “Installation & Troubleshooting”.
It is a common enough activity. Give details like which tutorial you followed, what error messages you saw etc.

Hi 6v6gt

I don't tell you much, but using the sketch 'Atmega Board Programmer' I ended up burning (died) my Arduino Nano! RSRSRS

Do you know if it is possible to find on ebay (or on another site), Arduino Nano with Uno Bootloader?
(precisely for this purpose)

Thanks

Here is an example of an eBay retailer with Nano preinstalled with optiboot.
Remember when you are loading a sketch to it, you select UNO as the board type, not Nano.

https://www.ebay.com/itm/Arduino-Nano-v3-ATMega328P-2019-16Mhz-Optiboot-Bootloader-and-CH340-USB-Cable/123931927925

Hi 6v6gt,
On this site, this Arduino Nano is more expensive than Uno! How can this be?

"Remember when you are loading a sketch to it, you select UNO as the board type, not Nano." - That's why I burned (let it die) my Arduino Nano. I did not know!

Hugs friend

Dancopy:
"Remember when you are loading a sketch to it, you select UNO as the board type, not Nano." - That's why I burned (let it die) my Arduino Nano. I did not know!

I don't think that selecting the wrong board type when writing your sketch to the Nano could have "burned" it. Why do you think the Nano is burned?

If you can no longer upload a sketch to the Nano, then open the preferences window in the Arduino IDE and tick the "Show verbose output during: upload" checkbox. Try to upload again and then post the output in the black messages part of the IDE window (on many PCs you can click in the black area, Ctrl-A, Ctrl-C, and then in the forum post Ctrl-V (preferably in code tags or as a quotation)).

Hi arduarn!
First, thanks for your patience (yours and 6v6gt) with me.
Yes, my Arduino Nano literally burned! There was a little smoke and a strong burning smell of the component.

So, I used another Arduino Nano ...
I installed Minicore to make a few more attempts but the result is this:

avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is “C: \ Users \ Daniel \ AppData \ Local \ Arduino15 \ packages \ MiniCore \ hardware \ avr \ 2.0.3 / avrdude.conf”

Using Port: COM4
Using Programmer: arduino
Overriding Baud Rate: 19200
avrdude: stk500_recv (): programmer is not responding
avrdude: stk500_getsync () attempt 1 of 10: not in sync: resp = 0xf8
……….
……….
avrdude: stk500_recv (): programmer is not responding
avrdude: stk500_getsync () attempt 10 of 10: not in sync: resp = 0xf8

avrdude done. Thank you.

Error writing bootloader.

I set it up like this:

Board: ATmega328
Clock: 16 MHz external
BOD: BOD 2.7V
LTO Compiler: LTO disabled
Variant: 328P / 328PA (also the 328PB)
Bootloader: Yes (UART0)

I connected the 6 Arduino Nano ICSP pins to the Arduino Uno.

I programmed as "Arduino as ISP" and Write Bootloader.

I re-booted the Bootloader on Arduino Nano through the Programmer: Arduino ISP; the end of the recording was OK but the results of the sketches I am sending you in a .txt attachment for being a bit big.

I made a comparison with two sketches: the basic example 'Blink' and my intended sketch 'Digital_Clock_MAX7219_DS1307RTC_3button_V0_02.ino'.

So you draw a conclusion.

Note: Blink loads and works normally.

Thanks again,

Daniel

Blink.txt (3.85 KB)

Digital_Clock.txt (4.21 KB)

One more proof that the Bootloader is recorded and the same size as Arduino Uno Flash memory: Flash memory size = 32768 bytes.

File in attachment

Bootloader.txt (13.1 KB)

Dancopy:
One more proof that the Bootloader is recorded and the same size as Arduino Uno Flash memory: Flash memory size = 32768 bytes.

File in attachment

I'd say that Bootloader.txt indicates that you haven't successfully burned the Uno bootloader yet:

Bootloader is 2048 bytes starting at 7800

The Optiboot bootloader should only be 512 bytes.

The output you posted before:

avrdude: stk500_recv (): programmer is not responding
avrdude: stk500_getsync () attempt 10 of 10: not in sync: resp = 0xf8

suggests a problem with the Uno you are using as the programmer, either with the Arduino ISP sketch that it runs, or maybe the wiring.
Please take another look at the tutorial and ensure you are doing things correctly.

What currently happens when you try to burn the Uno bootloader as suggested by 6v6gt? Please post the output.

Post a link to the tutorial that you followed to install the optiboot bootloader on the Nano.

There is definitely a mess somewhere and it is not clear to me if the dumps are from the Nano or from the Uno which you are using temporarily as a programmer.

From your last post, this is very odd. The dump contains the statement:

Bootloader is 2048 bytes starting at 7800

but only 512 bytes of the 2kB block appears to have data, the rest is marked with 0xFF.

Hi 6v6gt! I keep thanking you and arduarn!

The page is this: https://www.instructables.com/id/How-To-Burn-a-Bootloader-to-Clone-Arduino-Nano-30/

I just burned a new bootloader for you to see the result.

I did exactly as it is written in the tutorial.

new bootloader.txt (9.37 KB)

EDIT:

Sketch "Digital_Clock_MAX7219_DS1307RTC_3button" loads normally and sketch "Digital_Clock_MAX7219_DS1307RTC_3button_V0_02 (with IR_Remote) show this in the end:

Writing | ################################################## | 100% 4.89s

avrdude: 31378 bytes of flash written
avrdude: verifying flash memory against C: \ Users \ Daniel \ AppData \ Local \ Temp \ arduino_build_881846 / Digital_Clock_MAX7219_DS1307RTC_3button_V0_02.ino.hex:
avrdude: load data flash data from input file C: \ Users \ Daniel \ AppData \ Local \ Temp \ arduino_build_881846 / Digital_Clock_MAX7219_DS1307RTC_3button_V0_02.ino.hex:
avrdude: input file C: \ Users \ Daniel \ AppData \ Local \ Temp \ arduino_build_881846 / Digital_Clock_MAX7219_DS1307RTC_3button_V0_02.ino.hex contains 31378 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 3.71s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x7800
0xff! = 0x8a
avrdude: verification error; content mismatch

avrdude done. Thank you.

the serial port selected does not exist or your card is not connected

Ok. So post #40 appears to indicate that you successfully installed the optiboot bootloader somewhere on the “Nano”. However, did you select the uno board type when you were doing this? You must do this and it differs from the "instructable" which you said you followed. The high fuse with value ‘DA’ tends to indicate you didn’t.

Did you then:

  1. Connect the “Nano” directly to the pc via the usb cable.
  2. Select the standard “Uno” board type. (You now treat your “Nano” as a Uno in the IDE.)
  3. Attempt to verify then upload your sketch onto the “Nano”

If you did all that, then it is difficult to know what to suggest. The dumps from post #37 and #40 imply that the fuses are set to indicate a 2kB bootloader but that should have been corrected with the installation of the Uno optiboot which uses only 512 bytes. Avrdude is a tool for examining the fuses.

A similar issue is also discussed here: New Nano with incorrect settings - Suggestions for the Arduino Project - Arduino Forum

Ok friend, you said, "However, did you select the one board type when you were doing this?"

Yes, first I chose the Arduino Uno board to record the Arduino ISP sketch and then the Arduino Nano board with the Programmer: "ArduinoISP" to record the Bootloader.

You also said: "You must do this and it differs from the" instructable "which you said you followed."

What did I do different from the tutorial?

I know I'm already boring you about this, so here I ask you one question for one last try:

Is it possible to reset (fully clean) the Arduino Nano to do the Bootloader procedure again? Well, maybe it got corrupted - what do you think?

If so, could you send me any tutorials about it?

Thank you again

I have highlighted the single important difference. The rest is exactly as in the tutorial:

STEP 3 - Burn Bootloader

  • Keeping all the wires intact and unmoved in step 2, connect the working arduino back to the computer with the USB

  • Go to Tools>Serial Port>COM (and make sure again that the correct COM port is chosen - ask me if you don't what this means)

  • Go to Tools>Board>Arduino Nano w/Atmega 328 (this time we choose the non working arduino, in my case nano atmega 328)

  • Go to Tools>Board>Arduino/Genuino Uno (this is the difference to the tutorial!!!)

  • Go to Tools>Programmer>Arduino as ISP

  • Go to Tools>Burn Bootloader (this is it, after the LEDs stop flashing your board is ready to use !!!)

.

Do all of the above steps in ORDER !!! no skipping steps

Always make sure that the correct COMM port and correct board are chosen before uploading a sketch to avoid errors...

When you later load sketches on to the updated device, always treat it as an Arduino/Genuino Uno [NOT as a Nano] in the IDE.

Hi 6v6gt
I did as you wrote and now, at least, the sketch loaded! (I chose the "Arduino/Genuino Uno" board); So can you take a look to see if it's correct?

However, after loading the sketch, I connected all components to the Arduino Nano (with USB cable on PC), just like I do on the Uno board, but the LED Matrix stays on with all the LEDs on, it doesn't show the time, as it does on Uno.

Thank you so much for your patience with me!

last sketch.txt (4.09 KB)

OK. That looks like progress if, as it appears, the sketch compiled and loaded. It seems that at last the Nano is behaving like a Uno from the IDE.

Do you see anything in the serial monitor to indicate that the sketch is working ?
If there are no debug statements left in your code, simply add a simple print statement in setup() so you see some activity from the sketch.

You could also attempt to start testing the Nano with the individual components. Start with the Matrix display and find a sketch to print "Hello World" to it.

The only difference between your Uno and Nano now is the power handling. That should not, however, be a big issue.

Also, post a copy of your latest sketch here.