MC68000 MOTOROLA [Motorola, Inc], MC68000 Datasheet - Page 367

no-image

MC68000

Manufacturer Part Number
MC68000
Description
Manufacturer
MOTOROLA [Motorola, Inc]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
MC68000-10/BZAJC
Manufacturer:
MOT
Quantity:
26
Part Number:
MC68000-8BXAJ
Manufacturer:
MOT
Quantity:
9
Part Number:
MC680008FN8
Manufacturer:
FREESCALE
Quantity:
8 831
Part Number:
MC680008L8
Manufacturer:
AMD
Quantity:
42
Part Number:
MC68000FN10
Manufacturer:
MOT
Quantity:
5 510
Part Number:
MC68000FN10
Manufacturer:
MOTOROLA/摩托罗拉
Quantity:
20 000
Part Number:
MC68000FN12
Manufacturer:
MOT
Quantity:
5 510
Part Number:
MC68000L8
Manufacturer:
MOTOROLA/摩托罗拉
Quantity:
20 000
Part Number:
MC68000P10
Manufacturer:
MOT
Quantity:
1 000
Part Number:
MC68000P10
Manufacturer:
MOT
Quantity:
20 000
D.4 CONFIGURING A UART ON THE MC68302
The following paragraphs discuss a working example of software that configures the
MC68302 SCC3 for the UART mode. The code receives data from the UART receiver on a
character-by-character basis and retransmits it out of the UART transmitter. The code,
which runs as is on the ADS302 board, is an excellent starting point for understanding how
to program the UART mode or to create a simple UART handler to support a debug monitor.
D.4.1 Purpose of the Code
This code is really a character “echo” generator — every character received is retransmitted
under control of the M68000 core on the MC68302. An automatic echo mode is available
with each SCC in the SCM register. Why do it manually in software? The answer is that de-
veloping this concept in software is a good way to begin a more complete design since it
demonstrates reception, transmission, and some real-time issues.
The code receives and transmits data on a character-by-character basis, with interrupts
generated on each character received. Although the MC68302 UART mode has much more
flexibility and power than what is used by this code, many applications just require a simple
low-speed UART channel for debugging during the design. SCC3 is often chosen to run at
9600 baud for this purpose as shown in the example.
The code is shown in standard M68000 assembler. Efficiency was sacrificed, when neces-
sary, to enhance readability. The code is comprised of three basic parts. The first part ini-
tializes the MC68302 with everything required to set up SCC3 for the UART mode. The
MOTOROLA
* none of the Rx BDs will be available (all BDs Empty = 0). Thus, the
* status of this BD will be saved for examination later.
* Status bits are all 0
Wrap_T
EXIT_TX
* Back to the main handler, that handles the rest of the events
********************Data after transmission ********************
* 00030000 0001 0203 0405 141A xxxx xxxx xxxx xxxx # Receiver Buffer 0
* 00030010 0001 0203 0405 141A xxxx xxxx xxxx xxxx # Receiver Buffer 1
* 00030020 0001 0203 0405 141A xxxx xxxx xxxx xxxx # Receiver Buffer 2
* 00030030 0001 0203 0405 141A xxxx xxxx xxxx xxxx # Receiver Buffer 3
* 00030040 0001 0203 0405 141A xxxx xxxx xxxx xxxx # Receiver Buffer 4
* 00030050 0001 0203 0405 141A xxxx xxxx xxxx xxxx # Receiver Buffer 5
* 00030060 0001 0203 0405 141A xxxx xxxx xxxx xxxx # Receiver Buffer 6
* 00030070 0001 0203 0405 141A xxxx xxxx xxxx xxxx # Receiver Buffer 7
• 00030080 0001 0203 0405 0607 0809 0A0B 0C0D 0E0F # Transmit Buffer
• Notice that 141A is the 16-bit CRC
END
CMPI.B
BNE.B
CLR.B
BTST.B
BNE.B
ADDQ.W
BRA.B
LEA.L
BRA.B
JMP
#0,SS_BD(A1)
EXIT_TX
SS_BD(A1)
#WRAP,ST_BD(A1)
Wrap_T
#SZ_BD,A1
NxtCTD
TXBD_01,A1
NxtCTD
OthrlNT
MC68302 USER’S MANUAL
;Check status bits
;Clear out all status bits
;Test Wrap bit
;
;Increment CTD to next BD
;Back to while loop
;Wrap back to the first Tx BD
;Back to the while loop
;Exit confirmer potion of the handler
MC68302 Applications
D-17

Related parts for MC68000