Cloning an Arduino Uno and Arduino Mini Pro 3.3V

Can someone give me some advice here.
In 2015 to 2017, I designed and built 2 large scoreboards for my soccer club (home and away score, clock, temperature and count down timer) as well as a remote each to operate them.

I'm not an electrical engineer, but with forums over the 2 years I was able to draw up the circuit boards, and write the code. However now 8 or 9 years later I'm a bit rusty.

I no longer have the same laptop or version of software loaded. I've heavily noted everything in codes, construction, etc, but I remember having to load certain libraries to get things working as I needed. Now I'd have no idea what I loaded.

The scoreboard has been going great, but the remotes I created have been bashed around too much and I need to make new ones. But at the time I programmed them so that they would go to sleep and use only 70 microamps and there were quite a few "libraries" and add on's from memory that I used.

So, is there a way I can simply "copy" the code from one chip to the next (Arduino Uno for the main board and Arduino Mini Pro 3.3V for the remote), as well as the nRF24L01 transmitter / receiver? I know it's a big ask / wish.

Thanks in advance for any advice.

PS. I do have a file that explains the whole construction / programming, but being new to this forum, I can't upload it.

in the files you have, is the source in there ?
If yes, the #include lines will help find the libraries.

If not, see if you can list out all the modules & devices being used.
We can make an educated guess at what’s needed,

You might upload any other documentation or photos you have.

These are the "include" lines in the remote for scoreboard no. 2

#include <avr/sleep.h>
#include <avr/power.h>
#include <SPI.h>    // Comes with Arduino IDE
#include "RF24.h"   // https://github.com/TMRh20/RF24

These are the "include" in the main board arduino:

#include <DS3232RTC.h>                    //http://github.com/JChristensen/DS3232RTC
#include <Streaming.h>                    //http://arduiniana.org/libraries/streaming/
#include <Time.h>                         //http://playground.arduino.cc/Code/Time
#include <Timezone.h>                     //http://github.com/JChristensen/Timezone
#include <Wire.h>                         //http://arduino.cc/en/Reference/Wire
#include <SPI.h>                          // Comes with Arduino IDE
#include "RF24.h"                         // https://github.com/TMRh20/RF24

Is there any way I can upload files in this forum. I do have all the code for both as well as detailed notes on what I did in building, modifying and programming the Mini Pro.???

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination

I think I've worked out how to upload my files - google drive link:
Notes

Mini Pro

Main program

Remote program

Photo

Why not post them here ?

Sorry. Fixed.

Please do the work a few of us might all do one by one and post the code here.

Use the <CODE/> button you see in the messasge composition window and it tells you to

type or paste code here

inside code tags.

It will get more attention.

It will be here in two to five years when you go through this again. :expressionless:

a7

Yes there is. You can use AVRDudess to read a hex file from one Arduino and burn it to another.

+1. But I believe you would need a programmer to do that - another Arduino configured as an ISP programmer. You would also need to use AVRDudess to confirm that the old and new fuse bytes are the same.

But yes, my understanding is that AVRDudess can read or write the entrire flash memory, including the bootloader, and can do the same for the EEPROM if needed.

This sounds all really complicated. I wonder if anyone knows any good video's on how the process is done from start to finish?

Here you go:

https://www.youtube.com/watch?v=d64tr0JGJ3s

I would argue with his choice of programmer. He selects "Arduino", but I think the correct choice is "arduino_as_ide".

Also, it appears he doesn't have the 10uF cap from the programmer Arduino's reset pin to ground. You will need that.

Thankyou. I'll give it a go....

Yeah, there’s a decent chance you can just clone the chips directly instead of rebuilding the whole software environment from scratch. If the boards weren’t protected with lock bits, you should be able to read the existing firmware and flash it onto new Arduino boards using an ISP programmer or even another Arduino.

Only downside is you’ll get the compiled code, not the original project files or libraries, so editing things later could be difficult. But if your goal is mainly to recreate working remotes, it’s probably the easiest path.

Also honestly, getting those remotes down to around 70 microamps years ago is pretty solid work. Low-power radio projects always end up being way more complicated than they first seem.

Carful!!
Using AVRDudess requires some learning.
If you are not sure what you are doing, you can wipe out your current program and/or brick your Arduino.

I would first try it on other boards using the blink sketch to make sure you have it right, then use the boards you wish to clone.

Yea, 70 microamps was really tough, but worth it. I also added a voltage doubler so I could use rechargeable AA batteries (to keep the size of the hand held remote down). Another stretch! As for the original project files, I have them. But I'd rather just clone if I can. I take @jim-p 's comment about experimenting on another arduino first with a blink sketch

I've never read or written the lock bits. I've just never run across an Arduino that was locked. Maybe someone else can opine on what's necessary there.

Just to review the setup: After you've flashed the Arduino ISP example to the programmmer Arduino, you have six connections to the target Arduino. D11, D12, D13, 5V and GND are straight across. The exception is D10 of the programmer Arduino, which goes to the Reset pin of the target. Then you'll also need a 10uF capacitor to ground on the programmer Arduino's Reset pin.

If your programmer Arduino is 5V, but one of your targets is a 3.3V 8MHz Pro Mini, you can still simply power it with 5V from the 5V pin of the programmer Arduino to the "Vcc" pin of the Pro Mini. Then there's no voltage differential on the GPIO pins, and it will all work fine. The processor in both cases is the 328P, which is good to 5.5V.

If your new Arduino happens to have a 328PB processor, then I think it will still work. I think AVRDudess will insist that you select the PB as the target MCU if that's what you actually have, but I think it should still flash the original file ok. And as far as the Arduino IDE is concerned, it will then program like whatever the old Arduino was - presumably a 328P - with the possible exception of not being able to flash a new bootloader to it. Not sure about that.

Thanks @ShermanP. Good info.

I'm waiting for parts so I havent started yet. But can I ask....

If I'm successful in cloning my mini pro, I assume this will also load the correct bootloader. So as I have the original arduino code, should I then be able to change values in the code ( the RF frequency) and load it as usual? Or will it complain about missing libraries and other settings?

Cloning should mean the boot loader goes along for the ride. Cloning is low level.

If you have the original code, to modify it and use it again will require that it compiles. This means you need to have the libraries installed in the IDE and, as presumably they are, included in the sketch.

The original library versions should work, and much of the time later versions will also work, backwards compatibility is a goal that ppl like to meet, if possible.

a7

When you copy the contents of the flash memory from the old Arduino, that will include everything, including the bootloader.

But if you really think you'll need to change something, then forget about cloning, and try to get the software to compile. You'll have to do that anyway to be able to change anything.

Is there any chance you still have the IDE installation you used back in the day? In a backup perhaps? If you can find that, it should still run, and it would already have all the libraries.