PRO MICRO SERIAL HANGS

I am using a PRO MICRO and I have a question on using SERIAL1.

USB Serial is used for programming and monitor.(9600)

SERIAL1 is send GPS data every .1 second and .5 sec and on pin 2(RXI), data is send every minute to XBEE from PIN 1(TXO).(4800)

The sketch runs for a while(up to several hours) and then the sketch hangs.

Increasing the GPS data transmission to 1 min and 2.5 sec fixes the problem.

Is it possible that a collision on SERIAL1 is happening if data is received at the same time it is called to be sent. If this is happening, is there a fix other than changing the transmit/receive times.

Thanks for your help

Bill Lynn

.

SERIAL1 is send GPS data every .1 second and .5 sec and on pin 2(RXI), data is send every minute to XBEE from PIN 1(TXO).(4800)

The above is a little confusing (for me). Please provide a schematic how everything is wired; a photo/scan of a hand-drawn one is fine.

And please show us your code. Heavy use of String (uppercase S) or writing outside the boundaries of arrays are usual suspects when applications start showing unexpected behaviour.

Attached is board schematic and code.

The code is lengthy so I do not expect you to spend your time analyzing the code.

The project sends three GPS sentences to the Serial1 RX port(pin 2), The sentence transmission are sent at the following intervals.
A. (WIMDA) sent every 60 seconds
B.(WIMWV) sent every 2.5 seconds
C.(YXXDR) sent every 60 seconds

I do not know if the A and C sentence are sent at exactly the same time.

I changed the A and B sentence timing to 50 seconds and 70 seconds and the code seems to be running OK now; its been running 24 hours so far.

The code sends two strings to XBEE(SENTENCE and SENTENCE_2) from SERIAL1 TX(PIN 1), The timing for these is;
A. SENTENCE every 52.5 seconds
B. SENTENCE_2 every 60 seconds.

Right now it looks like I have data collision on SERIA1 but I cannot find any documentation to verify that this is possible.

Your input appreciated.
Thanks
Bill

WEATHER_PUMP_MICRO_MEDIAN_NEW_5_26_18.ino (12.8 KB)

ARDUINO_PRO_MICRO.pdf (91.4 KB)

5 Volt must go to Vcc pin of Arduino Micro but not to RAW pin.

UXOMM:
Thanks for reply but your answer is not relevant to the issue.
I always connect my power to RAW input; its a safety issue with me in case I connect 3v board or I pick the wrong input voltage to connect
On the micro connecting the input voltage to RAW generates 3v or 5V VCC for the board or in case you need another 3v or 5v supply.