Upgrading from Classic Uno/Nano/328PU

Hi all,

I'm currently in the middle of a project (weather station) and I have run out of RAM/Flash on the Nano (classic) I've been using. I want to add quite a bit more functionality and have come to the unhealthy realization that the Atmel328P based Arduino boards will not cut it any longer. I've used all the usual PROGMEM and F Macro tricks but just need something bigger.

My question is, what is the next recommended board/MCU upgrade to gets some more RAM/Flash space? I see the Nano 33 and Nano Every (ATMega4809) both have more power in terms of RAM/Flash, but what's important to me is that I don't have to change the code too much to move to a newer platform.

I already have a Wemos D1 mini which would fit the bill, but would like to keep the project in the Arduino family where possible.

I've also seen that the Atmel1284P may also be an option standalone. Once the sw is complete I'd like to move off the current breadboard to either strip board or PCB. I was going to use header pins just to plug the Nano in originally. I have a couple of SPI and I2C devices along with some digital line inputs, so the circuit is pretty straight forward. I already also have a 328P standalone working as a remote transmitter, but the base unit of the weather station has a lot more code to run. I just ordered a ILI9341 as the primary display for the project.

I looked at the Arduino Mega, but the form factor is too big for the final implementation although the software itself would run fine, Nano like form factor is preferred. Code portability between and 328P and newer platform and good IDE support is key for me as I'm fairly new to Arduino.

Hence what platform would be recommended when graduating off a 328P based Arduino nano board with the above in mind?

Thanks much

Hi,
The biggest problem you will have going to a different based controller is the compatibility of the libraries you will be using.
Why is your code so big for such a basically simple project?
What bells and whistles have you got?

Can you explain the layout of your project and we can possibly suggest some alternatives.

Thanks.. Tom.. :slight_smile:

TomGeorge:
Hi,
The biggest problem you will have going to a different based controller is the compatibility of the libraries you will be using.
Why is your code so big for such a basically simple project?
What bells and whistles have you got?

Can you explain the layout of your project and we can possibly suggest some alternatives.

Thanks.. Tom.. :slight_smile:

Hi Tom,

Basically it's a continuation of this project here.

Both RAM/Flash is again already maxed out and I still want to add most of the functionality similar to this project here which is running on a ESP8266 based board.

I have the Zambretti Forecaster code running on the Wemos already as well, but want to stay on the Arduino/Atmel platform for compatibility as you mention. I'm still learning and hence don't want to deviate from the Arduino ecosystem at the moment.

I just came across the Mega Pro in a smaller form factor here which may fit the bill.

However, I'm wondering what's the general recommendation here? The Nano 33 boards seem to have plenty of power compared to the Atmel2560/1284P or similar for roughly comparable price point as well, thoughts?

Thanks

Hi,
With hindsight, why didn't you start with a ESP32?

Tom... :slight_smile:

There are Mega clones available in "pro" footprints: pretty much as small as it gets with that processor. I didn't see the one you linked in #2 yet.

The display is going to demand lots of memory and probably significant horsepower; indeed it may be a good idea to look at the ESP32 or the Teensy boards. As long as your weather station is basically a bunch of sensors that are read periodically, not using fancy things like interrupts or timers, chances are your Arduino code will run out without significant modifications (beyond the obvious things like pin numbers) on those processors.

TomGeorge:
Hi,
With hindsight, why didn't you start with a ESP32?

Tom... :slight_smile:

Yes, yes, the thought had crossed my mind... :o but I'm so far down this project (and having learned so much about the various components) that I'm trying to avoid going back to scratch essentially. Attached are the circuits I've currently prototyped for the base station and remote transmitter just for reference.

Most of the I/O is on the remote transmitter which I've successfully moved off the Nano shown to a bare 328PU for power saving reasons. The base station is primarily receiving the data, driving the OLED (to be replaced with the ILI9341) and connecting to WiFi and IOT services.

If I was starting today I would certainly go with the Wemos D1 Mini board (or ESP32) as shown by many similar weather station projects on these platform elsewhere.....but then again not too long ago I got Blink woking for the first time on my Uno... :slight_smile:

wvmarle:
There are Mega clones available in "pro" footprints: pretty much as small as it gets with that processor. I didn't see the one you linked in #2 yet.

The display is going to demand lots of memory and probably significant horsepower; indeed it may be a good idea to look at the ESP32 or the Teensy boards. As long as your weather station is basically a bunch of sensors that are read periodically, not using fancy things like interrupts or timers, chances are your Arduino code will run out without significant modifications (beyond the obvious things like pin numbers) on those processors.

Yes, would you not recommend the Atmel 1284P? I'm leaning towards this for the final implementation as it seems the least change from the existing 328P implementation although I realize I'll need to burn boot loader, update the IDE and use FTDI for updates.

So the options would be:
[1] Atmel 1284P
[2] Arduino Mega compatible (Atmel 2560)
[3] Wemos D1 (ESP8266 based)
[4] ESP32
[5] Teensy (not familiar with this board as yet)
[6] Arduino Nano 33 IoT

I'm kind of surprised there is no recommended generic upgrade path from the Arduino 328P based platforms. I guess it depends on the requirements of each build...

tsarath:
Yes, would you not recommend the Amtel 1284P?

I'm kind of surprised there is no recommended generic upgrade path from the Arduino 328P based platforms.

