| ??? 10/20/99 10:51 Read: times |
#881 - RE: 8052 program hangs after 150 cycles of loop. |
Hi Ranjit,
You make the call of the subroutine REQUEST_PRINT and in at least in one place you call REQUEST_PRINT again (in body of it) without RETurning from REQUEST_PRINT (See your code fragment). It is recursion I think. Franc Urbanc is quite right: your stack is overflowing for that. Bye, Igor ENCLOSURE: Ranjit code fragment. .......................... START: ACALL INIT_PORTS ACALL REQUEST_PRINT SJMP START .......................... REQUEST_PRINT: ACALL PWR_ON ; MOVE THE BOARD CLR FULL ; REQ. FOR HALF STEP MODE CLR DIR ; SET A DIRECTION JNB I4,MIN_POS JNB I3,MAX_POS MOV R6,#54 ACALL ERROR_DUMP ; CANNOT PRINT, HEAD OUT OF POSITION MIN_POS: MOV R6,#06H ACALL DUMP_HOST MOV R6,#2FH ACALL DUMP_HOST CLR DIR SJMP CONT_HITAM MAX_POS: MOV R6,#06H ACALL DUMP_HOST MOV R6,#2BH ACALL DUMP_HOST SETB DIR CONT_HITAM: ACALL INIT2 ACALL RECEIVE CJNE A,#'.',NOT_QUIT ACALL PWR_OFF NOT_QUIT: CJNE A,#'T',NOT_PRINT .......................... NOT_PRINT: LJMP RESTART .......................... RESTART: L1: MOV R5,#0H SETB HIGH_CURRENT ACALL INIT1 MOV A,#'>' ; COMMAND PROMPT ACALL SEND COMMAND: ACALL INIT2 ACALL RECEIVE CJNE A,#'.',NOT_DOT ; REQUEST TO POWER DOWN ACALL PWR_OFF NOT_DOT: CJNE A,#05H,NOT_06 ACALL INITIALIZE_MOTOR; REQUEST TO INITIALIZE MOTOR NOT_06: CJNE A,#35H,NOT_05 ; REQUEST TO PRINT ACALL REQUEST_PRINT NOT_05: SJMP L1 |
| Topic | Author | Date |
| 8052 program hangs after 150 cycles of loop. | 01/01/70 00:00 | |
| RE: 8052 program hangs after 150 cycles of loop. | 01/01/70 00:00 | |
| RE: 8052 program hangs after 150 cycles of loop. | 01/01/70 00:00 | |
RE: 8052 program hangs after 150 cycles of loop. | 01/01/70 00:00 |



