Serial Module Example Configuration Code - Motorola MC68340 User Manual

Integrated processor with dma
Hide thumbs Also See for MC68340:
Table of Contents

Advertisement

The following steps are channel specific:
Clock Select Register (CSR)
• Select the receiver and transmitter clock.
Mode Register 1 (MR1)
• If desired, program operation of receiver ready-to-send (RxRTS bit).
• Select receiver-ready or FIFO-full notification (R/F bit).
• Select character or block error mode (ERR bit).
• Select parity mode and type (PM and PT bits).
• Select number of bits per character (B/Cx bits).
Mode Register 2 (MR2)
• Select the mode of channel operation (CMx bits).
• If desired, program operation of transmitter ready-to-send (TxRTS bit).
• If desired, program operation of clear-to-send (TxCTS bit).
• Select stop-bit length (SBx bits).
Command Register (CR)
• Enable the receiver and transmitter.

7.5.2 Serial Module Example Configuration Code

The following code is an example of a configuration sequence for the serial module.
***************************************************************************
* MC68340 basic serial module register initialization example code.
* This code is used to initialize the 68340's internal serial module registers,
* providing basic functions for operation.
* It sets up serial channel A for communication with a 9600 baud terminal.
* Note: All serial module registers must be accessed as bytes.
***************************************************************************
***************************************************************************
* equates
***************************************************************************
MBAR
EQU $0003FF00 Address of SIM40 Module Base Address Reg.
MODBASE EQU $FFFFF000 SIM40 MBAR address value
***************************************************************
* Serial module equates
SERIAL
EQU $700
MCRH
EQU $0
MCRL
EQU $1
MOTOROLA
Freescale Semiconductor, Inc.
Offset from MBAR for serial module regs
serial MCR high byte
serial MCR low byte
MC68340 USER'S MANUAL
For More Information On This Product,
Go to: www.freescale.com
7- 47

Advertisement

Table of Contents
loading

Table of Contents