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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/01/03 14:56
Read: times


 
#37991 - RE: sending pc data serially to 89c52
try this one.

CALL INITIALIZE
LOOP:
CALL READ_SERIAL
MOV P1,A
JMP LOOP

;**************************************************************************
;
INITIALIZE: ;set up control registers
;
MOV TH1, #0FDH ;Set up for 9600 baud rate xtal 11.0592Mhz
MOV SCON, #01010000B ;Mode = 8 bit UART
MOV TMOD, #00100001B ;Sets Timer1 to 8 bit auto reload
MOV TCON, #01000000B ;Turns Timer1 on

RET
;
;**************************************************************************
; This routine transmits the value in A through the serial port.
;
SEND:
CLR TI ;Clear Timer1 Flag
MOV SBUF, A ;Transmit Byte
WAIT:
JNB TI, WAIT ;Wait for transmission to be completed.
RET

;**************************************************************************
; This routine recive the value form PC through the serial port.
;
read_serial:

JNB RI, $ ;Wait for RX to be completed.
clr RI
MOV SBUF, A ;Recived Byte
RET


List of 9 messages in thread
TopicAuthorDate
sending pc data serially to 89c52            01/01/70 00:00      
   RE: sending pc data serially to 89c52            01/01/70 00:00      
   RE: sending pc data serially to 89c52            01/01/70 00:00      
RE: sending pc data serially to 89c52            01/01/70 00:00      
RE: sending pc data serially to 89c52            01/01/70 00:00      
RE: sending pc data serially to 89c52            01/01/70 00:00      
RE: sending pc data serially to 89c52            01/01/70 00:00      
   RE: sending pc data serially to 89c52            01/01/70 00:00      
RE: sending pc data serially to 89c52            01/01/70 00:00      

Back to Subject List