Sleep_n0m1 Library problem

I am running the Sleep_n0m1 library to create a Low-Power device.
Board is a ATMEGA328PB custom board running at 16MHz and 3.6V LiSOCL2 battery.

The problem I am having is that when the device wakes from Sleep, it does not “wake-up” in the main “void loop()”.
All other code works great.

Full code is attached.

The Log (with comments) from the code is:

BOOT
----------------------------------
Awake
Scanning....
adv off
Success
> adv off
Success
> scan off
Success
> scan all
Success
> !  # RSSI BD_ADDR           Device Name
#  1  -15 d0:cf:5e:fb:ff:e4 ECO-3619
AT$SF=d0cf5efbffe42324
sleepTime BLE Set: 60000

HERE I SHOULD RECEIVE "Awake" from "void loop()"
BUT I RECEIVE:

adv off
Success
> scan off
Success
> scan all
Success
> !  # RSSI BD_ADDR           Device Name
#  1  -15 d0:cf:5e:fb:ff:e4 ECO-3616
sleepTime BLE Set: 60000

THIS SHOWS THAT WHEN WAKING-UP FROM SLEEP
I AM NOT WAKING UP IN "void loop()"

If anyone could point-out what I am doing incorrectly, it would be much appreciated.
This is driving me nuts.

Code.txt (11.2 KB)

            sleepSetBLE();
          }// END: if (TxCount == 6)

          else
          {
            // Increment TxCount
            TxCount++;
            
            // Set the BLE Sleep Period
            sleepSetBLE();
          }
            sleepSetBLE();
          }// END: if (TxCount == 6)

          else
          {
            // Increment TxCount
            TxCount++;
            
            // Set the BLE Sleep Period
            sleepSetBLE();
          }

If you are going to do something regardless of the if...else, then the part that you are always going to do should be outside of the if...else. That is not your problem, however.

Perhaps I am wrong, but I didn't think that an ATMega 328 was rated for 16 MHz at 3.6 volts. Am I wrong? Do you use a boost converter. If you are using an unrated clock speed then anything may happen. Are you using 5 volts for testing?

Hi, Sorry for the mistake.
My PCB runs the ATMEGA328PB @ 12 MHz.