51 single-chip computer serial port to send Chinese character display garbled problem __ garbled problem

Source: Internet
Author: User

A period of time to do Bluetooth communication, single-chip computer serial port to send the total display garbled characters, the code is as follows:

Send a Byte
void sendbyte (unsigned char dat)
{
sbuf = dat;
while (! TI);
TI = 0;
}

Send a string
void Sendstr (unsigned char *s)
{
while (*s!= ')
{
Sendbyte (*s);
s++;
}
}

Call Sendstr in the main function ("Current data is:");

Observe the serial debugging assistant display is a bunch of garbled characters, however, the Chinese character to English characters or numbers after the display is normal, which indicates that the sending part of the program should be no problem, and then the forum finally found a solution-the compiler bug. If you are still a Keil2 or Keil3 user, do not doubt your own code, this is a vulnerability of the low version Keil compiler, using the revised version of the KEIL4 V9.05 compiled hex file can be resolved. The following is the download address of Keil 4v9.05, with the registration machine, I hope to meet the same problem of friends can be helpful.

Download Address:

1.http://download.csdn.net/detail/rtgchym/4156118

2.http://dl.dbank.com/c0lbyrebao

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.