代码拉取完成,页面将自动刷新
#include "config.h"
#include "stdio.h"
#include "main.h"
#include "Monitor.h"
/*
#define BUF_MAX 20
static DATA BYTE RS_buf[BUF_MAX];
static DATA BYTE RS_in, RS_out;
bit RS_Xbusy=0; // bit RS_Xbusy=0;
*/
/*
* @brief This function initialize UART @9600 baud for 11.0592MHz XTAL.
*
*
* @warning 11.0592MHz XTAL required
*
*
*/
void io_init(void)
{
TMOD |= 0x20; // Timer 1 Mode 2: 8-bit auto-reload Timer/Counter (TL1).(1)Reloaded from TH1 at overflow.
TH1 = 0xFA; // 9600 bauds at 11.0592 MHz
TL1 = TH1;
TCON |= 0x40; // Set to turn on Timer/Counter 1.
SCON |= 0x50; // Set to enable serial reception. 8-bit UART Variable
PCON |= SMOD_; // SMOD0 Set to select double baud rate in mode 1, 2 or 3.
TI=1; // Set by hardware at the end of the 8th bit time in mode 0 or at the beginning of the
// stop bit in the other modes.
}
void main (void) large
{
io_init(); // Initialize UART
ES=1; // Enable UART
printf("\n ATMEL AT89S51 "); // Welcome message
printf("\n Monitor \n\n");
while (1)
{
#ifdef DBG_monitor
while( RS_ready() )
{
Monitor(); // for new monitor functions?
}
#endif // end DBG_monitor
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。