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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/25/05 08:24
Read: times


 
#85728 - The problem, code (& False Detection??)
Responding to: ???'s previous message
Thank you Anders and Ashish,

Ashish,
Below please find the code for the transmitter and Reciever uC,

What I am Trying to do is transmit "A" in ASCII, and when I Recieve it on the other end Pin 2.0 is set.

I have a loop Continously transmitting "A" & a loop in the reciever continously waiting for the "A"(This was out of desperation :o) )

Also the Datasheet sheet says

"The reciever includes "false detection" by requiring a 0 state eight counts after the first 1-to-0 Transition"

Does this mean that I have to transmit an eight 0 byte before transmitting data?
I know that these are silly questions, but I am at a loss.


**************************************************
TRans
**************************************************
ORG 0H
LJMP MAIN

MAIN: MOV P0,#0H
MOV P1,#0H
MOV P2,#0H
MOV P3,#00000001b

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: ;MOV A,#00000000B ; For false detection, is it needed
;CALL OUTCHAR

setb p1.0
setb p1.2
setb p1.4
setb p1.6
MOV A,#'A' ;P0.0 ON
CALL OUTCHAR
jmp cont

end
***********************************************************


^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
REciever
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ORG 0H
LJMP MAIN

COUNT EQU -10000 ;DELAY

MAIN: MOV P0,#0H
MOV P1,#0H
MOV P2,#0H
MOV P3,#00000001b

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',next1
SETB P2.0
JMP nextx


end

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

List of 16 messages in thread
TopicAuthorDate
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      

Back to Subject List