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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/19/01 22:38
Read: times


 
#12634 - AT89C52 Serial Port
Greets,
First off, before I get flames that I did not read the faq, let me say that I have read the faq on the serial port.

That being said, here is my problem:
I've written a very simple program to attempt to communicate with the serial port. The simulator states that the code works properly. (Pinnacle) Once loaded and powered, I notice that there is nothing at all being transmitted on the TXD pin of the AT89C52 (Pin 13, PLCC-44 package). This is verified with the use of an oscilloscope.

Through numerous attempts as what the hardware problem may be, (I've used 2 AT89C52s) I believe it is a software issue. (This is also the first 8052 code i've written.)

The Following is the program:

STACKADDR equ 030H

START:
ORG 00H
MOV SP,#STACKADDR
MOV TMOD,#20h
;Timer 1 in Auto-reload mode
MOV TH1,#0FDh
;Reload value for 19200 baud @ 11.059 Mhz
MOV SCON,#52H
SETB TR1 ;Turn on timer 1
MOV A,PCON ;Get current value of PCON SFR
SETB ACC.7 ;Set the SMOD bit
MOV PCON,A ;Update the value of the PCON SFR

LoopIn:
CLR TI
MOV SBUF,#'>'
JNB TI,$
JMP LoopIn
; SHOULD HELL HAPPEN AND WE GET HERE,
; POST A NOTICE
MOV A,#0AAH
MOV DPTR,#0FFFFH
MOVX @DPTR,A
JMP START

END


If anyone reads this and can find a flaw with this code, please feel free at this point to flame me :)
(also mention, if you would, the problem and how to fix it.)

Thanks to every reader.


List of 10 messages in thread
TopicAuthorDate
AT89C52 Serial Port            01/01/70 00:00      
RE: AT89C52 Serial Port            01/01/70 00:00      
RE: AT89C52 Serial Port            01/01/70 00:00      
RE: AT89C52 Serial Port            01/01/70 00:00      
RE: AT89C52 Serial Port            01/01/70 00:00      
RE: AT89C52 Serial Port            01/01/70 00:00      
RE: Serial Port... George            01/01/70 00:00      
RE: Serial Port... George            01/01/70 00:00      
RE: AT89C52 Serial Port            01/01/70 00:00      
RE: AT89C52 Serial Port            01/01/70 00:00      

Back to Subject List