Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - How to wake Atmega328 from sleep

(you are viewing a thread; or go back to list of threads)

How to wake Atmega328 from sleep (by Victor)
I followed the Sleep example on the Github for AVRs. INT0 and INT1 is used for interrupt the sleep and wake up the MCU.

Im using LDmicro 5.4.1.1 and compiling using arduino sketch option in compile menu.

My Arduino Nano goes to sleep. Circuit stops but I can’t wake up the Arduino again.

I’m not sure if the inputs (int0/int1) should have internal pull-up resistors active or if using the arduino sketch compile option works with sleep function?

I tried to connect button to int0 when arduino nano was in sleep mode and connected it to gnd. Nothing happens.

Can someone explain how to wire the int0 int1 inputs to interrupt the sleep cycle?
Tue Dec 26 2023, 10:44:43
SLEEP doesn't work with "Compile Sketch for ARDUINO" (by Victor)
Using "Compile Sketch for ARDUINO" doesn't work with sleep. Can't wake up atmega328 from sleep with INT0 or INT1.

If I compile the same project to HEX-file and upload. It works!

Something is wrong with the Arduino compiling to sketch option.
Thu Jan 4 2024, 22:11:18
(no subject) (by Victor)
I was wrong!
I'm trying to get SLEEP working on Atmega328-28 MCU (Arduino UNO) using the sleep_28.ld example from here:
https://github.com/LDmicro/LDmicro/wiki/SLEEP-example.

When I open the sleep_28.ld example and compile in 5.4.1.1 to .HEX then uploaded to Arduino (using xLoader) the ladder sort of works. I'm able to wake up MCU from sleep using INT0 and 1 but after a few seconds the onboard LED turns on static (pin 19 for LED) and freezes the Arduino.
But! That doesn’t happen with the provided sleep_28.hex from the SLEEP exampke ZIP-file.

So is there any changes that is causing this issue when I now compile the sleep_28.ld in v5.4.1.1?
Should I change something now to work with the latest build?
Sat Jan 6 2024, 17:16:49, download attachment sleep_28_example.zip
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):