51 Study Notes: Using printf to print serial port data

Publisher:CaptivatingGazeLatest update time:2024-07-24 Source: cnblogs Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

#include

#include

void UartInit(void) //Initialize the baud rate to 9600

{

SCON=0x50;

TMOD=0x20;

TCON=0x40;

TH1=0xfd;

TI=1;

TR1=1;

}

void main()

{

UartInit();

printf("hello world"); //output data once

while(1);

}


Reference address:51 Study Notes: Using printf to print serial port data

Previous article:51 Study Notes: Using Bus to Connect 1602 and 8051
Next article:51 Study Notes: Using hardware spi and max6675 communication to realize K-type thermocouple temperature measurement

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号