wake up from the sleep mode atmega128

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
hi,
   Good Day, I want to put my controller Atmega128 into the sleep mode,
it is going well but it is not waking up from the idle mode for any
interrupt occure. The actual asm code is as below:

;    3591        sleep_enable();
    CALL _sleep_enable
;    3592        idle();
    CALL _idle


_sleep_enable:
    in   r30,mcucr
    sbr  r30,__se_bit
    out  mcucr,r30
    ret

_sleep_disable:
    in   r30,mcucr
    cbr  r30,__se_bit
    out  mcucr,r30
    ret

_idle:
    in   r30,mcucr
    cbr  r30,__sm_mask
    out  mcucr,r30
    sleep
    ret

can anyone direct me to solve this problem , my advance thanks

with regards
marans


Re: wake up from the sleep mode atmega128
The interrupts you want to use must me enabled.



Re: wake up from the sleep mode atmega128
Dan,
      We enabled all the interrupts whatever we used, we  didn't block
any one them. Stil that problem is coming (not waking up from the idle
mode for any interrupt). We tried to simulate the above code , but the
program flow caught up in the ' sleep ' instruction itself, it is not
coming out from that line for timer overflow interrupt , but it should
come out. Thank you for your reply.

with regards
marans


Re: wake up from the sleep mode atmega128
snipped-for-privacy@gmail.com says...
Quoted text here. Click to load it

Above code?  There is no above code.  

Robert

Re: wake up from the sleep mode atmega128

Quoted text here. Click to load it

Are the interrupts working before the sleep instruction? Do you have the
global interrupt enable flag on?

Jeroen



Site Timeline