⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 pic 实例源程序 有需要的兄弟久拿走啊 别客气 哈哈 我会继续努力的
💻 C
字号:
#include <REG52.H>                /* special function register declarations   */
                                  /* for the intended 8051 derivative         */

#include <stdio.h>                /* prototype declarations for I/O functions */

#ifdef MONITOR51                         /* Debugging with Monitor-51 needs   */
char code reserve [3] _at_ 0x23;         /* space for serial interrupt if     */
#endif                                   /* Stop Exection with Serial Intr.   */
                                         /* is enabled                        */
/*------------------------------------------------
The main C function.  Program execution starts
here after stack initialization.
------------------------------------------------*/

#define TxDATA (unsigned char xdata *)0x1000
void initial(void);
unsigned char xdata *p;

int i=0;
main()
{
	initial();
	p=TxDATA;
	ACC=p[0];
	SBUF=ACC;
	
	while(1)
	{
		if(i<0x4F)printf("%c",p[i++]);
	}
}


void initial(void)
{
	IE=0x00;              //中断禁止
	TCON=0x05;
	TMOD=0x20;            //定时器1为自动装入(auto-load)方式
	
	PCON=0;               //SMOD(PCON.7)=1时,baudrate doubled.//smod=1 (11M晶振时为0)
	
	SCON=0xD0;            //串行口工作方式 : 9位UART, 波特率可变
	TH1=0xf3;
	TL1=0xf3;             //
	PCON=0x80|PCON;	      //波特率设置 : 9600 baud(E8--24MHZ)
	TR1=1;                //启动定时器1
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -