This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problems with serial communication

I have implemented a new serial data transfer protocol in our 8051 system (80C552).

I tryed to write the received characters immediately back to the terminal with the following commands:

	ucrs232_buffer[ucrec_count] = S0BUF;
	S0BUF = ucrs232_buffer[ucrec_count];
This two command lines are performed in the ISR. I wrote 16 chars and got back 13 completly different ones.

If I send a message from the 80C51 to the terminal its correct! Also the command from the terminal is correct.

What can be the reason for this wrong reception?

Parents
  • "The baud rate is 9600. My OSC=15MHz -->9765bps. This is not so good but it worked with the old protocol"

    Just because something doesn't fail doesn't meant that it's actually working properly! ;-)

    That sounds a pretty large baudrate error!! :-0

    As recommended on the Keil baudrate calculator
    http://www.keil.com/c51/baudrate.asp
    "For the best results, you should choose baud rates that are accurate to +/-1% or better."

    I think you could just have been lucky that it ever worked!!

Reply
  • "The baud rate is 9600. My OSC=15MHz -->9765bps. This is not so good but it worked with the old protocol"

    Just because something doesn't fail doesn't meant that it's actually working properly! ;-)

    That sounds a pretty large baudrate error!! :-0

    As recommended on the Keil baudrate calculator
    http://www.keil.com/c51/baudrate.asp
    "For the best results, you should choose baud rates that are accurate to +/-1% or better."

    I think you could just have been lucky that it ever worked!!

Children