??? 01/31/05 11:43 Read: times |
#86189 - Compiled your code. Errors shown below Responding to: ???'s previous message |
Hello Mr. Sun Din,
I reformatted your code and compiled it. It has errors which are shown below. You also didn't included an END statement in your original code. I would recommend you look at the basic's for the solution of your problems. Regards, Charles Bannister ps I will leave it to Andy to explain how to format code on this forum. MCS-51 Family Macro Assembler ASEM-51 V1.3 SUNDIN.ASM(57): constant out of range 1 error detected ;************************************************************************************ ; Subject: The whole story..............and problem ; Full Name: Sun Din (Gauteng South Africa) ; Date: 01/31/05 04:25 ; Read: 9 times ; Score: Hasn't been scored ; http://www.8052.com/forum/read.phtml?id=86186 ; Hello all, ; ; I connected a pair is 0.1uf caps across the 5V input to the digital cctry, ; and still it stalls. What gets me is the fact that it stalls in the same ; place and the same outputs are sent high although they have not been set ; anywhere in my code. ; My code is simple, it just sets 7 inputs high 1second after the other ; and then clears all 7 before restarting the loop. ; I am driving 7 12V relays which in turn switch 7 110V pnumatic pistons. ; The stall normally occurs after the first 2 pistons are energised, at this ; point 3 other outputs are set high. These outputs are not mentioned ; anywhere in my code. ; The stall happends randomly, sometimes after 2 cycles and other times after ; many, many cycles but the same outputs are set! ; ; Below, please find my code, although I doubt that this is the problem! ; ; There is another board designed by someone else that uses a PIC and the ; same input and output cctry as I am using including the 0.1 uf caps, this ; board however is powered by a 12V power supply and not the 110V ; switchmode that I am using. ; This board seems to work fine without any hitches. ; ; Now I am really stressing, I cant seem to fix this! ; ; Thank you for your time. ; ; ; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ;************************************************************************************ HUND EQU 100 COUNT EQU -10000 count1 equ -10000 ORG 0 LJMP MAIN ;ORG 0003H ; LJMP EX0ISR ;ORG 0013H ; LJMP EX1ISR MAIN: mov 8EH,#00010001B MOV IE,#00000000B MOV TMOD,#00010001H MOV IP,#00000001B MOV P0,#00011111B MOV P1,#0H MOV P2,#01111111B; for test MOV P3,#00001100B notch0: MOV P1,#00000000B CALL DELAYLOOP SETB P1.1 SETB P1.0 CALL DELAYLOOP SETB P1.3 SETB P1.2 CALL DELAYLOOP SETB P1.4 CALL DELAYLOOP SETB P1.5 CALL DELAYLOOP SETB P1.6 CALL DELAYLOOP LJMP NOTCH0 ;***************************************** ;****************************************************************** DELAYLOOP: MOV R7,#HUND ENTER: MOV TH0,#HIGH COUNT MOV TL0,#LOW COUNT SETB TR0 DELAY: JNB TF0,DELAY CLR TR0 CLR TF0 DJNZ R7,ENTER RET ;****************************************************************** END |