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
  • If you use my UART driver (see links at bottom of my page at http://www.embeddedfw.com) you can insert some test code in the main() function defined in uart.c. If my memory serves me correctly the good ol' 80C552 UART0 is located at the same place as the standard 8051's only UART - thus you shouldn't need to change any of my r_ variable addresses.

    Hope this helps.

    - Mark

Reply
  • If you use my UART driver (see links at bottom of my page at http://www.embeddedfw.com) you can insert some test code in the main() function defined in uart.c. If my memory serves me correctly the good ol' 80C552 UART0 is located at the same place as the standard 8051's only UART - thus you shouldn't need to change any of my r_ variable addresses.

    Hope this helps.

    - Mark

Children
  • you wrote:"Writing the chars back to S0BUF was just inserted for test. If I do not use this line, I get also a wrong message"

    If this is a fact, then writing back is not your problem, you must be writing to the buffer somewhere else.

    Erik

    also when writing, you must cleat TI in the ISR.