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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/30/01 21:45
Read: times


 
#17097 - Serial communications
I wrote this program below and tested it on my simulator and it passed the comm test. When I test it in my unit, I receive a different character in and it never sends anything out. Can anyone tell me what the problem is?

COMMSETUP:

MOV PCON,#080h ;used to double clk speed to 19.2k baud
MOV TCON,#0C0h ; Load 1100 0000
MOV TMOD,#21h ; Load 0010 0001
MOV S0CON,#52h ; Load 0101 0010
MOV TH1,#0FDh ; 19,200 baud 1111 1011


COMMTEST:

JNB RI,COMMTEST ;WAIT FOR COMM TEST BYTE
MOV A,S0BUF ;MOVE O1h TO A
MOV r2,A ;MOVE 01h TO R2
LCALL WRITE ;WRITE 01h TO LCD
MOV r2,#2eh ;MOVE "." TO R2
LCALL WRITE ;MOVE "." TO LCD
CLR RI
MOV A,R2 ;MOVE O1h TO A
MOV S0BUF,A ;MOVE 01h FROM A TO BUFFER
CLR TI

CONTINUE:

JNB RI,CONTINUE ;WAIT FOR "01h"
MOV A,S0BUF ;MOVE "01h" TO A
MOV r2,A ;MOVE "01h" TO R2
LCALL WRITE ;WRITE "01h" to LCD
MOV r2,#2eh ;MOVE "." TO R2
LCALL WRITE ;WRITE "." TO LCD
DJNZ R2,FAIL_TEXT ;IF NOT "0"COMM TEST FAIL
LCALL PASS_TEXT ;IF "0"COMM TEST PASSED
MOV R2,01h ;CLEAR LCD
LCALL INSTR_WR
SJMP DEVICE_SETUP

List of 10 messages in thread
TopicAuthorDate
Serial communications            01/01/70 00:00      
RE: Serial communications            01/01/70 00:00      
RE: Serial communications            01/01/70 00:00      
RE: Serial communications            01/01/70 00:00      
RE: Serial communications            01/01/70 00:00      
RE: Serial communications            01/01/70 00:00      
RE: Serial communications            01/01/70 00:00      
RE: Serial communications Attn: Andi            01/01/70 00:00      
RE: Serial communications Attn: Andi            01/01/70 00:00      
Serial communications - Gerald Johnson            01/01/70 00:00      

Back to Subject List