??? 03/01/09 22:24 Read: times |
#162986 - serial comm problem |
Hi all,
I have been working through the RS232 guide on this website and think I have successfully interfaced to my 8052 derivative (ADuC831) using a MAX232EIN chip. Using the code below, I get the same character back from the uC when sending characters to the chip using HyperTerminal just like I should. $MOD52 CSEG ORG 0000H Loop: MOV C,P3.0 MOV P3.1,C SJMP Loop When using the section of code below, I get the stream of "U" characters from the uC when connected to it in Hyperterminal like I should. $MOD52 CSEG ORG 0000h LJMP BEGIN ORG 40h BEGIN: MOV SCON,#01110000B ; Mode 1/Stop b/Rec en/x/x/Flags MOV TH1,#0FDh ; Reload value for 9600 Bd MOV TCON,#01010101B ; Fl1/Tim1 on/Fl0/Tim0 on/Ext1-edge/Ext0-edge MOV TMOD,#00100001B ; Gate1/Timer/Mode 2/Gate0/Timer/Mode 1 START: MOV SBUF,#55H SERWT: JNB SCON.1, SERWT CLR SCON.1 AJMP START However, using the code below, I do not get a character echoed back from my chip while in HyperTerminal like I should. $MOD52 CSEG ORG 0000h LJMP BEGIN ORG 40h BEGIN: MOV SCON,#01110000B ; Mode 1/Stop b/Rec en/x/x/Flags MOV TH1,#0FDh ; Reload value for 9600 Bd MOV TCON,#01010101B ; Fl1/Tim1 on/Fl0/Tim0 on/Ext1-edge/Ext0-edge MOV TMOD,#00100001B ; Gate1/Timer/Mode 2/Gate0/Timer/Mode 1 START: JNB RI,START CLR RI MOV A,SBUF MOV SBUF,A AJMP START Any idea what the problem is? Given the fact that the other two tests work, can the problem still be hardware or do you think it's software? I have looked it over but being fairly new to serial com via a uC, I can't seem to find the problem. Your advice is appreciated. Brian |
Topic | Author | Date |
serial comm problem | 01/01/70 00:00 | |
what about TI? | 01/01/70 00:00 | |
thank you | 01/01/70 00:00 | |
Be better... | 01/01/70 00:00 | |
no luck | 01/01/70 00:00 | |
Settings | 01/01/70 00:00 | |
What is your XTAL frequency ? | 01/01/70 00:00 | |
parity and XTAL | 01/01/70 00:00 | |
Eh ? | 01/01/70 00:00 | |
one or the other | 01/01/70 00:00 | |
my mistake | 01/01/70 00:00 | |
scope pictures | 01/01/70 00:00 | |
whatizit? | 01/01/70 00:00 | |
where I measured it... | 01/01/70 00:00 | |
waveforms look OK | 01/01/70 00:00 | |
question | 01/01/70 00:00 | |
LSBit comes first after startbit | 01/01/70 00:00 | |
cable | 01/01/70 00:00 | |
isolation and ESD protection | 01/01/70 00:00 | |
I have blown very few, if any, MAX232's![]() | 01/01/70 00:00 | |
Your scope trace looks normal | 01/01/70 00:00 | |
more pics | 01/01/70 00:00 | |
show picture at PC side | 01/01/70 00:00 |