- /*---------------------------------------------------------------------------------------------------------*/
- /* */
- /* Copyright(c) 2019 Nuvoton Technology Corp. All rights reserved. */
- /* */
- /*---------------------------------------------------------------------------------------------------------*/
- //***********************************************************************************************************
- // Website: http://www.nuvoton.com
- // E-Mail : MicroC-8bit@nuvoton.com
- //***********************************************************************************************************
- #include "ML51.h"
- /**
- * @brief UART1 use as printf.
- * @param None
- * @return None
- * @details None
- */
- void main (void)
- {
- /**
- For UART1 P2.3 as TXD1 / P2.3 as RXD1 GPIO setting
- * include gpio.c in Common Setting for UART0
- */
- MFP_P23_UART1_TXD; // UART0 TXD use P0.5
- P23_QUASI_MODE; // set P0.5 and P0.6 as Quasi mode for UART0 trasnfer
- /**
- For UART1 initial setting
- * include uart.c in Common Setting for UART0
- */
- UART_Open(24000000,UART1,115200); // Open UART0 use timer1 as baudrate generate and baud rate = 115200en(24000000,UART0_Timer1,115200); // Open UART0 use timer1 as baudrate generate and baud rate = 115200
- set_S1CON_TI_1; // printf must first set TI_1 =1;
-
- /**
- UART1 loop test
- UART1 TXD1 send data received by RXD1 pin. Connect TXD1 pin and RXD1 pin check result.
- */
- while(1)
- {
- printf ("\n hello world! " );
- Timer2_Delay(24000000,128,1000,1000); //Means timer base 24MHz, divider 128, delay time 100 ms (100000us)
- }
- }
|