CHAPTER 14 8-BIT SERIAL I/O

14.11Program Example for 8-Bit Serial I/O

This section provides program example for 8-bit serial I/O.

Program Example for 8-bit Serial Output

Processing Specifications

The 8-bit serial output program outputs 8-bit serial data (55H) from the SO pin of the 8-bit serial I/O. When serial I/O transfer terminates, an interrupt occurs.

The program resets transfer data with the interrupt processing routine and outputs it continuously.

The program operates in accordance with the internal shift clock. This clock is output from the SCK pin.

If the shift clock is 32tINST when the maximum gear speed (1 instruction cycle = 4/FCH) at the 12.5- MHz oscillation (FCH), the transfer rate and interrupt cycle are as follows:

Transfer rate = 12.5 MHz/4/32 = 97.7 kbps, interrupt cycle = 8 32 4/10 MHz = 81.92 s

Coding example

SMR

EQU

0039H

;

Address of serial mode register

SDR

EQU

003AH

;

Address of serial data register

SSEL

EQU

003BH

;

Address of serial/UART selection register

SIOF

EQU

SMR:7

;

Defines the interrupt request flag bit.

SST

EQU

SMR:0

;

Defines the serial I/O transfer start bit.

ILR4

EQU

007EH

;

Address of interrupt request setting register 4

INT_V

DSEG

ABS

; [DATA SEGMENT]

 

ORG

0FFE2H

 

 

IRQC

DW

WARI

;

Sets an interrupt vector.

INT_V

ENDS

 

 

 

;--------------------

Main program--------------------------------------------------------------------------

 

 

CSEG

 

; [CODE SEGMENT]

 

 

 

; The stack pointer (SP), etc., are already initialized.

 

:

 

 

 

 

CLRI

 

;

Disables interrupts.

 

CLRB

SST

;

Stops serial I/O transfer.

 

MOV

ILR4,#11111101B

;

Sets the interrupt level to 1.

 

MOV

SDR,#55H

;

Sets transfer data (55H).

 

MOV

SMR,#01111000B

;

Clears the interrupt request flag, allows the interrupt

 

 

 

 

request output, shift clock output (SCK), and serial data

 

 

 

 

output (SO), selects 32tINST, and sets LSB first.

 

MOV

SSEL,#00000001B

;

Selects the 8-bit serial I/O.

 

SETB

SST

;

Starts serial I/O transfer.

 

SETI

 

;

Enables interrupts.

 

:

 

 

 

336

Page 352
Image 352
Fujitsu MB89202, F202RA manual Program Example for 8-Bit Serial I/O

F202RA, MB89202 specifications

The Fujitsu MB89202 and F202RA microcontrollers are part of the 16-bit microcontroller family, renowned for their robust performance and versatility in a variety of embedded system applications. These devices are tailored for high-efficiency operation across diverse industries, including automotive, consumer electronics, and industrial automation.

One of the main features of the MB89202 is its powerful CPU core, which operates at a clock speed of up to 20 MHz. This enables the microcontroller to perform complex calculations and consumer-grade applications seamlessly. The architecture is designed to handle multiple tasks effectively, making it suitable for real-time operations.

Memory capacity is a vital characteristic of the MB89202, featuring on-chip RAM and ROM configurations. The microcontroller can accommodate different memory variants, providing developers with flexibility in memory allocation based on their application requirements. This adaptability facilitates applications ranging from simple control systems to complex data processing tasks.

The F202RA variant extends the capabilities of the MB89202 by integrating advanced peripheral functions. It includes built-in timers, A/D converters, and serial communication interfaces, which are essential for interfacing with other hardware components or sensors. The availability of these peripherals reduces the need for additional external circuits, thus contributing to a more compact and cost-effective design.

In terms of power management, the MB89202 series employs advanced power-saving technologies. The microcontroller offers various low-power modes, enabling devices to conserve energy during idle times, making it highly suitable for battery-operated applications. This characteristic not only enhances the efficiency of devices but also extends their operational lifespan.

Moreover, the Fujitsu MB89202 series incorporates robust protection features, including watchdog timers and failure detection mechanisms. These safety features ensure reliable operation in critical systems, making them a preferred choice in applications where failure is not an option.

The MB89202 and F202RA microcontrollers also support a range of development tools and environments, including integrated development environments (IDEs) and software libraries, which facilitate rapid application development. With these tools, developers can efficiently prototype, debug, and optimize their applications.

In summary, the Fujitsu MB89202 and F202RA microcontrollers stand out with their efficient performance, extensive memory options, integrated peripherals, and power-saving capabilities, making them ideal for a wide array of embedded applications. Their reliability and robustness further enhance their attractiveness for designers seeking advanced microcontroller solutions.