| ??? 01/25/05 13:38 Read: times |
#85749 - Progress!!!!.. But still a small Problem Responding to: ???'s previous message |
Thank you, Russell and Anders.
I have made some progress with this code, but the problem is that only the first Character is transmitted and recieved. The plan was to transmitt one after the other, and on the other side recieve one after the other. But everything stops after the first character. Can I transmitt and recieve a string of letters one after the other like I have done? Below is my code, If anyone can spare the time to go over it, it would be a big help! I thank you for your time! Sun ;**************************************************** TRans ;**************************************************** ORG 0H LJMP MAIN COUNT EQU -10000 ;DELAY MAIN: MOV P0,#0H MOV P1,#0H MOV P2,#0H MOV P3,#00000011b mov 8EH,#00011001B SP_INT: MOV SCON,#52H MOV TMOD,#00100001b MOV TH1,#-13 ;2400 BAUD RATE SETB TR1 LJMP cont INCHAR: JNB RI,$ CLR RI MOV A,SBUF MOV C,P CPL C ; ***TO CHECK FOR PRITY ERROR*** CLR ACC.7 RET OUTCHAR:MOV C,P CPL C MOV ACC.7,C WAIT: JNB TI,WAIT CLR TI MOV SBUF,A CLR ACC.7 RET CONT: setb p1.0 call delay setb p1.2 call delay setb p1.4 call delay setb p1.6 call delay MOV A,#'C' CALL OUTCHAR MOV A,#'B' CALL OUTCHAR MOV A,#'A' CALL OUTCHAR MOV A,#'D' CALL OUTCHAR MOV A,#'E' CALL OUTCHAR MOV A,#'F' CALL OUTCHAR jmp o DELAY: MOV R0,#100 ;1SEC = 100X10000 RPT: MOV TH0,#HIGH COUNT MOV TL0,#LOW COUNT SETB TR0 DLY: JNB TF0,DLY CLR TR0 CLR TF0 DJNZ R0,RPT RET o: end ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ REcv ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ORG 0H LJMP MAIN COUNT EQU -10000 ;DELAY MAIN: MOV P0,#0H MOV P1,#0H MOV P2,#0H MOV P3,#00000011b SP_INT: MOV SCON,#52H MOV TMOD,#00100001b MOV TH1,#-13 ;2400 BAUD RATE SETB TR1 LJMP NEXTX INCHAR: JNB RI,$ CLR RI MOV A,SBUF MOV C,P CPL C ; ***TO CHECK FOR PRITY ERROR*** CLR ACC.7 RET OUTCHAR:MOV C,P CPL C MOV ACC.7,C WAIT: JNB TI,WAIT CLR TI MOV SBUF,A CLR ACC.7 RET NEXTX: setb p1.1 setb p1.3 setb p1.5 setb p1.7 CALL INCHAR NEXT1: CJNE A,#'A',next2 SETB P2.6 CALL INCHAR NEXT2: CJNE A,#'B',NEXT3 CLR P2.1 JMP INCHAR NEXT3: CJNE A,#'C',NEXT4 SETB P2.2 JMP INCHAR NEXT4: CJNE A,#'D',NEXT5 SETB P2.3 JMP INCHAR NEXT5: CJNE A,#'E',NEXT6 SETB P2.4 JMP INCHAR NEXT6: CJNE A,#'F',NEXT7 SETB P2.5 JMP O NEXT7: SETB P3.7 O: end |
| Topic | Author | Date |
| Serial comms problem | 01/01/70 00:00 | |
| TxD pin | 01/01/70 00:00 | |
| Re: | 01/01/70 00:00 | |
| The problem, code (& False Detection??) | 01/01/70 00:00 | |
| Problem code | 01/01/70 00:00 | |
| Your program | 01/01/70 00:00 | |
| Progress!!!!.. But still a small Problem | 01/01/70 00:00 | |
| Progress!!! But still a small problem | 01/01/70 00:00 | |
| clutter | 01/01/70 00:00 | |
| Where TI gets initially set... | 01/01/70 00:00 | |
| Code runs away | 01/01/70 00:00 | |
| Re: | 01/01/70 00:00 | |
| wrong answer | 01/01/70 00:00 | |
| Success!!!! Thank you all | 01/01/70 00:00 | |
| I'd never do a thing like that... ;-) | 01/01/70 00:00 | |
collegue? | 01/01/70 00:00 |



