Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FALLING/LOW not working on bare 328 #4

Closed
eried opened this issue Dec 21, 2015 · 3 comments
Closed

FALLING/LOW not working on bare 328 #4

eried opened this issue Dec 21, 2015 · 3 comments
Labels

Comments

@eried
Copy link

eried commented Dec 21, 2015

Does FALLING/LOW requires an external oscillator?

How can I wait for a pin to go LOW using the lowest energy?

IF I use:

while (!digitalRead(SENSOR_PIN));{
sleep.pwrDownMode(); //set sleep mode
sleep.sleepDelay(60000);}

It uses about 4-5 mA, but:

sleep.sleepInterrupt(digitalPinToInterrupt(SENSOR_PIN), RISING);

uses <200 uA ... too bad

sleep.sleepInterrupt(digitalPinToInterrupt(SENSOR_PIN), FALLING);

seems to sleep the atmega forever :/

@nullboundary
Copy link
Collaborator

Hi, Did you figure out the problem? I am pretty sure LOW should work as well as HIGH without the external oscillator.

Maybe there is a problem with the pin change interrupt?

instead of this:
sleep.sleepInterrupt(digitalPinToInterrupt(SENSOR_PIN), FALLING);

try:
sleep.sleepInterrupt(0, FALLING); //number 0 (for digital pin 2) or number 1 (for digital pin 3)

Another thing to try is using LOW instead of FALLING.

Let me know if you can solve this. Thanks!

@eried
Copy link
Author

eried commented Feb 29, 2016

Hey thanks, this is related with the other issue about the calibration. The first calibration was happening = big consumption.

@nullboundary
Copy link
Collaborator

#12 # #9 related to these other issues of calibration and edge vs level interrupts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants