??? 06/21/06 14:24 Read: times |
#118742 - PC sending Not Received at MCU |
Dear All,
AOA I am trying to send the data from PC, MCU, And MCU to echo same data But MCU is sending the data to PC, But when I send the command from PC to MCU, It Wont works.... About Code: After starting MCU is sending 'L', And whatever PC send to MCU, I will ECHO. 4800 baud are being use by PC program. With No hand-shaking, I am using MSCOMM Control. Plz help to resolve the issue. Hardware connections are: PC Max232 MICROCONTROLLER P5(gnd) --> Pin 15 of Max232 ---> common gnd On MCU pin 2(Rx) --> pin 14 of MAX232 ---> pin 11 of MAX232 ---> pin 11(txd) Pin 3 txd --> pin 13 of Max232 pin 12 of MAX232---> Pin 10 (rxd) All capacitor for MAX232CPE IS 1UF 50V ORG 0 LJMP MAIN ORG 23H LJMP SERIAL ORG 30H MAIN: MOV P1,#0FFH MOV TMOD,#20H MOV TH1,#0FAH MOV SCON,#50H MOV IE,#10010000B SETB TR1 MOV R0,#'L' BACK: CPL P1.2 MOV A,R0 MOV SBUF,A JNB TI,$ AGN: INC R3 ACALL DELAY ACALL DELAY ACALL DELAY ACALL DELAY CJNE R3,#0FH,AGN MOV R3,#00H SJMP BACK ;;;;;;;;;;; SERIAL: JNB RI,TRANS MOV A,SBUF MOV R0,A CLR RI RETI TRANS: CLR TI RETI ;;;;;;DELAY DELAY: MOV R1,#00H AGAIN: INC R1 CJNE R1,#0FFH,AGAIN RET END |