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

F2mc-8fx family 8-bit microcontroller mb95310/370 series ev board
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. The baud rate is generated by a
dedicated baud rate generator. In the EV-Board sample code the baud rate is 9600.
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 needs to be delayed, so the delay function must be defined
before using these C files. 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++)
{
}
}
}
EV BOARD MB2146-450-E V1.3
Chapter 4 Sample Code Manual
Example
Operation
__wait_nop();
MCU-AN-500072-E-13 – Page 35
Description
Initialize UART module
Send data ch by UART
Receive 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