Uart .C; Delay_Try Function - Fujitsu MB2146-450-E Setup Manual

F2mc-8fx mb95f310 series 8-bit microcontroller
Hide thumbs Also See for MB2146-450-E:
Table of Contents

Advertisement

4.2.8 UART .c

In this function, the MCU works in an asynchronous mode, baud rate is generated by
dedicated baud rate generator.
Following table describes the LCD library:
Function Name
void UART_init (void)
void UART_sendbyte (char ch)
__interrupt void UART_REC_INTER(void)
Following table describes how to use these functions.
Type
UART_init();
Send data
UART_sendbyte(0x55);
Receive data
UART_init();

4.2.9 delay_try Function

In this project some instruction need to be delayed, so the delay function must be defined
before using these C file. Following code is the delay_try function.
void delay_try(unsigned char Dat)
{
unsigned char i,j;
for(i=0;i<255;i++)
{
for(j=0;j<Dat;j++)
{
}
}
}
MB2146-450-E Setup Guide
Chapter 4 Sample Code Manual
Example
Operation
__wait_nop();
MCU-AN-500072-E-10 – Page 35
Description
Initializes UART module
Send data ch by UART
Received data by UART when data is arrived
Send out data 0x55 by UART
Global variable PraGlo.Uart_Rec
saved the received data
Return

Advertisement

Table of Contents
loading

Table of Contents