- /*---------------------------------------------------------------------------------------------------------*/
- /* */
- /* Copyright(c) 2017 Nuvoton Technology Corp. All rights reserved. */
- /* */
- /*---------------------------------------------------------------------------------------------------------*/
- //***********************************************************************************************************
- // Website: http://www.nuvoton.com
- // E-Mail : MicroC-8bit@nuvoton.com
- // Date : Jan/21/2017
- //***********************************************************************************************************
- //***********************************************************************************************************
- // File Function: N76E003 GPIO demo code
- //***********************************************************************************************************
- #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)
- {
- InitialUART1_Timer3(115200);
- TI_1 = 1;
- while(1)
- {
- printf("\n hello world");
- Timer0_Delay1ms(300);
- }
- }
- /***********************************************************************/
- /* This file is part of the C51 Compiler package */
- /* Copyright KEIL ELEKTRONIK GmbH 1990 - 2002 */
- /***********************************************************************/
- /* */
- /* PUTCHAR.C: This routine is the general character output of C51. */
- /* You may add this file to a uVision2 project. */
- /* */
- /* To translate this file use C51 with the following invocation: */
- /* C51 PUTCHAR.C <memory model> */
- /* */
- /* To link the modified PUTCHAR.OBJ file to your application use the */
- /* following Lx51 invocation: */
- /* Lx51 <your object file list>, PUTCHAR.OBJ <controls> */
- /* */
- /***********************************************************************/
- //#include <reg51.h>
- #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.
- /****************************************************************************/
- #if 1
- char putchar (char c) //for UART1_printf
- {
- while (!TI_1); /* wait until transmitter ready */
- TI_1 = 0;
- SBUF_1 = c; /* output character */
- return (c);
- }
- #else
- /*
- * putchar (mini version): outputs charcter only
- */
- char putchar (char c) //for UART0_printf
- {
- while (!TI);
- TI = 0;
- return (SBUF = c);
- }
- #endif
|