??? 07/13/06 10:53 Read: times |
#120170 - at89s8253 wakes up only once from pwr down. |
I have a very strange behaviour: after a RESET i put the at89s8253 to sleep, can wake up with INT1, go back to sleep, but can't wake up again !
at89s8253 is running at 5V with a 11MHz crystal and has a supervisor. Here the very basic code used : MAIN_STACK EQU 0E0H ;stack pointer initial value IDLE_MODE EQU 081H ;idle mode (SMOD = 1) DOWN_MODE EQU 002H ;power down mode ;output control pins definition LEDR_PIN EQU 0A6H ;(P2.6) LEDR pin: red led output LEDG_PIN EQU 0A7H ;(P2.7) LEDG pin: green led output BUZZ_PIN EQU 090H ;(P1.0) BUZ pin: buzzer output $REGISTERBANK(0) ;register bank 0 $INCLUDE(LP_INT.INC) ;CPU configuration NAME LP_VECT EXTRN CODE (MAIN_INIT) ;main initialisation EXTRN CODE (MAIN_RESET) ;main initialisation EXTRN CODE (MAIN_INT1) ;main initialisation ;Exeption vectors ;reset vector CSEG AT 00000H VECT_RESET: AJMP MAIN_RESET ;main initialisation ;external interrupt 0 vector CSEG AT 00003H VECT_INTR0: AJMP MAIN_INIT ;main initialisation ;timer 0 interrupt vector AJMP MAIN_INIT ;main initialisation ;external interrupt 1 vector CSEG AT 00013H VECT_INTR1: AJMP MAIN_INT1 ;not used ;timer 1 interrupt vector CSEG AT 0001BH VECT_TMR1: AJMP MAIN_INIT ;not used ;serial port interrupt vector CSEG AT 00023H VECT_SER: AJMP MAIN_INIT ;main initialisation ;timer 2/I2C interrupt vector CSEG AT 0002BH VECT_TMR2: AJMP MAIN_INIT ;main initialisation END $REGISTERBANK(0) ;register bank 0 $INCLUDE(LP_INT.INC) ;CPU definition $INCLUDE(LP_CST.INC) ;constants definition NAME LP_MAIN PUBLIC MAIN_INIT ;main initialisation PUBLIC MAIN_RESET ;main initialisation PUBLIC MAIN_INT1 ;main initialisation ;**************************************************************** INT_CODE SEGMENT CODE INBLOCK ;**************************************************************** RSEG INT_CODE MAIN_RESET: CLR LEDR_PIN ;led red = reset SJMP MAIN_EXEC MAIN_INT1: CLR LEDG_PIN ;led green = interrupt 1 MAIN_EXEC: MOV P0,#0E3H ;port 0 initialisation CLR A ;all zero MOV IE,A ;disable all interrupts ;system initialisation MOV SP,#MAIN_STACK-1 ;stack pointer initialisation MOV PSW,A ;select bank 0 MOV TCON,#00000101B ;external edge interrupt MOV PCON,#10000100B ;power control disable MOV 08EH,#000H CLR BUZZ_PIN ;buzzer on ACALL MAIN_WAIT ;1 sec SETB BUZZ_PIN ;buzzer off ACALL MAIN_WAIT ;1 sec CLR BUZZ_PIN ;buzzer on ACALL MAIN_WAIT ;1 sec MAIN_INIT: CLR A MOV IE,A ;disable all interrupts MOV TCON,A ;external level interrupt 1 MOV P0,#022H ;unused bits to 0 MOV P1,#0FFH ;all port high MOV P2,#0FFH ;all port high MOV P3,#0FFH ;all port high MOV IE,#(1 SHL EA_BIT OR 1 SHL EX1_BIT) MOV PCON,#DOWN_MODE ;power down MAIN_INIT_0: SJMP MAIN_INIT_0 ;wait: about 1 sec MAIN_WAIT: MOV R4,#10 MAIN_WAIT_0: MOV R3,#200 MAIN_WAIT_1: MOV R2,#250 MAIN_WAIT_2: DJNZ R2,MAIN_WAIT_2 DJNZ R3,MAIN_WAIT_1 DJNZ R4,MAIN_WAIT_0 MAIN_WAIT_3: RET ;**************************************************************** END |
Topic | Author | Date |
at89s8253 wakes up only once from pwr down. | 01/01/70 00:00 | |
i tried | 01/01/70 00:00 | |
unformatted code | 01/01/70 00:00 | |
sure you can | 01/01/70 00:00 | |
...formatted code | 01/01/70 00:00 | |
mismatch | 01/01/70 00:00 | |
nothing else to do. | 01/01/70 00:00 | |
you should exit the interrupt by reti.. | 01/01/70 00:00 | |
Why does everyone insist on doing things WITHOUT e | 01/01/70 00:00 | |
And then ? | 01/01/70 00:00 | |
all true, but ... | 01/01/70 00:00 | |
Additional input | 01/01/70 00:00 | |
Re: at89s8253 wakes up only once from pwr down. | 01/01/70 00:00 | |
Thanks, everything OK | 01/01/70 00:00 | |
but you did not do so![]() | 01/01/70 00:00 |