Why does the SCM send one data and the serial port debugging assistant receive two? Look at the code

Reported answer
Why does the SCM send one data and the serial port debugging assistant receive two? Look at the code
Ask online customer service
Scan the code to ask online customer service
  • Number of answers

    six

  • Number of browses

    3,130

6 answers Default sorting
  • Default sorting
  • Sort by time

Try to make EA and ES equal to zero,,,,,
cancel comment
It can be seen that bit 765 replaces bit 654 and bit 7 is set to 1 after bit 4 is lost

I don't know the details, but I can only guess the reason
One possibility is that the baud rate error is large. You can try to reduce the baud rate, or you can not reduce the baud rate to other baud rates, but you can deliberately slow the transmission baud rate by 5%~10%. Check the phenomenon first
cancel comment
From the perspective of hardware,
First, look at the waveform of the rx pin of the mcu, and confirm that the data sent by the computer has entered the rx
Then check whether the rx interrupt is not on, whether the n, 8, 1 and other things are the same as the computer, and whether the rx interrupt is entered.
Then, there is no such thing. Replace it. The rx circuit is damaged
cancel comment
You can first eliminate the hardware problem and check whether there is a problem with the hardware. I suggest you read a book, Wu Jianying's practical introduction to the single-chip microcomputer, which can be downloaded to the electronic version. The method of communication debugging is described in great detail.
cancel comment
ORG 0000HLJMP MAINORG 0030HMAIN: MOV TMOD,#20H MOV TH1,#0FDH MOV TL1,#0FDH MOV SCON,#40H SETB TR1LOOP: MOV SBUF,A JNB TI,$ CLR TI INC A SJMP LOOP END
cancel comment
Because the interrupt was started but the interrupt program was not written, the interrupt jumped back to the main function after it was sent, and the generated interrupt flag was not clear, so it was sent twice
cancel comment
ZOL Q&A > Solid state hard disk > Other classifications > Why does the SCM send one data and the serial port debugging assistant receive two? Look at the code

report

Thank you for contributing to the harmony of the community. Please select the type of report

Reported successfully

It will be handled after verification
Thank you for your contribution to community harmony

Scan the code to participate in the trial of new products at 0 yuan
You can get the sheets and grand gifts on the top floor

 Scan and pay attention to us
Tips

Are you sure you want to cancel this registration and exit this activity?