Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Thread Closed: Issue successfully resolved

???
10/02/03 13:04
Read: times


 
#55925 - RE: RS232 Serial port problem
Responding to: ???'s previous message
Hi Shahzad;
What is your Xtal frequency? The baudrate depends on Xtal freq. For details of initialization read the "MCS 51 MICROCONTROLLER FAMILY USER'S MANUAL" that is in the links. A sample/simple program may be written as:
ORG 0000H
JMP START

START:
MOV TMOD,#20H ; USE TIMER 1 FOR BAUD RATE GENERATION
MOV SCON,#50H ;
MOV TH1,#0FDH ; 1 N 8 9600 BAUD CONFIG. FOR 11.0592 MHZ XTAL
SETB TR1 ; START TIMER

MAIN: MOV DPTR,#MSG ; MESSAGE THAT WILL BE SENT
MOV R7,#4 ; LENGTH OF MESSAGE
LOOP: CLR A
MOVC A,@A+DPTR ; GET FIRST BYTE
MOV SBUF,A ;
JNB TI,$ ; WAIT FOR TRANSMISION
CLR TI
INC DPTR ; POINT TO THE NEXT BYTE
DJNZ R7,LOOP
CALL DELAY ; WAIT
JMP MAIN

MSG: DB 'TEST' ; MESSAGE

DELAY: MOV R6,#250
DELA: MOV R5,#250
DELB: NOP
NOP
DJNZ R5,DELB
DJNZ R6,DELA
RET
END

Also I recomend you to test with Hyper Term instead of your VB program. To be able to find the problem (AT89? or your VB program?)
Regards.
Ertan

List of 35 messages in thread
TopicAuthorDate
RS232 Serial port problem            01/01/70 00:00      
   RE: RS232 Serial port problem            01/01/70 00:00      
   RE: RS232 Serial port problem            01/01/70 00:00      
      RE: RS232 Serial port problem            01/01/70 00:00      
         RE: RS232 Serial port problem            01/01/70 00:00      
            RE: RS232 Serial port problem            01/01/70 00:00      
               RE: RS232 Serial port problem            01/01/70 00:00      
               RE: RS232 Serial port problem            01/01/70 00:00      
            RE: RS232 Serial port problem            01/01/70 00:00      
   RE: RS232 Serial port problem            01/01/70 00:00      
   RE: RS232 Serial port problem            01/01/70 00:00      
   RE: RS232 Serial port problem            01/01/70 00:00      
   RE: RS232 Serial port problem            01/01/70 00:00      
   RE: RS232 Serial port problem            01/01/70 00:00      
      RE: RS232 Serial port problem            01/01/70 00:00      
      RE: RS232 Serial port problem            01/01/70 00:00      
      RE: RS232 Serial port problem            01/01/70 00:00      
   RE: RS232 Serial port problem            01/01/70 00:00      
      RE: RS232 Serial port problem            01/01/70 00:00      
      RE: RS232 Serial port problem            01/01/70 00:00      
         RE: RS232 Serial port problem            01/01/70 00:00      
            RE: RS232 Serial port problem            01/01/70 00:00      
               RE: RS232 Serial port problem            01/01/70 00:00      
                  RE: RS232 Serial port problem            01/01/70 00:00      
                     RE: RS232 Serial port problem            01/01/70 00:00      
                        RE: RS232 Serial port problem            01/01/70 00:00      
                           RE: RS232 Serial port problem            01/01/70 00:00      
                              RE: RS232 Serial port problem            01/01/70 00:00      
                                 RE: RS232 Serial port problem            01/01/70 00:00      
                                    RE: RS232 Serial port problem            01/01/70 00:00      
   RE: RS232 Serial port problem            01/01/70 00:00      
      RE: RS232 Serial port problem            01/01/70 00:00      
         RE: RS232 Serial port problem            01/01/70 00:00      
            RE: RS232 Serial port problem            01/01/70 00:00      
   RE: RS232 Serial port problem            01/01/70 00:00      

Back to Subject List