本帖最后由 zhuotuzi 于 2018-9-6 10:33 编辑
先看代码
#include "N76E003.h"
#include "SFR_Macro.h"
#include "Function_define.h"
#include "Common.h"
#include "Delay.h"
unsigned char temp _at_ 0x08;
unsigned char idata itemp _at_ 0x80;
unsigned char xdata xtemp _at_ 0x80;
/*==========================================================================*/
void main (void)
{
InitialUART0_Timer3(115200);
TI = 1; // Important, use prinft function must set TI=1;
while(1)
{
printf("\n Hello world");
Timer0_Delay1ms(300);
}
}
另外还有一个文件
#include "N76E003.h"
/****************************************************************************/
/* Define putchar send from UART1, printf function will send from P1.6(TXD_1)
/* NOTICE: Since UART1 pin is multi-function with OCD DATA/CLK pin.
/* Suggest download than use run with realchip but not OCD mode.
/****************************************************************************/
/*
* putchar (mini version): outputs charcter only
*/
#if 0
char putchar (char c)
{
while (!TI_1); /* wait until transmitter ready */
TI_1 = 0;
SBUF_1 = c; /* output character */
return (c);
}
#else
char putchar (char c) {
while (!TI);
TI = 0;
return (SBUF = c);
}
#endif
|