page counter- display

I have built the following code and while the display does its test startup in setup and works fine, it wont display again as the pages are selected through the counter.

I can see the counter is incrementing.

I have tried adding tft.begin again within the sub routines but still no display.

Also if I just run RTC subroutine in the loop on its own it still doesnt write to the OLED.
The RFID works fine.

#include <SPI.h>
#include <PN532_SPI.h>

#include "PN532.h"
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1351.h>
#include "RTClib.h"

#define sclk 52
#define mosi 51
#define dc   A2
#define cs   53
#define rst  4

#define BLACK           0x0000
#define BLUE            0x001F
#define RED             0xF800
#define GREEN           0x07E0
#define CYAN            0x07FF
#define MAGENTA         0xF81F
#define YELLOW          0xFFE0  
#define WHITE           0xFFFF

PN532_SPI pn532spi(SPI, 10);
PN532 nfc(pn532spi);
Adafruit_SSD1351 tft = Adafruit_SSD1351(cs, dc, rst);  
RTC_DS3231 rtc;
boolean success;
String cardNum;
//unsigned long RFID;
int powerPin = 13;
int powerpinRead;
int prevpowerpinRead = LOW;
int powerpinState = LOW;
long time = 0;         
long debounce = 200;   
char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
uint8_t secs = 0;
int dispChngpin = 9;
int dispChngpinState;
int buttonPushCounter = 1;//sets first page at startup
int lastdispChngState =0;

void setup(void) {
  Serial.begin(9600);

  
  tft.begin();
  //  tft.fillRect(0, 0, 128, 128, BLACK);
  tft.setCursor(30, 5);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.println("Suzuki");
  tft.setTextSize(4);
  tft.println("  9");
  delay (2000);
 
  
  pinMode (dispChngpin,INPUT);
  pinMode(powerPin, OUTPUT); 

  
  
  uint16_t time = millis();
  tft.fillRect(0, 0, 128, 128, BLACK);
  time = millis() - time;

nfc.begin();
uint32_t versiondata = nfc.getFirmwareVersion();
  if (! versiondata) {
  Serial.print("Didn't find PN53x board");
  while (1); // halt
  }
  nfc.setPassiveActivationRetries(0x01);
  nfc.SAMConfig();
   
  if (! rtc.begin()) 
  {
  while (1);
  }

rtc.adjust(DateTime(__DATE__, __TIME__));
}
void loop() 
{
readRfid();//runs RTCNow if on
powerpinRead = (success);
 

}

void RTCNow()
{
 DateTime now = rtc.now();
  if (secs == now.second())//do more for hrs etc to save time
  {
    return;
  }
  secs = now.second();
  
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.setCursor(12,7);
  tft.print("  Clock ");
  tft.setTextSize(2);
  tft.setTextColor(MAGENTA, BLACK);
  tft.setCursor(15, 25);
  if ( now.hour()<10 ) tft.print(" ");
  tft.print(now.hour(), DEC);
  tft.print(":");
  if ( now.minute()<10 ) tft.print("0");
  tft.print(now.minute(), DEC);
  tft.print(":");

  if ( secs <10 ) tft.print("0");//previously uses second.now()but this should speed it up?
  tft.print(secs, DEC);
 

  tft.setTextSize(1);
  tft.setCursor(30, 45);
  tft.print(now.day(), DEC);
  tft.print("-");
  tft.print(now.month(), DEC);
  tft.print("-");
  tft.print(now.year(), DEC);
  tft.setCursor(17, 55);
  tft.setTextSize(2);
  tft.setTextColor(GREEN, BLACK);
  tft.print(daysOfTheWeek[now.dayOfTheWeek()]);
  tft.print("   "); // erase any previous date string that was longer
}

void readRfid()
{
  uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 };  // Buffer to store the returned UID
  uint8_t uidLength;                        // Length of the UID (4 or 7 bytes depending on ISO14443A card type)
  
 success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &uid[0], &uidLength);
  
  if (success) {
    Serial.println("Found a card!");
   
    for (uint8_t i=0; i < uidLength; i++) 
    {
     // Serial.print(" 0x");Serial.print(uid[i], HEX); 
    }
   }
  
  if (powerpinRead == HIGH && prevpowerpinRead == LOW && millis() - time > debounce) 
  {
    if (powerpinState == HIGH)
    powerpinState = LOW;
        else
        powerpinState = HIGH;
        time = millis();    
  }
    digitalWrite(powerPin, powerpinState);
    
    prevpowerpinRead = powerpinRead;
  
  if (powerpinState == HIGH|| powerpinState == 0x11)
  
  {
  //RTCNow(); //test around changeDisplay
 changeDisplay();
  }
  else 
  {tft.fillScreen(BLACK);
  }
  Serial.println (powerpinState);
}