I think there is, and its the bleeding obvious - Mega 2560. The 1284 gets so little mention it is either not worth considering or no longer available. Your problem is that you have run out of memory, the Mega offers more of it. How hard is to identify as a generic upgrade? The fact that it also offers more pins and ports may be immaterial. What is material is that it speaks the same language and any shields or peripherals you are currently using may be used on the Mega with minimal or zero modification. NodeMCU and the like would be worth consideration if you need WiFi and or greater speed, and may still be, but you don't say anything about that.

Nick_Pyner:
I think there is, and its the bleeding obvious - Mega 2560. The 1284 gets so little mention it is either not worth considering or no longer available. Your problem is that you have run out of memory, the Mega offers more of it. How hard is to identify as a generic upgrade? The fact that it also offers more pins and ports may be immaterial. What is material is that it speaks the same language and any shields or peripherals you are currently using may be used on the Mega with minimal or zero modification. NodeMCU and the like would be worth consideration if you need WiFi and or greater speed, and may still be, but you don't say anything about that.

Yeah, thanks. I guess I kind of answered my own question. The 2560 is the obvious choice and offers the most code compatibility if I want to stay in the 8-bit world I would imagine. But I'm kind of tempted to try out the 1284P as it has more memory and comes in DIP package which is easier to solder for the final board. I would expect most libraries to work on the 1284 I would think, I found a good comparison here.

I guess the next obvious jump beyond this is the ARM Cortex 32-bit based boards which are towards the bottom of my list.

Thanks.

tsarath:
the 1284P as it ..... comes in DIP package

That's interesting, if only vicariously, I wasn't aware of that.

Nick_Pyner:
I think there is, and its the bleeding obvious - Mega 2560.

The 2560 is an old model, and can't even run at <4.5V. It happens to be the processor in the Arduino Mega, but otherwise it's not one that I'd consider to use. Atmel doesn't seem to like the chip too much, either: it's really hard to find it in their parametric search tool.

The 1284p is a nice one, and this range (there are other 44-pin ATmega chips as well) is the obvious first step up from the ATmega328P (but don't forget the ATmega328PB! A few I/O more than the 328P, second Serial, and more goodies - and that all for a much lower price).

The 100-pin chips the 2560 belongs to are another big step up.

wvmarle:
The 2560 is an old model, and can't even run at <4.5V. It happens to be the processor in the Arduino Mega, but otherwise it's not one that I'd consider to use. Atmel doesn't seem to like the chip too much, either: it's really hard to find it in their parametric search tool.

The 1284p is a nice one, and this range (there are other 44-pin ATmega chips as well) is the obvious first step up from the ATmega328P (but don't forget the ATmega328PB! A few I/O more than the 328P, second Serial, and more goodies - and that all for a much lower price).

The 100-pin chips the 2560 belongs to are another big step up.

Thanks, I like the 1284P too, it's BB friendly as well, just started going through the data sheet.

Would you expect the standard Arduino libraries for SPI, I2C etc to have any problems with this chip?

I'm currently using the following;

#include <Wire.h> // Include Wire Library for I2C
#include <WiFiEsp.h> // Include support for ESP8266-01 WiFi module
#include <SoftwareSerial.h>
#include <SPI.h> // Include dependant SPI Library
#include <SparkFun_RHT03.h> // Include DHT22/RHT03 Sensor Library
#include <RH_ASK.h> // Include RadioHead Amplitude Shift Keying Library
#include <DS3231.h> // RTC DS3231 support
#include <avr/pgmspace.h>
#include <BlynkSimpleStream.h> // To use in future
#include <SSD1306Ascii.h> // Include OLED libraries
#include <SSD1306AsciiWire.h>

Thanks

Assuming you install the proper core for them, it should all work without any issues.

1284p is new to me. While the additonal RAM and flash is welcome, what a price jump if that's a consideration. It would have cost less to have started with an M3.

Hi,
OPs pictures.



Thanks.. Tom.. :slight_smile:

wvmarle:
Assuming you install the proper core for them, it should all work without any issues.

Thanks!

I installed MightyCore from here on the IDE, and my base station code seems to compile fine with lots of room to spare on the 1284P. :slight_smile:

Sketch uses 31994 bytes (24%) of program storage space. Maximum is 130048 bytes.
Global variables use 1691 bytes (10%) of dynamic memory, leaving 14693 bytes for local variables. Maximum is 16384 bytes.

tsarath:
Thanks!

I installed MightyCore from here on the IDE, and my base station code seems to compile fine with lots of room to spare on the 1284P. :slight_smile:

So, just an update on this. I got my Atmel 1284P a few days earlier (ordered via Digi-Key for ~$5), burned
the bootloader, and got my Nano project and code ported over with minimal fuss. The main effort was port pins remapping to fit the standard non-Arduino layout of MightCore which took me a while to figure out. FTDI connection is a bit temperamental even with the 0.1uF DTR cap and 10K pull-up, but otherwise works fine 90% of the time.

See attached, for the pudding. Lots more headroom to add more features now with only 10% of SRAM used. :smiley:

Hi tsarath,

I got the same need as you when making my projects because most of the times I use a TFT and it uses a lot of memory. I saw that you opted for the Atmega1284, which is the best option in my opinion. Because I tried to switch to STM32 devices that are very nice, but the porting is not straightforward at all (starting from different VCC). Not talking about ESP32 devices that are for Iot projects.

So I made a board with the option of using either the Atmega644 or the Atmega1284. Although the cost is higher than if placing an MCU on a breadboard, you can have a finished and very tiny board and with a dedicated connector for the display.

See