Software Serial and Analog Interrupts

This is a stripped down version of project code that I have been using for quite a long time which is exhibiting the same problem as the main code. I recompiled and downloaded for a small alteration and now getting errors in the reading from the software serial RX. I have compiled into a UNO ( its normal usage on pins 8/9) and a Mega 2560 (10/11)with the same bad results… If I deactivate the ADC_Init() then it all comes right. Tried everything I can over last week!
What is annoying is this code has been working fine for months.
Basically I am sampling 5 analogs, one for a spot check and the others scanned over 1/4 second to get the maximum and minimum voltage. Communication on serial is to a Nextion.

Any help gratefully recieved.

Nextion_Test_AnalogInterrupt.ino (2.84 KB)

ADC.ino (3.41 KB)

As far as I know, softwareserial.h disables interrupts when dealing with serial data. Use altsoftserial.h instead.

Don't use SoftwareSerial on a Mega. Use Serial1 instead (pins 18 & 19). That's a real HardwareSerial. There's also Serial2 and Serial3 if you need them.

Don't use SoftwareSerial on UNO pins 8 & 9. Use AltSoftSerial instead (those are the pins it requires), because it's much more efficient than SoftwareSerial. Much.

Cheers, /dev

Thanks knew about Serial1/2/3 etc on Mega, the reason for porting it was purely to see if the problem was repeatable, which it was… Have used 8/9 on UNO lots for software serial with no issues except for whats happening now… Will try AltSoftSerial and let you know