Hi I need some help, I am a long way into a project using Nano with LCD12864 (ST7920) using U8g2lib.
I have now got major stability issues due to low memory. When I broke it down the U8g2Lib with almost nothing else uses 1332 bytes or 65% of what the nano has.
I have tried reducing memory in other areas using F() and avoiding Strings but it only leaves 216bytes before memory warnings
#include <U8g2lib.h>
#include <SPI.h>
#define clockPin 13 //Connect to pin'E' on LCD
#define dataPin 12 //Connect to pin R/W on LCD
#define csPin 10 //Connect to RS on LCD
#define resetPin 8 //Actually not connected not sure why it need to be delcared
U8G2_ST7920_128X64_F_SW_SPI *_u8g2;
void setup() {
_u8g2 = new U8G2_ST7920_128X64_F_SW_SPI(U8G2_R0, clockPin, dataPin, csPin, resetPin);
_u8g2->begin();
_u8g2->setFont(u8g2_font_logisoso46_tn);
_u8g2->setFont(u8g2_font_t0_22b_tr);
}
void loop() {
}
I decided I needed to take a big backwards step and try another library in the hope I could free up memory. I found the old U8glib which when I tried a similar sized sketch only used a fraction of the memory 265 bytes 12% unfortunitlly after adding any large sized font it instantly exceeded the entire Flash memory.
So one library uses too much SRAM and the other uses too much Flash either way the Nano cannot handle it.
Does anyone know how to reduce the resourse hunger of either of these two libraries or offer another library?
The large font only needs to be numbers so if there is a number only large font that is smaller for U8glib that could help (I couldn't see any)
Having to change from a Nano would be a disaster given PCBs etc are already manufactured.
Please help if you can.