AT89C52 and SC16C2550B interfacing

Status
Not open for further replies.

vlawp

New Member
Hello,
I'm interfacing the AT89C52 to SC16C2550B dual UART. I'm facing a major problem in writing to the registers. I have some debug messages telling me the contents of the registers after I write them. Every time I write to the registers(when I reset the 8051) it comes up with different values which means that it writes the correct value sometimes and does not write the correct value rest of the time. Can anyone tell me what is the problem? or how can I fix it.

Thank you in advance.

Debug output(1st reset)
-------------
Welcome to CSAC-I
Compile ID: 59
LCR 0x03 //correct. Written 0x03
ISR 0x01 //Wrong. Should have come up with 0xC1 when FCR=0x07
MCR 0x1B //Correct. Written 0x1B
IER 0x03 //Correct. Should come up with 0x03 when Intr. enabled

Debug output(2nd reset)
-------------
Welcome to CSAC-I
Compile ID: 59
LCR 0x01 //Wrong. Should be 0x03
ISR 0x01 //Wrong. Should have come up with 0xC1 when FCR=0x07
MCR 0x01 //Wrong. Should be 0x1B
IER 0x03 //Correct. Should come up with 0x03 when Intr. enabled

and so on..
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…