void changeDisplay()
{
dispChngpinState = digitalRead(dispChngpin);
 //Serial.println (dispChngpinState);
 Serial.println (buttonPushCounter);
  if (dispChngpinState != lastdispChngState) 
  {
    if (dispChngpinState == HIGH)  
    {
     buttonPushCounter++;
    delay(100);
    }
  }
   lastdispChngState = dispChngpinState;

  if (buttonPushCounter  == 1) 
  {
  RTCNow();
  } 
  if (buttonPushCounter  == 2) 
  {
  tft.fillScreen(BLACK);
  buttonPushCounter = 3;
  }
  if (buttonPushCounter  == 3) 
  {
  tft.setCursor(30, 5);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.println("Suzuki");
  tft.setCursor(55,40);
  tft.setTextSize(4);
  tft.println("7");
  }
  if (buttonPushCounter  == 4) 
  {
  tft.fillScreen(BLACK);
  buttonPushCounter = 5;
  }  
  if (buttonPushCounter  == 5) 
  {
  tft.setCursor(30, 5);
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.println("Fuel");
  tft.setTextSize(4);
  tft.println("Gauge");
  }
  if (buttonPushCounter  == 6) 
  {
  tft.fillScreen(BLACK);
  buttonPushCounter = 1;
  }
 delay(1000);
 }

To add;

RTC is connected to SDA and SLC pins
OLED 51,52,53 etc as sketch
RFID is ICSP pins

If i dont run the rfid sub in the loop then the display stays set at the setup portion of the display text. Its the rfid sub that seems to crash display write.....

Even only having a simple display sketch in the loop on its own (below) the display remains off.

tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.setCursor(12,7);
  tft.print("  Clock ");

I think I have a clue.

I have two module activation checks in setup;

nfc.begin();
uint32_t versiondata = nfc.getFirmwareVersion();
  if (! versiondata) {
  Serial.print("Didn't find PN53x board");
  while (1); // halt
  }
  nfc.setPassiveActivationRetries(0x01);
  nfc.SAMConfig();
   
  if (! rtc.begin())
{
  while (1);
  }

Each produce an infinity loop if either fail and would stop the loop running.

If I comment out the RTC one the RFID stops working but with both in the sketch the RFID works but still with no display write although the changeDisplay button count does increment

I've tested the RTC/Oled hardware/wiring with the below and it works fine;

#include <Adafruit_GFX.h>
#include <Adafruit_SSD1351.h>
#include "RTClib.h"
#include <SPI.h>

// These are OLED hardware spi
#define sclk 52
#define mosi 51
#define dc   A2
#define cs   53//OCS on  big display
#define rst  4

// Color definitions
#define  BLACK           0x0000
#define BLUE            0x001F
#define RED             0xF800
#define GREEN           0x07E0
#define CYAN            0x07FF
#define MAGENTA         0xF81F
#define YELLOW          0xFFE0
#define WHITE           0xFFFF

RTC_DS3231 rtc;
Adafruit_SSD1351 tft = Adafruit_SSD1351(cs, dc, mosi, sclk, rst);

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
uint8_t secs = 0;

void setup()
{
  Serial.begin(9600);
  tft.begin();
  tft.fillScreen(BLACK);
  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }

  rtc.adjust(DateTime(__DATE__, __TIME__));
  tft.setTextColor(WHITE);
  tft.setTextSize(2);
  tft.setCursor(0, 5);
  tft.print("  Clock ");
  delay(3000);
  tft.fillScreen(BLACK);
}

void loop()
{
  DateTime now = rtc.now();
  
  tft.setTextSize(2);
  tft.setTextColor(MAGENTA, BLACK);
  tft.setCursor(0, 0);
  if ( now.hour()<10 ) tft.print(" ");
  tft.print(now.hour(), DEC);
  tft.print(":");
  if ( now.minute()<10 ) tft.print("0");
  tft.print(now.minute(), DEC);
  tft.print(":");
 if (secs == now.second())//do more of these IF's to save time on days and hours etc. not printing
  {
    return;
   
  }
   secs = now.second();
  if ( now.second()<10 ) tft.print("0");
  tft.print(now.second(), DEC);

  tft.setTextSize(1);
  tft.setCursor(0, 18);
  tft.print(now.day(), DEC);
  tft.print("-");
  tft.print(now.month(), DEC);
  tft.print("-");
  tft.print(now.year(), DEC);
  tft.setCursor(0, 30);
  tft.print(daysOfTheWeek[now.dayOfTheWeek()]);
  tft.print("   "); // erase any previous date string that was longer
  //Serial.println (secs);//test
}

Also with code which has no RFID (the above that works) my display setup is;

Adafruit_SSD1351 tft = Adafruit_SSD1351(cs, dc, rst, mosi, sclk)

but on the one with rfid that doesnt display if i add the mosi and sclk the display doesnt even display the setup part of the text. As the rfid is using SPI as well is there a clash?