5455 views|2 replies

931

Posts

3

Resources
The OP
 

The microcontroller sends data, and the serial port assistant receives 0\ [Copy link]

When the 51 MCU sends a string, all the characters displayed on the serial port debugger are "0\". During debugging, I display each character on LCD1602 first, and then send it to SBUF, but the computer cannot receive these characters. What is the reason? The following figure shows the received content:


This post is from 51mcu
 

931

Posts

3

Resources
2
 
void Init_timer(void) //Timer 1=0010 Timer 0=0001 { TMOD = 0x21; //???ù?????? SCON = 0x40; //Set to 0x80 and the result is the same TH1 = 0xFD; //Baud rate 9600 TL1 = TH1; PCON = 0x00; //Do not multiply// EA = 1; //Do not receive data// ES = 1; //Do not receive data} Code for sending characters: void StartRs232(void) { TR1=1; //???????? for (i=0; i<16; i++)//???????????????????????? { LcdWriteCom(0x8f); //??????????????????????????? LcdWriteData(CsSz[i]); SBUF = CsSz[i]; while(!TI); //?????????????? TI=0; //????????????λ } }
This post is from 51mcu
 
 
 

931

Posts

3

Resources
3
 
This post was last edited by hujj on 2018-8-31 19:44 I added the sending code according to the information, and sent data to the microcontroller through the serial port assistant, and the returned characters can be received normally. See the figure below: Note: This may only be the sent data, not the received returned data.
This post is from 51mcu
 
 
 

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list