Sample Program For Uart - Fujitsu MB90460 Series Hardware Manual

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

CHAPTER 17 UART
17.9

Sample Program for UART

This section contains a sample program for UART.
■ Sample Program for UART
Processing specifications
The UART1 bidirectional communication function (normal mode) is used to perform serial transmission
and reception.
• Operation mode 0, asynchronous mode, eight data bits, two stop bits and no parity are set.
• The P60/SIN1 and P61/SOT1 pins are used for communication.
• The dedicated baud rate generator is used and the baud rate is set to about 9600 bps.
• Character 13
• The machine clock (φ) is assumed to be 16 MHz.
Coding example
ICR13
DDR6
CDCR1
SMR1
SCR1
SIDR1
SODR1
SSR1
REC
;-------Main program------------------------------------------------------------------------------------------------
CODE
START:
;
510
is transmitted from the SOT1 pin and is received using an interrupt.
H
EQU
0000BDH
EQU
000016H
EQU
00001BH
EQU
000024H
EQU
000025H
EQU
000026H
EQU
000026H
EQU
000027H
EQU
SCR1:2
CSEG
ABS = 0FFH
:
AND
CCR,#0BFH
MOV
I:ICR13,#00H
MOV
I:DDR6,#00000000B
MOV
I:CDCR1,#080H
MOV
I:SMR1,#00010001B
MOV
I:SCR1,#00010011B
;UART1 transmission and reception interrupt control register
;Port-6 data direction register
;Communication prescaler register 1
;Mode control register 1
;Control register 1
;Input data register 1
;Output data register 1
;Status register 1
;Reception error flag clear bit
;Assumes that stack pointer (SP) has already been
; initialized
;Disables interrupts
;Interrupt level 0 (highest)
;Sets SIN1 pin as input pin
;Enables communication prescaler
;Operation mode 0 (asynchronous)
;Uses dedicated baud rate generator (9615 bps)
;Disables clock pulse output and enables data output
;No parity and two stop bits
;Clears eight data bits and reception error flag

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb90465 series

Table of Contents