sleep and ATtiny15

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello fellow freaks,

I am working on a simple remote control, which should use the sleep instruction. After a interrupt, it should wake up, send some code via IR, return from the interrupt and enter sleep-mode again.

Somehow, my attiny15 does not seem to wake up after a external irq. Anyone had this problem before or does seem familiar to?

Thanks in advance and a happy new year for now!

Marc

structure program is kinda like this:

setup mcu for power down mode, but do not enable the sleep mode
setup all other stuff for mcu

main program:
enable sleep
go to sleep
delay of 512 ms
rjmp to begin main program

irq:
send code

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

do you have a code ? maybe it's the INT vector (wrong position or not programmed?) ATtiny15 don't need stack setup.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Include the setup for the sleep (MCUCR) at least.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you using level-triggered interrupts? It will not wake up from an edge-triggered interrupt in the lowest power sleep mode, but only from a relatively sustained "low" input.

Sean.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey everyone,

finally got to a computer again with internet..

I have solved it after writing code segments, adding functions one at a time. It turned out to be the way the ext-irq was generated (I first used levelchange irq, it has to be low level irq, as noted by Sean).

I also had some trouble not getting back to sleep after the execution of the irq, but that had to do with the way I turned the PWM on and off, and the delays before an out- command becomes effective. Solved that too though :)

Thanks everyone for your help!

Marc