Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty, representation or guarantee regarding
the suitability of its products for any particular purpose, nor does Motorola assume any liability arising out of the application or use of any product or circuit, and
specifically disclaims any and all liability, including without limitation consequential or incidental damages. "Typical" parameters can and do vary in different
applications. All operating parameters, including "Typicals" must be validated for each customer application by customer's technical experts. Motorola does not
convey any license under its patent rights nor the rights of others. Motorola products are not designed, intended, or authorized for use as components in systems
intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Motorola
product could create a situation where personal injury or death may occur. Should Buyer purchase or use Motorola products for any such unintended or
unauthorized application, Buyer shall indemnify and hold Motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims,
costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such
unintended or unauthorized use, even if such claim alleges that Motorola was negligent regarding the design or manufacture of the part. Motorola and are
registered trademarks of Motorola, Inc. Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer.
MOTOROLA, 1995
Page 2
68K FAX-IT
Documentation Comments
FAX 512-891-8593—Documentation Comments Only
The Motorola High-Performance Embedded Systems Technical Communications Department provides a fax number for you to submit any questions or comments about this document or how to order other documents. We welcome your suggestions for improving our
documentation. Please do not fax technical questions.
Please provide the part number and revision number (located in upper right-hand corner of
the cover) and the title of the document. When referring to items in the manual, please reference by the page number, paragraph number, figure number, table number, and line number if needed.
When sending a fax, please provide your name, company, fax number, and phone number
including area code.
Applications and Technical Information
For questions or comments pertaining to technical information, questions, and applications,
please contact one of the following sales offices nearest you.
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
iii
Page 3
iv
— Sales Offices —
Field Applications Engineering Available Through All Sales Offices
ALABAMA , Huntsville(205) 464-6800
UNITED STATES
ARIZONA , Tempe (602) 897-5056
CALIFORNIA , Agoura Hills(818) 706-1929
CALIFORNIA , Los Angeles(310) 417-8848
CALIFORNIA , Irvine (714) 753-7360
CALIFORNIA , Rosevllle (916) 922-7152
CALIFORNIA , San Diego (619) 541-2163
CALIFORNIA , Sunnyvale (408) 749-0510
COLORADO , Colorado Springs(719) 599-7497
COLORADO , Denver(303) 337-3434
CONNECTICUT , Wallingford(203) 949-4100
FLORIDA , Maitland(407) 628-2636
FLORIDA , Pompano Beach/
Fort Lauderdale(305) 486-9776
FLORIDA , Clearwater(813) 538-7750
GEORGlA , Atlanta(404) 729-7100
IDAHO , Boise(208) 323-9413
ILLINOIS , Chicago/Hoffman Estates(708) 490-9500
INDlANA , Fort Wayne(219) 436-5818
INDIANA , Indianapolis (317) 571-0400
INDIANA , Kokomo (317) 457-6634
IOWA , Cedar Rapids(319) 373-1328
KANSAS , Kansas City/Mission (913) 451-8555
MARYLAND , Columbia (410) 381-1570
MASSACHUSETTS , Marborough(508) 481-8100
MASSACHUSETTS , Woburn (617) 932-9700
MICHIGAN , Detroit(313) 347-6800
MINNESOTA , Minnetonka (612) 932-1500
MISSOURI , St. Louis(314) 275-7380
NEW JERSEY , Fairfield (201) 808-2400
NEW YORK , Fairport(716) 425-4000
NEW YORK , Hauppauge(516) 361-7000
NEW YORK , Poughkeepsie/Fishkill(914) 473-8102
NORTH CAROLINA , Raleigh(919) 870-4355
OHIO , Cleveland (216) 349-3100
OHIO , Columbus/Worthington(614) 431-8492
OHIO , Dayton (513) 495-6800
OKLAHOMA , Tulsa(800) 544-9496
OREGON , Portland (503) 641-3681
PENNSYLVANIA , Colmar(215) 997-1020
WISCONSIN , Milwaukee/Brookfield(414) 792-0122
BRITISH COLUMBIA , Vancouver(604) 293-7605
ONTARIO , Toronto (416) 497-8181
ONTARIO , Ottawa(613) 226-3491
QUEBEC , Montreal (514) 731-6881
AUSTRALIA , Melbourne(61-3)887-0711
AUSTRALIA , Sydney(61(2)906-3855
BRAZIL , Sao Paulo 55(11)815-4200
CHINA , Beijing 86 505-2180
FINLAND , Helsinki 358-0-35161191
INDIA , Bangalore (91-812)627094
ISRAEL , Tel Aviv972(3)753-8222
ITALY , Milan39(2)82201
JAPAN , Aizu 81(241)272231
JAPAN , Atsugi 81(0462)23-0761
JAPAN , Kumagaya81(0485)26-2600
JAPAN , Kyushu81(092)771-4212
JAPAN , Mito81(0292)26-2340
JAPAN , Nagoya81(052)232-1621
JAPAN , Osaka81(06)305-1801
JAPAN, Sendai 81(22)268-4333
JAPAN,
JAPAN,
JAPAN
KOREA , Pusan82(51)4635-035
KOREA , Seoul82(2)554-5188
13.4AC Electrical Specifications—Read and Write Cycles............................... 13-1
xii
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 12
SECTION 1
MC68328 PROCESSOR OVERVIEW
As the consumer market for portable devices expands, system requirements have become
more demanding. Minimum number of components, smaller board space, lower power consumption, and lower system cost are a few of the criteria necessary for a successful product.
In response to these consumer needs, Motorola has designed a new processor. The
TM
MC68328 DragonBall
operation in an efficient package. The MC68328 processor delivers cost-effective performance to satisfy the extensive requirements of today’s consumer market for portable
devices.
integrated portable system processor provides a 3.3V, fully static
The MC68328 processor provides key features that are suitable for many portable applications. Modules like a real-time clock (RTC), an LCD controller, pulse-width modulator
(PWM), timers, master and slave serial peripheral interface (SPI), universal asynchronous
receiver/transmitter (UART), and the system integration module (SIM28) give the system
engineer more flexibility and resources to design efficient and innovative products.
1.1 KEY FEATURES
The primary features of the MC68328 processor, illustrated in Figure 1, are as follows:
• MC68EC000 Static Core Processor
• 100% Compatibility with MC68000 And MC68EC000 Processors
—24-Bit External and 32-Bit Internal Address Bus
—Optional A31-A24 Capable of 4 Gbytes of Address Space
—16-Bit On-Chip Data Bus for MC68EC000 Bus Operations
—Static Design Allows Processor Clock to Be Stopped for Power Savings
—2.7 MIPS Performance at 16.67-MHz Processor Clock
• Dynamic Bus Sizing Support for Connections to 8-Bit and 16-Bit Devices
• System Integration Module (SIM28) Supporting Glueless System Design:
—System Configuration, Programmable Address Mapping
—Memory Interface for SRAM, EPROM and FLASH Memory
—16 Programmable Peripheral Chip-Selects with Wait-State Generation Logic
—Interrupt Controller with 13 Flexible Inputs
—Programmable Interrupt Vector Generator
—Hardware Watchdog Timer
—Software Watchdog Timer
—Low-Power Mode Control
—Up to 77 Individually Programmable Parallel Port Signals
—PCMCIA 1.0 Support
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
1-1
Page 13
Overview
PARALLEL I/O PORTS
8-/16-Bit
68000 BUS
INTERFACE
CLOCK
SYNTHESIZER
AND
POWER
CONTROL
PCMCIA 1.0
SUPPORT
PROCESSOR
CONTROL
SYSTEM
INTEGRATION
MODULE
(SIM28)
RTC
INTERRUPT
CONTROLLER
MC68EC000 HCMOS
DYNAMIC BUS SIZING EXTENSION
CONTROL
MODULE
LCD
STATIC
CORE
MC68EC000 INTERNAL BUS
MASTER
SPI
PWM
MODULE
SLAVE
SPI
PARALLEL I/O PORTS
Figure 1. MC68328 Block Diagram
DUAL
16-BIT
TIMER
MODULE
UART
WITH
INFRA-RED
SUPPORT
• UART
—Supports IrDA-Compliant Physical-Layer Protocol
—8-Byte FIFOs for Rx and Tx
• Two Separate Serial Peripheral Interface Ports (Master and Slave)
—Support For External POCSAG Decoder (Slave)
—Support for Digitizer For A/D Input or EEPROM (Master)
• Dual Channel 16-Bit General-Purpose Counter/Timer
—Multimode Operation, Independent Capture/Compare Registers
—Automatic Interrupt Generation
—240ns Resolution at 16.67-MHz System Clock
—Each Timer Has an Input and an Output Pin for Capture and Compare
• Pulse-Width Modulation Output for Sound Generation
—Programmable Frame Rate
—16-Bit Programmable
—Supports Motor Control
• Real-Time Clock
—24-Hour Time
—1 Programmable Alarm
1-2
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 14
±
Overview
• Power Management
—3.3 V Operation
—Fully Static HCMOS Technology
—Programmable Clock Synthesizer for Full Frequency Control
—Low Power Stop Capabilities
—Individual Module Shut Down Capability
—Lowest Power-Mode Control (Shut Down CPU and Peripherals)
• LCD Control Module
—Software Programmable Screen Size to Support Single (Non-Split) Monochrome/
STN Panels
—Direct Drive Capability of Common LCD Drivers/Modules from Motorola and Other
LCD Drive Manufacturers
—Support as Many as 4 Grey Levels
—Use System Memory as Display Memory
• IEEE 1149.1 Boundary Scan Test Access Port (JTAG)
• Operation From DC To 16.67 MHz (Processor Clock)
The M68300 family of integrated processors and controllers is built on an M68000 core processor and a selection of intelligent peripherals appropriate for a set of applications. Common system glue logic such as address decoding, wait-state insertion, interrupt
prioritization, and watchdog timing is also included.
Each member of the M68300 family is distinguished from the others by its selection of onchip peripherals. Peripherals are chosen to address specific applications but are often useful in a variety of applications. The peripherals may be highly sophisticated timing or protocol
engines that have their own processors, or they may be more traditional peripheral functions
such as UARTs and timers.
1.1.2 ADVANTAGES
The many features incorporated into a single M68300 Family chip help system designers
realize significant savings in design time, power consumption, cost, board space, pin count,
and programming. The equivalent functionality can easily require 20 separate components.
Each component might have 16–64 pins, totalling over 350 connections. Most of these connections require interconnects or are duplications. Each connection: (1) is a candidate for a
bad solder joint or misrouted trace, (2) is another part to qualify, purchase, inventory, and
maintain. Each component (1) requires a share of the printed circuit board, (2) draws power,
which often drives large buffers to get the signal to another chip. The cumulative power consumption of all the components must be available from the power supply. The signals
between the central processor unit (CPU) and a peripheral might not be compatible nor run
from the same clock, which could require time delays or other special design considerations.
In an M68300 family component, the major functions and glue logic are all properly connected internally, timed with the same clock, fully tested, and uniformly documented. Only
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
1-3
Page 15
Overview
essential signals are brought out to pins. The primary package is the surface-mount plastic
QFP for the smallest possible footprint.
1.2 MC68328 ARCHITECTURE
To improve total system throughput and reduce component count, board size, and cost of
system implementation, the MC68328 processor integrates a powerful MC68EC000 processor, intelligent peripheral modules, and typical system interface logic. These functions
include the system integration module (SIM28), timers, LCD controller, and more.
1.2.1 EC000 STATIC CORE
The EC000 core is a core implementation of the M68000 32-bit microprocessor architecture.
The features of the EC000 core processor include:
• Low power, static HCMOS implementation
• 32-bit address bus, 16-bit data bus
• Seventeen 32-bit data and address registers
• 56 powerful instruction types that support high-level development languages
• 14 addressing modes and 5 main data types
• 7 priority levels for interrupt control
The EC000 core is completely upward user code-compatible with all other members of the
M68000 microprocessor families and thus has access to a broad base of established realtime kernels, operating systems, languages, applications, and development tools.
registers and a 32-bit program counter (see Figure 1-1). The first 8 registers (D7–D0) serve
as data registers for byte (8-bit), word (16-bit) and long-word (32-bit) operations. Because
using data registers will affect the condition-code register (which indicates negative number,
carry, and overflow conditions), they (the data registers) are used primarily for data manipulation. The second set of 7 registers (A6–A0) and the user stack pointer (USP) may function as software stack pointers and base-address registers. These registers can be used for
word and long-word operations and do not affect the condition-code register. All of the registers (D7–D0 and A6–A0) may serve as index registers.
In supervisor mode, the upper byte of the status register (SR) and the supervisor stack
pointer (SSP) are also available to programmers. These registers are shown in Figure 1-3.
The SR (refer to Figure 1-3) contains the interrupt mask (7 levels available) as well as these
condition codes: extend (X), negative (N), zero (Z), overflow (V), and carry (C). Additional
status bits indicate whether the processor is in trace mode (T-bit) or in supervisor/ user state
(S-bit).
1.2.1.2 DATA TYPES AND ADDRESS MODES. Five basic data types are supported:
1. Bits
2. Binary-coded decimal (BCD) digits (4 bits)
1-4
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 16
Overview
3116 15
3116 150
310
8
7
7
Figure 1-1. User Programming Model
0
D0
D1
D2
D3
D4
D5
D6
D7
0151631
A0
A1
A2
A3
A4
A5
A6
PCPROGRAM COUNTER
0
DATA REGISTERS
ADDRESS REGISTERS
USER STACK POINTERA7 (USP)
STATUS REGISTERCCR
3116 150
8
15
7
0
SRSTATUS REGISTER
SUPERVISOR STACKA7 (SSP)
POINTER
Figure 1-2. Supervisor Programmer’s Model Supplement
3. Bytes (8 bits)
4. Words (16 bits)
5. Long words (32 bits)
In addition, operations on other data types such as memory addresses, status word data,
etc. are provided in the instruction set.
The 14 address modes listed in Table 1-1 include six basic types:
1. Register direct
2. Register indirect
3. Absolute
4. Program counter relative
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
1-5
Page 17
Overview
5. Immediate
6. Implied
The register-indirect address modes can perform post-increment, pre-decrement, offset,
and index operations. The program-counter relative mode can be modified through index
and offset operations.
Table 1-1. Address Modes
Address modesSyntax
Register direct address
Absolute data address
Program counter relative address
Register indirect address register
Immediate data address
Implied address
Legend:
Data register direct
Address register direct
Absolute short
Absolute long
Relative with offset
Relative with index offset
Register indirect
Postincrement register indirect
Predecrement register indirect
Register indirect with offset
Indexed register indirect with offset
Immediate
Quick immediate
Implied registerSR/USP/SP/PC
Dn = Data Register
An = Address Register
Xn = Address or Data Register Used as Index Register
SR = Status Register
PC = Program Counter
SP = Stack Pointer
USP = User Stack Pointer
<> = Effective Address
d
= 8-Bit Offset (Displacement)
8
d
= 16-Bit Offset (Displacement)
16
#xxx = Immediate Data
d
8
d
Dn
An
xxx.W
xxx.L
d
(PC)
16
(PC, Xn)
(An)
(An)+
–(An)
d
(An)
16
(An, Xn)
8
#xxx
#1–#8
1.2.1.3 INSTRUCTION SET OVERVIEW. Table 1-2 lists the EC000 core instruction set.
The instruction set supports high-level languages that facilitate programming. Each instruction, with few exceptions, operates on bytes, words, and long-words, and most instructions
can use any of the 14 address modes. A combination of instruction types, data types, and
address modes provides over 1000 useful instructions. These instructions include signed
and unsigned, multiply and divide, quick arithmetic operations, BCD arithmetic, and
expanded operations (through traps).
1.2.2 SYSTEM INTEGRATION MODULE
The MC68328 SIM28 consists of several functions that control the system startup, initialization, configuration, and the external bus with a minimum of external devices. The memory
1-6
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 18
Table 1-2. Instruction Set
MnemonicDescriptionMnemonicDescription
ABCDAdd decimal with extendMOVEMMove multiple registers
ADDAdd MOVEPMove peripheral data
ADDAAdd addressMOVEQMove quick
ADDQAdd quickMOVE from SR Move from status register
ADDIAdd immediateMOVE to SR Move to status register
ADDXAdd with extendMOVE to CCR Move to condition codes
ANDLogical ANDMOVE USPMove user stack pointer
ANDIAND immediateMULSSigned multiply
ANDI to CCR AND immediate to condition codesMULUUnsigned multiply
ANDI to SR AND immediate to status registerNBCDNegate decimal with extend
ASLArithmetic shift leftNEGNegate
ASRArithmetic shift rightNEGXNegate with extend
BccBranch conditionallyNOPNo operation
BCHGBit test and changeNOTOnes complement
BCLRBit test and clearORLogical OR
BRABranch alwaysORIOR immediate
BSETBit test and setORI to CCROR immediate to condition codes
BSRBranch to subroutineORI to SROR immediate to status register
BTSTBit testPEAPush effective address
CHKCheck register against boundsRESETReset external devices
CLRClear operandROLRotate left without extend
CMPCompareRORRotate right without extend
CMPACompare addressROXLRotate left with extend
CMPMCompare memoryROXRRotate right with extend
CMPICompare immediateRTEReturn from exception
DBccTest cond, decrement and branchRTRReturn and restore
DIVSSigned divideRTSReturn from subroutine
DIVUUnsigned divideSBCDSubtract decimal with extend
EORExclusive ORSccSet conditional
EORIExclusive OR immediateSTOPStop
EORI to CCR Exclusive OR immediate to condition codesSUBSubtract
EORI to SR Exclusive OR immediate to status registerSUBASubtract address
EXGExchange registersSUBISubtract immediate
EXTSign extendSUBQSubtract quick
JMPJumpSUBXSubtract with extend
JSRJump to subroutineSWAPSwap data register halves
LEALoad effective addressTASTest and set operand
LINKLink stackTRAPTrap
LSLLogical shift leftTRAPVTrap on overflow
LSRLogical shift rightTSTTest
MOVEMoveUNLKUnlink
MOVEAMove address——
Overview
interface lets users connect gluelessly with the popular SRAM, EPROM as well as PCMCIA
1.0 memory cards. With the assistance of chip-select logic, wait states can be programmable. The hardware and software watchdog timers help users perform system protections.
The interrupt controller accepts and resolves the priority from internal modules and exter-
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
1-7
Page 19
Overview
nally generated interrupts and also handles the mask and wake-up selection control for
power control. The low-power logic can control the CPU power dissipation by a frequency
change or stopping it altogether. The SIM28 can also configure the pin to let users select
either dedicated I/O or parallel I/O. This feature helps increase the number of available I/O
ports by reclamation when the dedicated function is not in use.
1.2.2.1 SYSTEM CONFIGURATION. The MC68328 processor system configuration logic
consists of a system control register (SCR) that lets users configure these major function
operations:
• System status and control logic
• Register double mapping
• Bus error generation control
• Module control registers protection from access by user programs
1.2.2.2 VCO/PLL CLOCK SYNTHESIZER. The clock synthesizer can operate with either
an external crystal or an external oscillator for reference, using the internal phase-locked
loop (PLL). The other option is for an external clock to directly drive the clock signal at the
operational frequency.
1.2.2.3 CHIP-SELECT LOGIC. The MC68328 processor provides 16 programmable, gen-
eral-purpose, chip-select signals. For a given chip-select block, users may choose: (1)
whether the chip-select allows read-only or both read and write accesses, (2) whether a
DTACK
(from zero to six) until the DTACK
is automatically generated for this chip-select, and (3) the number of wait states
will be generated.
1.2.2.4 EXTERNAL BUS INTERFACE. The external bus interface handles the transfer of
information between the internal MC68EC000 core and the memory, peripherals, or other
processing elements in the external address space. It consists of a 16-bit 68000 data bus
interface for internal-only devices and a programmable 8-bit or 16-bit data bus interface to
external devices.
1.2.2.5 INTERRUPT CONTROLLER. The interrupt controller accepts and prioritizes both
internal and external interrupt requests and generates a vector number during the CPU
interrupt-acknowledge cycle. Interrupt nesting is also provided so that an interrupt service
routine of a lower priority interrupt may be suspended by a higher priority interrupt request.
The on-chip interrupt controller has these major features:
• Prioritized interrupt sources (internal and external)
• Fully nested interrupt environment
• Programmable vector generation
• Unique vector number generated for each interrupt level
• Interrupt masking
• Wakeup interrupt masking
1-8
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 20
Overview
1.2.2.6 PARALLEL GENERAL-PURPOSE I/O PORTS. The MC68328 processor supports
up to 77 bit general-purpose I/O ports that can be configured as general-purpose I/O pins or
as dedicated peripheral-interface pins of the on-chip modules.
Each port pin can be independently programmed as a general-purpose I/O pin even when
other pins related to that on-chip peripheral are used as dedicated pins. If all the pins for a
particular peripheral are configured as general-purpose I/O, the peripheral will still operate
normally, although this is useful only with the RTC and timer modules.
1.2.2.7 SOFTWARE WATCHDOG. A software watchdog timer protects against system fail-
ures by providing a means of escape from unexpected input conditions, external events, or
programming errors. Once started, the software watchdog timer must be cleared by software on a regular basis so that it never reaches its time-out value. When it reaches the timeout value, the watchdog timer assumes that a system failure has occurred, and the software
watchdog logic resets or interrupts the MC68EC000 core.
1.2.2.8 LOW POWER STOP LOGIC. Various power-save options are available: turn off
unused peripherals, reduce processor clock speed, disable the processor altogether, or a
combination of these.
A wake-up-from-low-power mode can be achieved by an interrupt at the interrupt controller
logic that runs throughout the period of processor low-power. Programmable interrupt
sources can serve as events to wake up the EC000 core.
The on-chip peripherals can initiate a wake-up; for example, the timer can be set to wakeup after a certain elapsed time or number of external events.
1.2.3 LCD Controller
• Interfaces with monochrome STN LCD modules
• Up to 4 levels of gray scale through frame rate control
• Use system RAM for display memory
• Screen refresh through DMA
1.2.4 UART and Infrared Communication Support
The UART supports standard asynchronous serial communications at normal baud rates
and is compatible with IrDA Physical Communication Protocol
1.2.5 Real-Time Clock
A 32.76kHz or 38.4kHz crystal (the same as the clock synthesizer clock source) drives the
real-time clock in the MC68328 processor and provides an alarm interrupt.
1.2.6 JTAG Test Access Port
To assist in system diagnostics, the MC68328 processor includes dedicated user-accessible test logic that is fully compliant with the IEEE 1149.1 standard for boundary-scan testability, often referred to as JTAG (Joint Test Action Group).
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
1-9
Page 21
Overview
1.2.7 SIM28 Programming Model
The SIM28 programming model is listed in Table 1-3.
1-10
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 22
Overview
Table 1-3. Programmer’s Memory Map
AddressNameWidthBlockDescriptionReset Value(hex)
Base+$000SCR8SIMSystem Control Register$0C
Base+$100GRPBASEA16CSChip Select Group A Base Register$0000
Base+$102GRPBASEB16CSChip Select Group B Base Register$0000
Base+$104GRPBASEC16CSChip Select Group C Base Register$0000
Base+$106GRPBASED16CSChip Select Group D Base Register$0000
Base+$108GRPMASKA16CSChip Select Group A Mask Register$0000
Base+$10AGRPMASKB16CSChip Select Group B Mask Register$0000
Base+$10CGRPMASKC16CSChip Select Group C Mask Register$0000
Base+$10EGRPMASKD16CSChip Select Group D Mask Register$0000
Base+$110CSA032CSGroup A Chip Select 0 Register$00010006
Base+$114CSA132CSGroup A Chip Select 1 Register$00010006
Base+$118CSA232CSGroup A Chip Select 2 Register$00010006
Base+$11CCSA332CSGroup A Chip Select 3 Register$00010006
Base+$120CSB032CSGroup B Chip Select 0 Register$00010006
Base+$124CSB132CSGroup B Chip Select 1 Register$00010006
Base+$128CSB232CSGroup B Chip Select 2 Register$00010006
Base+$12CCSB332CSGroup B Chip Select 3 Register$00010006
Base+$130CSC032CSGroup C Chip Select 0 Register$00010006
Base+$134CSC132CSGroup C Chip Select 1 Register$00010006
Base+$138CSC232CSGroup C Chip Select 2 Register$00010006
Base+$13CCSC332CSGroup C Chip Select 3 Register$00010006
Base+$140CSD032CSGroup D Chip Select 0 Register$00010006
Base+$144CSD132CSGroup D Chip Select 1 Register$00010006
Base+$148CSD232CSGroup D Chip Select 2 Register$00010006
Base+$14CCSD332CSGroup D Chip Select 3 Register$00010006
Base+$200PLLCR16PLLPLL Control Register$2400
Base+$202PLLFSR16PLLPLL Frequency Select Register$0123
Base+$204Reserved-PLLDo Not Access-
Base+$207PCTLR8PCTLPower Control Register$1F
Base+$300IVR8INTR Interrupt Vector Register$00
Base+$302ICR16INTR Interrupt Control Register$0000
Base+$308IWR32INTR Interrupt Wakeup Enable Register$00FFFFFF
Base+$30CISR32INTR Interrupt Status Register$00000000
Base+$310IPR32INTR Interrupt Pending Register-
Base+$400PADIR8PIOPort A Direction Register $00
Base+$401PADATA8PIOPort A Data Register$00
Base+$403PASEL8PIOPort A Select Register $00
Base+$408PBDIR8PIOPort B Direction Register $00
Base+$409PBDATA8PIOPort B Data Register $00
Base+$40BPBSEL8PIOPort B Select Register$00
Base+$410PCDIR8PIOPort C Direction Register $00
Base+$411PCDATA8PIOPort C Data Register $00
Base+$413PCSEL8PIOPort C Select Register$00
Base+$418PDDIR8PIOPort D Direction Register $00
Base+$419PDDATA8PIOPort D Data Register $00
Base+$41APDPUEN8PIOPort D Pullup Enable Register$FF
Base+$41CPDPOL8PIOPort D Polarity Register$00
Base+$41DPDIRQEN8PIOPort D IRQ Enable Register$00
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
1-11
Page 23
Overview
Table 1-3. Programmer’s Memory Map (Continued)
AddressNameWidthBlockDescriptionReset Value(hex)
Base+$41FPDIRQEDGE8PIOPort D IRQ Edge Register$00
Base+$420PEDIR8PIOPort E Direction Register $00
Base+$421PEDATA8PIOPort E Data Register$00
Base+$422PEPUEN8PIOPort E Pullup Enable Register$80
Base+$423PESEL8PIOPort E Select Register $80
Base+$428PFDIR8PIOPort F Direction Register $00
Base+$429PFDATA8PIOPort F Data Register$00
Base+$42APFPUEN8PIOPort F Pullup Enable Register$FF
Base+$42BPFSEL8PIOPort F Select Register $FF
Base+$430PGDIR8PIOPort G Direction Register $00
Base+$431PGDATA8PIOPort G Data Register$00
Base+$432PGPUEN8PIOPort G Pullup Enable Register$FF
Base+$433PGSEL8PIOPort G Select Register $FF
Base+$438PJDIR8PIOPort J Direction Register $00
Base+$439PJDATA8PIOPort J Data Register$00
Base+$43BPJSEL8PIOPort J Select Register $00
Base+$440PKDIR8PIOPort K Direction Register $00
Base+$441PKDATA8PIOPort K Data Register$00
Base+$442PKPUEN8PIOPort K Pullup Enable Register$FF
Base+$443PKSEL8PIOPort K Select Register $FF
Base+$448PMDIR8PIOPort M Direction Register $00
Base+$449PMDATA8PIOPort M Data Register$00
Base+$44APMPUEN8PIOPort M Pullup Enable Register$FF
Base+$44BPMSEL8PIOPort M Select Register$FF
Base+$500PWMC16PWMPWM Control Register$0000
Base+$502PWMP16PWMPWM Period Register $0000
Base+$504PWMW16PWMPWM Width Register $0000
Base+$506PWMCNT16PWMPWM Counter $0000
Base+$600TCTL116TimerTimer Unit 1 Control Register $0000
Base+$602TPRER116TimerTimer Unit 1 Prescalar Register $0000
Base+$604TCMP116TimerTimer Unit 1 Compare Register $FFFF
Base+$606TCR116TimerTimer Unit 1 Capture Register $0000
Base+$608TCN116TimerTimer Unit 1 Counter $0000
Base+$60ATSTAT116TimerTimer Unit 1 Status Register$0000
Base+$60CTCTL216TimerTimer Unit 2 Control Register $0000
Base+$60ETPREP216TimerTimer Unit 2 Prescaler Register $0000
Base+$610TCMP216TimerTimer Unit 2 Compare Register$FFFF
Base+$612TCR216TimerTimer Unit 2 Capture Register$0000
Base+$614TCN216TimerTimer Unit 2 Counter $0000
Base+$616TSTAT216TimerTimer Unit Status Register$0000
Base+$618WCR16WDWatchdog Control Register $0000
Base+$61AWCR16WDWatchdog Compare Register $FFFF
Base+$61CWCN16WDWatchdog Counter$0000
Base+$B0CCTL8RTCRTC Control Register$00
Base+$B0EISR8RTCRTC Interrupt Status Register $00
Base+$B10IENR8RTCRTC Interrupt Enable Register$00
Base+$B12STPWCH8RTCStopwatch Minutes$00
MOTOROLA
Note
The base is $FFFFF000 and $FFF000 from reset. If the doublemapped bit is cleared in the SCR, then the base is $FFFFF000.
Do not access any space within the 4K register space that is not
defined in the above table. Unpredictable results may occur.
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
1-13
Page 25
Overview
1-14
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 26
SECTION 2
SYSTEM INTEGRATION MODULE
The MC68328 processor system integration module (SIM28) consists of several functions
that control the system startup, initialization, configuration, and the external bus with minimum glue logic. The SIM28 contains the following functions:
• System configuration
• Chip-selects and wait states
• External bus interfaces
• Interrupt configuration / response
• PCMCIA V1.0 memory card support
2.1 MODULE OPERATION
The various SIM28 internal function blocks and their operation are described here along with
methods and recommendations to program the various register locations that allow users to
configure the MC68328 processor for their target systems.
2.1.1 MC68328 Processor System Configuration
The MC68328 processor system configuration logic consists of a system control register
(SCR) that lets users configure operation of the following functions:
• Access permission of internal peripheral registers
• Address space of internal peripheral registers
• Bus timeout control and status (bus-error generator)
The on-chip peripherals occupy a reserved 4096-byte block of address space for their
registers. This block is located at $FFFFF000 and $FFF000 from reset. There is a doublemap control bit in the SCR to disable this double-mapping feature. If the bit is cleared, the
on-chip peripheral registers appear at the top 4K of the 4 Gbyte address range starting from
$FFFFF000. The on-chip peripherals address-decode logic block diagram is shown in
Figure 2-1.
2.1.1.1 SYSTEM CONTROL REGISTER FUNCTIONS. The SCR allows for various
settings that influence system operation, such as power-down and oscillator control logic,
bus interface, and hardware watchdog protection. It also includes status bits that allow
exception-handler code to monitor the cause of exceptions and resets.
While most of the functions controlled by these register bits are described in detail elsewhere, they include those listed below.
2.1.1.2 SYSTEM PROTECTION FUNCTIONS. The hardware watchdog (bus timeout
monitor) and the software watchdog timer provide system protections.
The hardware watchdog provides a bus monitor that causes a bus error (assert BERR
nally) when a bus cycle is not terminated by DTACK
after 128 clock cycles have elapsed.
inter-
The bus-error timeout (BETO) status bit in the SCR will also be set so that a bus-error exception handler can determine the cause of the bus error.
The bus-error timeout logic consists of a watchdog counter that, when enabled, begins to
count clock cycles as AS
normally terminates the count; however, if the count reaches terminal count before AS
of AS
is asserted (for internal or external bus accesses). The negation
is negated, BERR is asserted until AS is negated. The bus-error timeout logic uses one control bit and one status bit in the SCR.
To operate the software watchdog timer, refer to the timer section.
2.1.2 Chip-Select and Wait-State Logic
The MC68328 processor provides a set of 16 general-purpose, programmable, chip-select
signals arranged as 4 groups of 4 that includes two special-purpose chip-select signals.
Each of the general-purpose signals can address an entire 32-bit address range and has a
common set of features. The CSA0
select. From reset, all the addresses are mapped to device CSA0
address A is programmed and the valid bit is set. From that point on, CSA0
globally and it is only asserted when decoded from the programming information in the
group-base address register, group-base address mask register, chip-select base register,
and chip-select option register. The CSD3
the PCMCIA support logic. When the CSD3
asserted. For each memory area, users also may define an internally generated cycle-ter-
is special in the sense that it is also a boot device chip-
until the group-base
does not decode
is special in the sense that it is associated with
is asserted, the PCMCIA control signals are
2-2
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 28
System Integration Module
mination signal (DTACK) with a programmable number of wait states. This feature eliminates board space that would otherwise be necessary for cycle-termination logic.
The 16 general-purpose chip-selects allow up to 4 different classes of devices/memory for
use in a system without external decode or wait-state generation logic. For example, to
address a 16 Mbyte ROM space, 4 pairs of 16-Mbit ROM chips are used (C
CSA3
are connected to those 4 pairs of ROMs). Another typical configuration could be an
SA0 through
8-bit EPROM, a fast 16-bit SRAM, up to 4 simple I/O peripherals, and a nonvolatile flash
memory.
The chip-select block diagram is shown in Figure 2-2.
The basic chip-select model allows the chip-select output signal to assert in response to an
address match. The signals are asserted externally shortly after AS
goes low. The address
match is described in terms of a base address and an address mask. Thus, the byte size of
the matching block must be a power of 2, and the base address must be an integer multiple
of this size. Therefore, an 8-Kbyte block size must begin on an 8-Kbyte boundary, and a 64Kbyte block size can only begin on a 64-Kbyte boundary, etc.
Each chip-select is programmable and the registers have read-write capability so that the
values programmed can be read back.
For a given chip-select, users may also choose: (1) whether the chip-select allows read-only
or read/write accesses, (2) whether a DT
ACK is automatically generated for this chip-select,
and (3) the number of wait states (from zero to six).
2.1.2.1 PROGRAMMABLE DATA-BUS SIZE. Each of the chip-selects includes the facility
of a data-bus port-sizing extension to the basic M68000 bus. This allows the system
designer to mix 16-bit and 8-bit contiguous address memory devices (RAM, ROM) on a 16bit data-bus system. If the CPU core performs a 16-bit data transfer in an 8-bit memory
space, then two 8-bit cycles will occur. However, the address strobe and data strobe remain
asserted until the end of the second 8-bit cycle. In this case, only the external MC68EC000
data bus upper byte (D15-D8) is used; the least significant bit of address (A0) increments
automatically from one to the next. A0 should be ignored in 16-bit data-bus cycles even if
only the upper or lower byte is being read/written.
Note that a 16-bit data bus is always used internally for access to peripheral registers,
regardless of any mode settings for the external bus. Where internal peripheral registers are
16-bits wide, they can be read or written only in one bus cycle. This eliminates possible conflicts and reading of inaccurate values where 16-bit-wide register contents are volatile (timer
counter registers, for example) or where the whole 16-bit value affects some aspect of system operation (chip-select base address, for example).
It is recommended that any external peripheral that needs only an 8-bit data-bus interface
but does not require contiguous address locations: (1) use a chip-select configured as 16bit data-bus width, and (2) connect to D7-D0. This balances more evenly the load on the two
halves of the data bus in an 8-bit system.
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
2-3
Page 29
System Integration Module
ADDR
UDS
LDS
R/W
AS
DTACK
Group Base Register
Compare Logic
Group Mask Register
DTACK Generation
CSA
CSB
CSC
CSD
CSD3 Compare Logic
PCMCIA V1.0
Chip-Select Base Register
Compare Logic
Chip-Select Mask Register
CSA0
CE1
CE2
OE
WE
CSA0-CSA3
CSB0-CSB3
CSC0-CSC3
CSD0-CSD3
CSA1
CSA2
CSA3
Figure 2-2. Chip Select Block
The default for each chip-select is a 16-bit data-bus width. The BUSW bits in the chip-select
option registers enable 16-bit/8-bit data-bus width for each of the 16 chip-select ranges. The
initial bus width for the boot chip-select is selected by placing on the BBUSW pin at reset a
logic 0 or 1 to specify 8-bit or 16-bit wide data bus, respectively. This allows a boot EPROM
of either data-bus width to be used in any given system.
All external accesses that do not match one of the chip-select address ranges will be
assumed to be a 16-bit device. That is just one access performed for a 16-bit transfer. It can
also be a 8-bit port but accessed at every other byte.
The boot chip-select is initialized from cold reset to assert in response to any address except
the on-chip module register space (i.e. $FFFFF000 to $FFFFFFFF or $FFF000 to
$FFFFFF). This ensures a chip-select to the boot ROM or EPROM to fetch the reset vector
and execute the initialization code, which should set up the SCR and the chip-select ranges
early on in that initialization sequence.
The data-bus port size for CSA0 on reset, and hence the data width of the boot ROM device,
is programmed by placing on the BBUSW pin during reset logic 0 or 1 for 8-bit and 16-bit
wide data bus, respectively.
The other chip-selects are initialized to be nonvalid, and so will not assert until they are programmed and the valid bits set.
2-4
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 30
System Integration Module
2.1.2.2 OVERLAP IN CHIP-SELECT RANGES. Users should take care when
programming the group address and chip-select registers. If they are programmed to
overlap, the CS signals will overlap.
NOTE
Unused chip-selects must be programmed to 0 wait states and
16-bit width. Map them to dummy space, if possible.
When the CPU attempts to write to a read-only location, as programmed by users when
setting up the chip-selects, the chip-select signal is not asserted, no DTACK
BERR
is asserted if the bus-error timer is enabled.
is asserted and
NOTE
The chip-select logic does not allow an address match during interrupt-acknowledge (Function Code 7) cycles.
The programming of the chip-select module is discussed later in this chapter. For additional
information, refer to
2.5 Chip-Select Registers.
2.2 PROGRAMMING MODEL
The various modules in the MC68328 processor, including the SIM28, contain registers that
control the modules and provide status information from the modules. All of these registers
reside in the top 4096-byte range ($FFFFF000 to $FFFFFFFF) of addresses in the memory
map of the MC68EC000 core processor. It is also doubly mapped at $FFF000 to $FFFFFF
from reset.
2.2.1 System Control Register (SCR)
The SCR can be read or written at any time by 8-bit or 16-bit transfers. An 8-bit read/write
location, it resides at address hex $FFF000 or $FFFFF000 in supervisor data space. The
SCR cannot be accessed in user data space if the supervisor-only bit (SO) is set. The SO
bit is set to 1 after reset. The register consists of 3 status bits and 4 system-control bits. The
bus-error timeout (BETO) status bit is normally 0 and is set to 1 by a bus timeout event in
the system. Writing a 0 to these bits has no effect; writing a 1 clears the status bit.
76543210
BETOWPVPRVBETENSODMAPRSVD WDTH8
Address: $(FF)FFF000Reset Value: $0C
Figure 2-3. System Control Register
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
2-5
Page 31
System Integration Module
BETOBus-Error Timeout
This status bit is set when the bus-error timer times out. Writing a 1 to this bit clears it while
writing a 0 has no effect.
WPVWrite-Protect Violation
This status bit is set when a write-protection violation occurs; that is, when there is a write
to a write-protected area. Writing a 1 to this location clears the status bit while writing a 0
has no effect.
PRVPrivilege Violation
This status bit is set when accessing a supervisor-only area in user mode. Writing a 1 to
this bit clears the status bit while writing a 0 has no effect.
BETENBus-Error Timeout Enable
The bus-error timeout function is enabled when this control bit is set. BERR is asserted
on the bus cycle if the bus timer reaches the terminal count and the DTACK
is not assert-
ed.
SOSupervisor Only
This supervisor-only control bit limits the on-chip register accesses to supervisor only.
Writing a 1 to this location sets to supervisor-only mode. Clearing this bit allows both supervisor and user to access the on-chip registers.
DMAPDouble Map
If this bit is set, the register is mapped at $FFFFF000-$FFFFFFFF and $FFF000$FFFFFF. If the bit is cleared, the register is mapped at $FFFFF000-$FFFFFFFF only.
This bit is set to 1 after reset.
RSVDReserved
Reserved bit. Should be 0 in normal operating mode.
WDTH88-Bit Width Select
This control bit should be set to 1 when the system is an 8-bit only system. This allows
D7-D0 pins to be used for port B I/O.
2.3 INTERRUPT CONTROLLER BLOCK
The interrupt controller supports a variety of interrupts, both internal and external. This block
prioritizes and encodes pending interrupts. It also generates vectors during the interruptacknowledge cycle.
2.3.1 Interrupt Controller Overview
The interrupt-controller block supports 23 interrupts. Both edge- and level-sensitive interrupts are supported. A programmable vector can be generated for each interrupt level. Interrupt sources include the following:
2-6
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 32
INTERRUPTS
................
INTERRUPT PENDING REGISTER
................
INTERRUPT MASK REGISTER
System Integration Module
VECTOR
GENERA TOR
DECODE
PRIORITY
ENCODER
IPL[2:0]VECTORIACK
Figure 2-4. Interrupt Controller Block Diagram
• IRQ7 (level 7)
• SPI slave needs service (level 6)
• Timer 1 event (level 6)
• IRQ6
• PENIRQ
external interrupt (level 6)
(level 5)
• SPI master needs service (level 4)
• Timer 2 event (level 4)
• UART needs service (transmit or receive) (level 4)
Users have access to the upper five bits of the vector that allow placement of the interruptvector table anywhere in the vector space.
The interrupt controller gathers, prioritizes, and posts interrupts to the M68000 core. Full
compatibility with normal M68000 operation is maintained.
Here’s a typical scenario: when an interrupt is received, it is prioritized. Assuming there are
no higher interrupts pending, it is posted to the M68000 core. The core responds with an
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
0-INT7 (level 4) - these pins are muxed with keyboard
2-7
Page 33
System Integration Module
interrupt-acknowledge cycle. The interrupt controller generates a vector and presents it to
the core, which then jumps to the interrupt-service routine. If the core is in an interrupt-service routine and a higher priority interrupt is posted, the process repeats and the higher priority is serviced. Interrupt priority is based on the interrupt level. Interrupts with the same
interrupt level are prioritized by the software during the execution of the interrupt-service
routine. The MC68328 processor provides one interrupt vector for each interrupt level. The
most significant 5 bits of the interrupt vector are user-programmable while the lower 3 bits
reflect the interrupt level being serviced.
All interrupts are maskable. Writing a 1 to a bit in the interrupt-mask register disables that
interrupt. If an interrupt is masked, its status is accessible in the interrupt-pending register.
2.3.2 Programmer’s Model
This section describes the bits and registers that control the interrupt module. All unused bits
may be written with no effect. When they are read, they indicate 0.
2.3.2.1 INTERRUPT VECTOR REGISTER (IVR). This register programs the upper 5 bits of
the interrupt vector.During the interrupt-acknowledge cycle, the lower 3 bits encode the
interrupt level.
76543210
VECTOR000
Address: $(FF)FFF300Reset Value: $00
Figure 2-5. Interrupt Control Register
NOTE
If the interrupt-vector register is never programmed and an interrupt occurs, the interrupt vector $0F is returned to indicate an
uninitialized interrupt.
2.3.2.2 VECTOR GENERATOR. The interrupt controller block provides a vector to the
MC68EC000 core. Users have access to the upper 5 bits of the vector to place the vector
table anywhere in the vector space. Coding for the vectors is as follows:
2.3.2.3 INTERRUPT CONTROL REGISTER (ICR). This register controls the external-inter-
rupt inputs. It has polarity control and edge/level programmability.
1514131211109876543210
ET1ET2ET3ET6POL1POL2POL3POL6UNUSED
Address: $(FF)FFF302Reset Value: 0000
Figure 2-6. Interrupt Control Register
ET1IRQ1
While this bit is set, the external IRQ1
IRQ1
Edge Trigger Select
bit is an edge-triggered interrupt. Users must clear
in the interrupt-status register to clear the interrupt; that is, writing a 1 to the IRQ1
bit in the interrupt-status register. While this bit is low, IRQ1 is a level-sensitive interrupt.
In this case, users must clear the source of the interrupt. On reset, this bit is cleared to 0
(level-sensitive interrupt).
bit is an edge-triggered interrupt. Users must clear
in the interrupt-status register to clear the interrupt. While this bit is low, IRQ2 is a
level-sensitive interrupt. In this case, users must clear the source of the interrupt. On reset, this bit is cleared to 0 (level-sensitive interrupt).
bit is an edge-triggered interrupt. Users must clear
in the interrupt-status register to clear the interrupt. While this bit is low, IRQ3 is a
level-sensitive interrupt. In this case, users must clear the source of the interrupt. On reset, this bit is cleared to 0 (level-sensitive interrupt).
in the interrupt status register to clear the interrupt. While this bit is low, IRQ6 is a
IRQ6
level-sensitive interrupt. In this case, users must clear the source of the interrupt. On reset, this bit is clear to 0 (level-sensitive interrupt).
bit is an edge-triggered interrupt. Users must clear
2-9
Page 35
System Integration Module
POL2 Polarity Control for Interrupt 2
0 = Negative polarity
1 = Positive polarity
POL3 Polarity Control for Interrupt 3
0 = Negative polarity
1 = Positive polarity
POL6 Polarity Control for Interrupt 6
0 = Negative polarity
1 = Positive polarity
2.3.2.4 INTERRUPT MASK REGISTER (IMR). This control register masks the interrupt if
the corresponding control bit is set. There is one control bit for each interrupt source. When
an interrupt is masked, it does not generate an interrupt request to the processor core, but
its status can still be observed in the interrupt-pending register. From reset, all the interrupts
are masked and all the bits in this register are set to 1.
The interrupt-mask bit positions corresponds to the bits in the interrupt-status register, interrupt-pending register, and wakeup-enable register. When each bit is set, its interrupt is
masked (disabled).
MSPIM(Mask SPI Master Interrupt, Bit 0)
This bit, while set, indicates that the SPI master interrupt is masked. It is set to 1 after reset.
This bit, while set, indicates that the IRQ7 interrupt is masked. It is set to 1 after reset. The
IRQ7 is nonmaskable in the sense that if the interrupt level is masked all the way to level
7 in the M68000 core, the IRQ7 interrupt is still observed by the processor because the
level 7 interrupt is nonmaskable for the M68000 core. It can, however, be masked by this
control bit.
0 = Enable IRQ7 interrupt
1 = Mask IRQ7 interrupt
2.3.2.5 INTERRUPT WAKEUP-ENABLE REGISTER (IWR). This control register enables
the corresponding interrupt source to start the power-control-wakeup sequence. While the
bit is set, it enables that interrupt to cause wakeup; while the bit is clear, the function is disabled. After reset, all wakeups are enabled and all the bits in this register are set to 1.
2.3.2.6 INTERRUPT STATUS REGISTER (ISR). This register indicates which interrupts
are asserting to the processor. When an interrupt vector is passed to the MC68EC000 core,
the interrupt-handler routine can determine the source of interrupt by examining this status
register. If there are multiple interrupt sources at that level, the software can prioritize them
at that time. There is one interrupt vector for each interrupt level. The lower three bits of the
interrupt vector constitute the interrupt level being acknowledged
All the interrupt status bits, except IRQs 1, 2, 3, 6, and 7, reflect the interrupt request from
their respective interrupt sources. A status bit is cleared when the interrupt request is
cleared from the requesting module or input pin. Refer to the timer, SPIM, SPIS, RTC, and
PWM sections for details on clearing an interrupt request from those modules. The IRQ7
is
an active low-edge triggered interrupt request. Its status is cleared by writing a 1 to the IRQ7
interrupt status bit. The IRQs 1, 2, 3, and 6 are edge/level programmable. These interrupt
bits are cleared by writing a 1 to the corresponding interrupt status bit if they are programmed as edge-triggered.
RQ6
I
This bit, while set, indicates that an external device is requesting an interrupt on level 6.
If IRQ6 is set to be a level-sensitive interrupt, users must clear the source of the interrupt.
If IRQ6 is set to be an edge-sensitive interrupt, users must clear the interrupt by writing a
1 to this status bit. Writing a 0 to this bit and the other bits of this register has no effect.
This bit, while set, indicates that the UART module needs service. The transmitter might
need data, the receiver might have data ready to transfer to memory, or the CTS or GPIO
pins might have changed state. Each of these interrupts is maskable in the UART control
register. Refer to the UART description for details. This interrupt is a Level 4 interrupt.
0 = No UART service request pending
1 = UART service needed
SPIM
SPIM indicates that a data transfer completed by setting this bit high. Users must clear
this interrupt in the SPI control register. Refer to the SPI section for details. This interrupt
is a Level 4 interrupt.
This bit, while set, indicates that an external device requests an interrupt on Level 2. If
is set to be a level-sensitive interrupt, users must clear the source of the interrupt.
IRQ2
If IRQ2
is set to be an edge-sensitive interrupt, users must clear the interrupt by writing a
1 to this status bit. Writing a 0 to this bit and the remainder of the bits in this register has
no effect.
This bit, while set, indicates that an external device requests an interrupt on Level 1. If
is set to be a level-sensitive interrupt, users must clear the source of the interrupt.
IRQ1
If IRQ1
is set to be an edge-sensitive interrupt, users must clear the interrupt by writing a
1 to this status bit. Writing a 0 to this bit and the remainder of the bits in this register has
no effect.
2.3.2.7 INTERRUPT-PENDING REGISTER (IPR). This read-only register indicates which
interrupts are pending. If an interrupt source requests an interrupt but that interrupt is
masked by the interrupt-mask register, that interrupt bit will be set in the interrupt-pending
register, but not in the interrupt-status register. If it is not masked, the interrupt bit will be the
same in both registers.
Keyboard-interrupt features provide smart power management. The MC68EC000 can be
placed in sleep mode when no keys are pressed. When a key is pressed, the MC68EC000
can wake up and serve the user’s request. This event-driven approach significantly reduces
power consumption. KB0
ation is performed on these inputs to generate an interrupt, indicating to the MC68EC000
core that a key was pressed.
to KB7 are input pins for the keyboard interface. A logical OR oper-
2.5 CHIP-SELECT REGISTERS
The following paragraphs describe the registers in the chip-select function and an example
of how to program the registers. The chip-select function does not operate until the register
is initialized and the valid bit is set in the corresponding group-base address registers. The
only exception is the CSA0
, which is the boot device chip-select.
2.5.1 Group-Base Address Registers (GBR0-GBR3)
There are four 16-bit group-base address registers in the chip-select function (one for each
chip-select group). The group registers (group-base address register and group-base
address mask register) decode the upper address bits and the chip-select option registers
decode the lower address bits. There are 4 chip-selects in each group. For example, in
group A, the chip-selects are C
The group-base address field (the upper 12 bits of each base address register) selects
the starting address for the group address range. The corresponding bits GBA31–GBA20
SA0, CSA1, CSA2, and CSA3.
2-16
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 42
System Integration Module
in the group-base mask register define the block size for the group. The base address field
is compared to the address on the address bus to determine if the group is decoded.
VValid Bit
This bit indicates the validity of the contents of its base address register and address mask
register pair. The programmed chip-selects do not assert until the V-bit is set. A reset
clears the V-bit in each base address register.
1 = Contents are valid
0 = Contents are not valid
2.5.2 Group-Base Address Mask Registers
These registers adjust the comparison range for the group. Bits in this register set to 1
always compare true with the corresponding address line.
0 = The corresponding address bit must match for a group to match
1 = The corresponding address bit compares true (don’t care)
These bits mask address A31 through A20. Usually, the group base address mask register
bits select the group size. For example, if all the mask bits are cleared, A31 to A20 are compared against the value programmed in the group base address register. In this case, the
group has a 1 Mbyte space. If bit 4 (GMA20 bit) is set and the remainder of the bits are clear,
the group is selected if A31 to A21 are the same as the value programmed in the group-base
address register. This provides 2 Mbyte of space for the group. Further decoding is performed for each chip-select by comparing lower address lines and the chip-select registers.
If the devices are small, it is possible to program the groups to the same space and use the
chip-select registers to decode the areas for each chip-select.
2.5.3 CHIP-SELECT REGISTERS
There are four 32-bit chip-select option registers in each chip-select group—one for each
chip-select signal.
Figure 2-12. Chip-Select Registers for Group C and D
Chip selects in group A and B (i.e. CSA0, CSA1, CSA2, CSA3, CSB0, CSB1, CSB2, CSB3)
decode address A23-A16 (minimum 64K of space). Chip selects in group C and D decode
address A23-A12 (minimum 4K of space).
ADDRESS COMPARE 23-16 (Group A, B)
This bit field is the address-compare field. A group address match and a match of address
bits 23-16 generate this chip-select. Notice some of the address bits overlap in the group
base address/mask registers and the chip-select register. This allows for a large group to
be selected and for chip-select to be finely decoded.
ADDRESS MASK 23-16
This field masks corresponding bits in the address-compare field. A ‘‘1’’ forces a true comparison (don’t care) on the corresponding bit.
ADDRESS COMPARE 23-12 (Group C, D)
This bit field is the address-compare field. A group address match and a match of address
bits 23-12 generate this chip-select.
ADDRESS MASK 23-12
This field masks corresponding bits in the address compare field. A “1” forces a true comparison (don’t care) on the corresponding bit.
BSWBus Width
This bit sets the bus width for this chip-select area.
0 = 8-bit
1 = 16-bit
RORead Only
This bit sets the chip-select to read only. Otherwise, read and write accesses are allowed.
Writes to read-only areas generate a bus error.
0 = Read/Write
1 = Read Only
2-18
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 44
System Integration Module
WAIT
This field determines the number of wait states added before an internal DTACK
is re-
turned for this chip-select.
000 = Zero wait states
001 = One wait state
010 = Two wait states
011 = Three wait states
100 = Four wait states
101 = Five wait states
110 = Six wait states
111 = External DTACK
2.6 PCMCIA 1.0 SUPPORT
The MC68328 processor supports PCMCIA 1.0 memory card chip-selects and read / write
signals. To meet the fanout requirement, use external buffers to interface to the memory
card.
2.6.1 Block Diagram Overview
CSD3
Chip Select
Decode
Data
Control
Address
PCMCIA
Signal
Decode
Figure 2-13. PCMCIA Block Diagram
The PCMCIA address decode is through CSD3. Selecting CSD3 assets the corresponding
PCMCIA control signals.
CE1
CE2
OE
WE
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
2-19
Page 45
System Integration Module
2-20
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 46
SECTION 3
PHASE-LOCKED LOOP AND POWER CONTROL
The phase-locked-loop (PLL) block generates all clocks for the MC68328 processor. It
includes a crystal oscillator for use with low-frequency (32.768 kHz) crystals. The PLL generates a high-frequency master clock phase-locked to the crystal reference.
3.1 OVERVIEW
The PLL is a flexible clock source for the MC68328. It provides a crystal-controlled master
clock at frequencies from 10MHz to the maximum operational frequency in 32-kHz steps.
The master clock can be divided to provide a system clock as low as 1/16th of the voltagecontrolled oscillator (VCO) frequency. The low-frequency reference clock (32.768 kHz or
38.4 kHz) is always available to the real-time clock or timer. The PLL can be disabled to save
power, but it can be re-enabled within 2 ms of a wake-up interrupt. This block, in conjunction
with the power-control block, provides an efficient power-control mechanism for the
MC68328 processor (see Figure 3-1 below).
MPU BUS
EXTAL
XTAL
WAKEUP
Crystal
Oscillator
Phase Locked
Loop
MPU Interface
SYSCLK
Divider
PIXCLK
CLK32
Figure 3-1. PLL Block Diagram
3.2 PROGRAMMER’S MODEL
The PLL has three registers that provide complete control and status information. Descriptions of these registers follow.
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
3-1
Page 47
Phase-Locked Loop and Power Control
3.2.1 PLL Control Register
This register (illustrated in Figure 3-2) controls the overall PLL operation. Several bits are
provided for control of the dynamic performance of the PLL. Refer to
ation details.
1514131211109876543210
UNUSEDPIXCLK SELSYSCLK SELUNUSEDCLKEN DISPLLRSVD
Address: $(FF)FFF202Reset Value: $2410
Figure 3-2. PLL Control Register
PIXCLK SEL
These bits select the master frequency for the LCD pixel clock. The master clock is derived from the VCO frequency as shown by the list below.
These bits select the master frequency for the MC68328 processor system clock. The
master clock is derived from the VCO frequency as shown by the list below.
These bits can be changed at any time. The VCO frequency is unaffected by changes.
CLKEN
This bit enables the CLKO pin while high.
1= CLKO enabled
0= CLKO disabled
DISPLLDisable PLL
This bit, while high, disables the PLL. The system clock is shut down and the MC68328
processor assumes its lowest power state. Only the 32 kHz clock runs. Refer to
for a description of the preferred method for system clock shutdown. Once the PLL
3.4.3
Section
is disabled, only a wake-up interrupt or reset can re-enable it.
1 = PLL disabled
0 = PLL enabled
3.2.2 Frequency Select Register
This register (illustrated in Figure 3-3) controls the two dividers of the dual-modulus counter.
One additional bit assists the software to protect the PLL from accidental writes that change
3-2
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 48
Phase-Locked Loop and Power Control
the frequency. Another bit prepares for the VCO frequency change. While this register can
be accessed as bytes, it should always be written as a 16-bit word.
1514131211109876543210
CLK32PROTUNUSEDQCPC
Address: $(FF)FFF202Reset Value: $0123
Figure 3-3. Frequency-Select Register
CLK32Clock 32
This bit indicates the current status of the CLK32 signal and synchronizes the software to
the 32kHz reference clock when the VCO frequency is to be changed or the PLL is to be
disabled. Refer to Section
3.3 PLL Operation for details.
PROTProtect Bit
This bit protects the “P” and “Q” counter values from additional writes. After this bit is set
by software, the frequency-select register cannot be written. Only a reset clears this bit.
QCQ Count
These bits control the “Q” counter.
PC P Count
These bits control the “P” counter.
3.3 PLL OPERATION
This section describes the operation and preferred sequences to control the PLL.
3.3.1 Initial Powerup
At initial powerup, the crystal oscillator begins oscillation within several hundred milliseconds. While reset remains asserted, the PLL begins the lockup sequence and locks within
several milliseconds of the crystal oscillator startup. Once lockup occurs, the system clock
is available at the default master frequency of 16.580608 MHz (assuming a 32.768 kHz crystal). To generate the master frequency, multiply the reference (32.768 kHz) by the PLL divisor. The default divisor is 506. The divisor can be changed under software control and is
outlined below.
NOTE
The default divider value (506) was selected as it can directly
generate standard baud frequencies at accuracies of better than
0.01%.
3.3.2 Divider
The PLL uses a dual-modulus prescaler to reduce power consumption. This approach
divides the VCO frequency by 14 before it is fed to the rest of the divider chain. Dual-modulus counters operate differently from other counters in that the overall divide ratio is dependent on two separate values, P and Q. Besides the power-saving advantage above a divisor
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
3-3
Page 49
Phase-Locked Loop and Power Control
of 225 (decimal), every divisor is available to fine-tune the VCO in 32 kHz steps. The formula
for the dual-modulus divider is:
Divisor = 14 (P + 1) + Q + 1
Where:
1 <= Q <= 14
P >= Q + 1
Below the value of 225, some divisors are not allowed as the P and Q relationships cannot
be met.
3.3.3 Normal Startup
When the MC68328 processor is awakened from sleep mode by a system interrupt, the PLL
achieves lock within a few milliseconds. The crystal oscillator is always on after initial powerup, so the crystal startup time is not a factor. The master clock starts operation after the
PLL achieves lock.
3.3.4 Change of Frequency
To change the VCO frequency, use the sequence below. As the system clock is disabled
while the PLL loses then reacquires lock, disable all peripheral devices before making
changes to the frequency.
This fragment assumes all peripherals have been disabled and the CPU is operating at the
highest possible frequency (SYSCLK SEL = 7). FREQSEL is the address of the frequencyselect register. NEWFREQ is the new frequency value (P and Q values) to be programmed.
lea #$FFF202,A0point to the Freq Sel Register
move.w #NEWFREQ,D1prepare the new frequency (Q and P)
WAITmove.w (A0),D0get the contents of the register
bpl.w WAITwait for CLK32 to go high
move.w D1,(A0)load the new frequency
WAIT1move.w (A0),D0the program will wait in WAIT1
bmi.w WAIT1or WAIT2 during the period when the
WAIT2move.w (A0),D0PLL loses then reacquires lock
bpl.w WAIT2
* at this point, the PLL will have reacquired lock and SYSCLK will
* be stable at the new frequency and the program can continue
Normally, the master frequency will be changed only during the bootup sequence. While it
is possible to dynamically control the master frequency, it is recommended that the frequency be set to its permanent value at bootup (or use the default).
3.3.5 PLL Shutdown
The procedure for PLL shut down to place the system in sleep mode is similar to changes
made to the frequency. The difference is that the system can be awakened only by an interrupt or reset. While there are different approaches, the simplest is to synchronize the soft-
3-4
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 50
Phase-Locked Loop and Power Control
ware to the rising edge of CLK32, write the disable bit, then execute a STOP instruction. The
CPU no longer fetches instructions then waits for the clock to stop. When an interrupt awakens the system after the PLL acquires lock, the CPU executes an interrupt-service routine
for the level of the pending interrupt. After the interrupt-service routine, the CPU begins execution at the instruction after the STOP instruction. The instruction sequence below illustrates the flow. It is assumed that all peripherals and the LCD controller have been shut
down before the PLL stops.
lea #$FFF202, AOpoint to the Freq Sel Register
WAITmove.w (A0),D0synchronize to rising CLK32 edge
bpl.w WAITwait for CLK32 to go high
bset #3,(A0)Disable the PLL
stop #$2000stop fetching and wait for any IRQ
* The system waits here for the PLL to restart after a wakeup IRQ
* After the IRQ routine, the instruction flow continues from here
JMP STARTUPjump to housekeeping routine
3.4 POWER CONTROL MODULE OVERVIEW
The power control module improves power efficiency as it allocates power (clocks) to the
CPU core and other modules in the MC68328 processor under software control. Clocks can
be enabled in bursts. While executing tasks that require significant CPU resources, the clock
can be enabled for extended periods of time. While the CPU is relatively idle, the clock can
be disabled or bursted with a low duty cycle. When a wakeup interrupt occurs, the clock is
immediately enabled, allowing the CPU to service the request. The DMA controller is not
affected by the power controller. It has full access to the bus while the CPU is idle, keeping
the screen refreshed. The following sections describe the use and operation of the power
control block.
3.4.1 Description
Figure 3-4 is a block diagram of the power control module. Following reset, the power controller is disabled and the MC68EC000 clock is continuously on. When the block is enabled,
software controls the clock burst width in increments of 1/31. Initially, the duty cycle is set to
100%. Software can then change the duty cycle to a lower value and the clock begins to
burst. In normal operation, the MC68EC000 does not have to operate continuously. Usually,
it waits for user input. An interrupt from the keyboard, for example, disables the power controller, and the clock again becomes continuous. When the software completes its service
of the task, the power controller can again be enabled to burst the clock and reduce power
consumption. Clock control is in increments of approximately 3% (1/31).
When the burst-width control sub-block indicates that the CPU clock’s time slot has expired
and is to be disabled, clock control requests the bus from the CPU. After the bus is granted,
the clock stops. Bus grant to the DMA controller is asserted and the DMA controller has
complete access to the bus.
If a wakeup interrupt event occurs while the CPU clock is disabled, the clock is immediately
enabled and the CPU processes the interrupt. The DMA controller always has priority, so if
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
3-5
Page 51
Phase-Locked Loop and Power Control
CLK32
CPU Bus Request
MPU Interface
BURST WIDTH
CONTROL
WAKEUP
CPU Bus Grant
MPU BUS
CLOCK
CONTROL
DMA Bus Grant
DMA Bus Request
CLK68K
Figure 3-4. Power Control Module
a DMA access is in progress, the CPU will wait until the DMA controller has completed its
access before interrupt processing begins.
Figure 3-5 describes the power controller operation. In this example, the clock bursts at
about 15% duty cycle, so the MC68EC000 is active about 15% of the time. The remainder
of the time, the MC68EC000 is in sleep mode. When a wakeup event occurs, the clock
immediately restarts so the processor can service the wakeup event interrupt. The powercontroller burst period is 31 CLK32 periods, or approximately 1 msec. Note that the LCD
DMA controller has access to the bus at all times and the SYSCLK—master clock to all
peripherals— is continuously active.
1 msec
SYSCLK
CPUCLK
CPU ACTIVE
CPU SLEEP
CPU ACTIVE
CPU SLEEP
CPU ACTIVE
CPU SLEEP
WAKEUP EVENT
CPU ACTIVE
Figure 3-5. Power Control Operation
3-6
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 52
Phase-Locked Loop and Power Control
3.4.2 MPU Interface
One register is associated with the power control block. Figure 3-6 illustrates the bits in the
register.
This bit controls the operation of the power controller. While this bit is low, the clock to the
MC68EC000 is continuously on. While this bit is high, the clock is bursted to the
MC68EC000 under control of the width comparator. An interrupt that can wake up the
MC68EC000 disables the power controller by a negation of this bit. The user’s interruptservice routine must re-enable this bit to re-enter power-save operation. This bit resets to
zero.
STOP
1 = Stop CPU clock
0 = Normal CPU clock bursts
This bit immediately enters the power-save mode without waiting for the power controller
to cycle through a complete burst period. This bit disables the CPU clock after the bus cycle that follows the next CLK32 rising edge. When the system is to enter the doze mode,
this bit is set. On the next burst period, or interrupt, the clock will restart for its allotted period. This bit is reset to zero.
WIDTH
Width of CPU clock bursts. These bits reset to 11111 ($1F).
These bits control the width of the CPU clock bursts in 1/31 increments. While the WIDTH
is 1 and the power controller is enabled, the clock is bursted to the CPU at a duty cycle of
1/31. While the WIDTH bits are 1F(hex), the clock is always on. While the WIDTH is zero,
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
3-7
Page 53
Phase-Locked Loop and Power Control
the clock is always off. Set the WIDTH to 0 when the CPU should be disabled for extended
time periods, but it can be awakened without waiting for the PLL to re-acquire lock.
These bits are not affected by the PC EN bit. When an interrupt disables the power controller, these bits are not changed. Users should re-enable the power controller that services the interrupt.
3.4.3 Operation
This section describes how to use the power controller.
3.4.3.1 NORMAL OPERATION. When the MC68328 processor begins operation after
reset, the power controller is disabled and the MC68EC000 clock runs continuously. To
reduce the power consumed by the MC68EC000, the power controller is enabled when the
PC EN bit is set. The value in the WIDTH register determines the duty cycle of the clock that
is applied to the MC68EC000. If an interrupt is received, the power controller is automatically
disabled. It is up to the interrupt-service routine to re-enable the power controller.
3.4.3.2 DOZE OPERATION. The MC68EC000 clock can be disabled for extended periods
by setting the WIDTH register to 00000. The MC68EC000 clock is enabled when it receives
an interrupt. At the end of the service routine, the power controller can be re-enabled, putting
the MC68EC000 back into DOZE mode. Once the MC68EC000 clock is disabled, only an
interrupt or hardware reset can re-enable it. For various MC68EC000 resource requirements, users can program the duty-cycle register for burst-duty cycles of any value between
0/31 and 31/31. This effectively provides a variable clock frequency (and power dissipation)
of between 0% and 100% of the system clock frequency in 3% incremental steps.
3.4.3.3 SLEEP OPERATION. The PLL is disabled in the SLEEP mode. Only the 32 kHz
clock continuously operates to keep the real-time clock operational. Wakeup events can
activate the PLL and the system clock will begin to operate within 2 msec.
3-8
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 54
SECTION 4
LCD CONTROLLER MODULE
The liquid crystal display controller (LCDC) provides display data for an external LCD driver
or LCD panel module. The key features include the following:
• Share system and display memory, no dedicated video memory required
• Standard panel interface for common LCD drivers
• Supports single (non-split) screen monochrome LCD panels
• Fast flyby type, 16-bit wide, burst-DMA screen refresh transfers from system memory
• Maximum display size is 1024x512; however, the typical non-split panel sizes are
320x240 and 640x200
• Panel interface: 1-, 2-, or 4-bit wide LCD data bus
• Black and white, or 4 simultaneous gray levels out of a palette of 7
• Hardware blinking cursor; programmable up to 32 x 32 pixels in size
• Hardware panning (soft horizontal scrolling)
The LCDC fetches display data directly from system memory through periodic DMA transfer
cycles. The bus bandwidth used by the LCDC is low, thereby enabling the MC68EC000 core
to have sufficient computing bandwidth for other tasks.
4.1 LCDC SYSTEM OVERVIEW
The LCDC is built of six basic blocks, namely MPU interface registers, screen DMA controller, line buffer, cursor logic, frame-rate control and LCD panel interface as shown in Figure
4-1.
4.1.1 MPU Interface
The MPU interface consists of all control registers that enable all different features of the
LCDC. This block is connected directly to the 68K bus.
4.1.2 Direct Memory Access (DMA)
The DMA generates a bus-request signal to the MC68EC000 periodically and, upon receiving a bus grant, performs a 16- or 8-word memory burst to fill the line buffer. The number of
DMA clock cycles per transfer is programmable (1, 2, 3, or 4 clocks/transfer), which makes
it more versatile to support systems with memory of different speeds.
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
4-1
Page 55
LCD Controller
LCDSystem
(fast)(slow)
Address
Data
ClockClock
LCDC
LCD Driver
LCD
Interface
Frame
Rate
Control
LCD Driver
68EC000
Core
BR
BG
MPU
Interface
Registers
SIM28
CS
System
Memory
OE
Screen
DMA
Cursor
Logic
Line Buffer
Figure 4-1. System Block Diagram of LCDC
4.1.3 Line Buffer
The line buffer collects display data from system memory during DMA cycles, and outputs
it to the cursor-logic block. The input is synchronized with the fast DMA clock, while the output is synchronized to the relatively slow LCD pixel clock.
4.1.4 Cursor Control Logic
The cursor control logic (when enabled) generates a block-shaped cursor on the display
screen. Users can adjust the cursor height and width to any number between 1 to 31. The
cursor can be full black or reversed video, and the blinking rate is adjustable when the blinkenable bit is on.
4.1.5 Frame Rate Control (FRC)
The frame rate control (FRC) is used primarily for gray-scale display and can generate up
to 4 gray levels from the choice of 7 density levels (0, 1/4, 5/16, 1/2, 11/16, 3/4, 1 as in Table
4-3). The density level corresponds to the number of times the pixel is being turned on when
the display is refreshed frame by frame. Because the crystal formulations and driving voltage may vary, the visual gray quality can be tuned by programming the gray palette-mapping register (GPMR) to obtain the best effect.
Because blinking or flickering will occur if all LCD pixel cells are synchronized, it is essential
to program two 4-bit numbers, namely Xoff and Yoff in the FRC offset register (FOSR), to
minimize flickering. As a general rule, select odd numbers that differ by 2. The optimal offset
4-2
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 56
LCD Controller
values could vary among different models of LCD panels—even from the same manufacturer—because of different inter-pixel crosstalk characteristics.
4.1.6 LCD Interface
The LCD interface logic packs the display data in the correct size and outputs it to the LCD
panel data bus. The polarity of FRM, LP, and SCLK signals as well as pixel data can all be
programmable to suit different types of LCD panel requirements.
4.2 INTERFACING LCDC WITH LCD PANEL
LACD
LFLM
LP
LCD Panel Module
MC68328
LSCLK
LD0
LD1
LD2
LD3
Figure 4-2. LCD Module Interface Signals
LCD Data Bus (LD3-LD0)
This output bus transfers pixel data to the LCD panel for display. Depending on which
LCD panel mode was selected, data is arranged differently on the bus for each mode. Users can program the output pixel data to be negated. See the POLCF register description
for details.
First Line Marker (LFLM)
This signal indicates the start of a new display frame. The LFLM signal becomes active
after the first line pulse of the frame and remains active until the next line pulse, at which
point it de-asserts and remains inactive until the next frame. Users can program the LFLM
signal using software to be active-high or active-low. See the POLCF register description
for details.
Line Pulse (LP)
This signal latches a line of shifted data onto the LCD panel. It becomes active when a
line of pixel data is clocked into LCD panels and stays asserted for a duration of 8 pixel
clock periods. Users can program the LP signal using software to be either active-high or
active-low. See the POLCF register description for details.
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
4-3
Page 57
LCD Controller
Shift Clock (LSCLK)
This is the clock output that is synchronized to the LCD panel output data. Users can program the LSCLK signal using software to be either active-high or active-low. See the
POLCF register description for details.
Alternate Crystal Direction (LACD)
This output is toggled to alternate the crystal polarization on the panel. Users can program
this signal to toggle at a period of 1 to 16 frames. The alternate crystal direction (LACD,
also called M) pin will toggle after a pre-programmed number of FLM pulses. Users can
program the ACD rate-control register (ACDRC) so that LACD will toggle once every 1 to
16 frames. The targeted number of frames is equal to the alternation code’s 4-bit value
plus one. The default value for ACDRC is zero; that is, LACD will toggle on every frame.
The LACD output signal is synchronized with the trailing (falling) edge of the line pulse
(LP) enclosed by FLM.
Table 4-1. ACDRC Value and Number of Cycles
ACDRCNo of Cycles
00001
00012
00103
01005
10009
111116
4.3 PANEL I/F TIMING
The LCDC signal continuously pumps the pixel data into the LCD panel via the LCD data
bus. The bus is timed by shift clock (LSCLK), line pulse (LLP) and first line marker (LFLM).
The LSCLK clocks the pixel data into the display drivers’ internal-shift register. The LP
latches the shifted pixel data into a wide latch at the end of a line while the LFLM marks the
first line of the displayed page.
The LCDC signal is designed for great flexibility to support most of the monochrome LCD
panels available in the marketplace. Figure 4-3 shows the LCD interface timing for 8-bit LCD
data-bus operations.
Figure 4-3 shows the LCD interface timing for 4-, 2-, and 1-bit LCD data-bus operations.
The line pulse signifies the end of the current line of serial data. The LLP enclosed by LFLM
signal marks the end of the first line of the current frame.
Some LCD panels may use an active-low LFLM signal, LLP signal, LSCLK signal, and
reversed pixel data. To change the polarities of these signals, set the first-line marker polarity (FLMPOL), line-pulse polarity (LPPOL), shift-clock polarity (SCLKPOL), and pixel polarity
4-4
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 58
LCD Controller
(PIXPOL) bits to 1, respectively. The LLP and LFLM timing are similar for all panel modes
supported by LCDC.
In additional to the interface timing pins discussed above, an alternate crystal direction
(LACD) pin in LCDC will toggle after a pre-programmed number of LFLM pulses. This pin
prevents crystal degradation in the LCD panel.
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
4-5
Page 59
.
LCD Controller
(a) 4-Bit LCD Data Bus (PBSIZ=10)
FLM
LP
LP
SCK
LD0
LINE 1
LINE 2LINE 3LINE 4LINE nLINE 1
123m/4m/4-13940
[0,0][0,4][0,8]
[0,152] [0,156]
[0,m-8] [0,m-4]
LD1
LD2
LD3
FLM
LP
LP
SCLK
LD0
LD1
FLM
LP
[0,1][0,5][0,9]
[0,2][0,6][0,10]
[0,3][0,7][0,11]
[0,153] [0,157]
[0,154] [0,158]
[0,155] [0,159]
(b) 2-Bit LCD Data Bus (PBSIZ=01)
LINE 1
LINE 2LINE 3LINE 4LINE nLINE 1
123m/2m/2-17980
[0,0][0,2][0,4]
[0,1][0,3][0,5]
[0,156] [0,158]
[0,157] [0,159]
(c) 1-Bit LCD Data Bus (PBSIZ=00)
LINE 1
LINE 2LINE 3LINE 4LINE nLINE 1
[0,m-7] [0,m-3]
[0,m-6] [0,m-2]
[0,m-5] [0,m-1]
[0,m-4] [0,m-2]
[0,m-3] [0,m-1]
LP
123m m-17980
SCLK
LD0
[0,0][0,1][0,2]
Figure 4-3. LCD Interface Timing for 4-, 2-, and 1-Bit Data Widths
4-6
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
[0,78][0,79]
[0,m-2] [0,m-1]
MOTOROLA
Page 60
LCD Controller
4.4 OPERATION OVERVIEW
4.5 DISPLAY CONTROL
The LCDC signal drives single-screen monochrome STN LCD panels with up to 1024x512
pixels in the gray-scale mode at a refresh rate of 60-70 Hz. In any case, the best efficiency
is achieved when the screen width is a multiple of the DMA controller’s 16-bit bus width.
Because of LCD driver-technology limitations, large screens, such as 640x480, are usually
organized in spilt-screen format, which the MC68328 processor does not support. The
actual limit is the number of rows that require high driving voltage. The MC68328 processor
4-bit LCD interface will drive up to 240 rows with a maximum of 1024 columns.
4.5.1 LCD Screen Format
The screen width and height of the LCD panel are software-programmable. Figure 4-4
shows the relationship between the portion of a large graphics file displayed on screen vs.
the actual page. All units are measured in pixel counts in this figure.
Virtual Page Width (VPW)
ScreenStarting Address
(SSA)
Screen Width (XMAX)
Cursor Height
(CH)
Virtual Page Height (VPH)
Cursor X Position
(CX0)
Screen Height (YMAX)
Cursor Width
(CW)
Cursor Y Position
(CY0)
Figure 4-4. LCD Screen Format
The screen width (XMAX) and screen height (YMAX) registers specify the LCD panel size.
The LCD will start scanning the display memory at the location pointed to by the screen
starting address (SSA) register. Therefore, the LCD panel will display the shaded area in
Figure 4-4.
The virtual page width (VPW) and virtual page height (VPH) parameters specify the maximum page width and height, respectively. By changing the screen-starting address (SSA)
register, a screen-sized window can be vertically or horizontally scrolled (panned) anywhere
inside the virtual-page boundaries. The software must position the starting address (SSA)
properly so that the scanning logic’s system memory pointer (SMP) does not stretch beyond
VPW nor VPH. Otherwise, strange artifacts will display on the screen. The programmer uses
the VPH only for boundary checks. There is no VPH register internal to the LCDC.
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
4-7
Page 61
LCD Controller
4.5.2 Cursor Control Logic
To define the position of the hardware cursor, the LCDC maintains a vertical line counter
(YCNT) to keep track of the pixel’s current vertical position. YCNT in conjunction with the
horizontal pixel counter (XCNT) specify the screen position of the current pixel data being
processed. When the pixel falls within a window specified by the cursor reference position
(CXP:10-bit register, CYP: 9-bit register), cursor width (CW:5-bit counter), and cursor height
(CH:5-bit counter), the original pixel bits (outputs of HSRA and B are affected but the latter’s
output is ignored, if not applicable) wil be passed transparently (cursor control bits=00),
replaced with full black, or a complement for reversed video (CC bits=01,10 respectively; 11
not allowed) if a static cursor is chosen (BK_EN=0). Reversed video is preferable for a static
cursor as it will block the original pixels if CC=01. A blinking cursor will display if BK_EN=1,
in which case the original signal and the cursor will alternate periodically.
4.5.3 Display Data Mapping
The LCDC supports 1-bit-per-pixel or 2-bits-per-pixel graphics mode. In the binary mode
(GS=0), each bit in the display memory corresponds to a pixel in the LCD panel. The corresponding pixel on the screen is either fully on or fully off.
In 2-bit-per-pixel operations (GS=1), the frame-rate control circuitry inside the LCDC will
generate intermediate gray tones on the LCD panel by adjusting the densities of 1’s and 0’s
over many frames. A maximum of 4 gray levels can be simultaneously displayed on the LCD
screen.
The system memory data in both 1- and 2- bit-per-pixel modes are mapped as shown in Figure 4-5.
4.5.4 Gray Scale Generation
The LCDC is configured to drive only a single-screen monochrome LCD panel. It cannot
handle color STN or TFT panels. Users can configure the data bus size for the LCD panel
to 1-bit, 2-bit, or 4-bit by programming the LCD panel bus size (PBSIZ) register.
4.5.5 Gray Palette Mapping
Through a proprietary frame-rate control (FRC) algorithm, the LCDC can generate up to 4
simultaneous gray levels out of 7 available by first mapping the 2-bit data into four 3-bit gray
codes which then select 4 out of 7 bit densities from the gray palette table.
Figure 4-5 shows the mapping of the 2-bit pixel data into 3-bit gray codes. Bits GMN are
defined in the software-programmable gray palette mapping registers (GPMR). Each of the
four 3-bit codes obtained from the first table then selects a
11/16, 3/4 and 1) from the gray palette table as shown in Table 4-3.
density level (0, 1/4, 5/16, 1/2,
Because crystal formulations and driving voltages vary, the visual gray effect may or may
not have a linear relationship to the frame rate. A logarithmic scale such as 0, 1/4, 1/2, and
1 might be more pleasing than a linear-spaced scale such as 0, 5/16, 11/16, and 1 for certain
graphics. A flexible mapping scheme lets users optimize the visual effect for the specific
panel or application.
Some panels may have a signal called PANEL_OFF that turns off the panel for low-power
mode. In the MC68328 processor system, this signal is not supported. Instead, use a parallel I/O pin to perform this function.
The software sequence to achieve PANEL_OFF using parallel I/O consists of 2 steps:
1. Turn off the VLCD (+15V or -15V) by I/O driving a transistor
2. Turn off the LCDON bit
To exit from LCDC-off mode:
1. Turn on the LCDON bit
2. Delay for 1-2ms
3. Turn on the VLCD by I/O driving a transistor
When setting the LCDON bit (register CKCON bit 7) to 1, LCDC itself will enter a low-power
mode by stopping its own pixel clock prior to the next line-buffer-fill DMA. Additional screen
DMA and display-refresh operations will then be stopped in this mode. When the LCDC is
switched back on, DMA and screen-refresh activities will resume in a synchronous fashion.
Software should check that the actual PANEL_OFF signal is de-asserted before setting
LCDON to a 1.
4-10
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 64
µs.
LCD Controller
4.6 DMA CONTROLLER OVERVIEW
The LCD DMA controller is a flyby type, 16-bit wide, fast-data transfer machine. Because
the LCD screen has to be refreshed continuously at a rate of about 50-70 Hz, in this case,
the pixel bits in the memory will be read and transferred to corresponding pixels on the
screen. To minimize the bus obstruction because of bus-sharing with the system, a burst
type and flyby transfer is therefore required. The refresh is divided into small packs of 8- or
16-word reads. Every time the internal line buffer needs data, it will assert the BR
signal to
request the bus from the MC68EC000. Once the MC68EC000 core grants the bus (i.e. BG
is asserted), the DMA controller will get control of the bus signal and issue 8- or 16-word
reads (see setting of CKCON register) from memory. The read data is then passed to the
next stage internally to generate the LCD timing (flyby). During the LCD access cycles, output- enable and chip-select signals for the corresponding system SRAM chip will be
asserted by the chip-select logic inside the SIM. The minimum bus bandwidth obstruct can
be achieved by using zero LCD-access wait states (1 clock per access). See Section 4-8
Bandwidth Calculation and Saving for more details.
4.6.1 Basic Operation
As shown in Figure 4-6 and Figure 4-7, data is fetched from memory in a very efficient manner. Each burst is limited to 8/16 words, which reduces possible latency for other peripherals
such as the interrupt controller. For example, the average time latency for LCDCLK = 5MHz
with 16-word burst is approximately 2.4
SYSCLK
BR
BG
ADDRESS
DATA
OE
CS
Figure 4-6. Three Clock per LCD DMA Transfer (2 Wait States)
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
4-11
Page 65
LCD Controller
SYSCLK
BR
BG
ADDRESS
DATA
OE
CS
Figure 4-7. One Clock per DMA Transfer (0 Wait State)
32-bit screen-starting address of the LCD panel (see Figure 4-8). The LCDC fetches pixel
data from system memory at this address.
4.7.1.2 VIRTUAL PAGE WIDTH REGISTER (VPW).
76543210
VP8VP7VP6VP5VP4VP3VP2VP1
Address: $(FF)FFFA05Reset Value: $FF
Figure 4-9. Virtual Page Width Register
VP8-VP0MVirtual Page Width Register
This register (see Figure 4-9) specifies the virtual page width of the LCD panel in terms of
byte count. VP0 defaults to zero because of the 16-bit transfers.
VPW = virtual page width in pixels divided by c where c is 16 for black-and-white display
and 8 for gray level.
4.7.2 Screen Format Registers
4.7.2.1 SCREEN WIDTH REGISTER (XMAX).
1514131211109876543210
UNUSEDXM9XM8XM7XM6XM5XM4XM3XM2XM1XM0
Address: $(FF)FFFA08Reset Value: $03FF
Figure 4-10. Screen Width Register XMAX
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
4-13
Page 67
LCD Controller
XM9-XM0
Pixels on a line are numbered 0 to XMAX for a screen width of XMAX +1 pixels. XMAX+1
must be a multiple of 16 (see Figure 4-10).
4.7.2.2 SCREEN HEIGHT REGISTER (YMAX).
1514131211109876543210
UNUSEDYM9YM8YM7YM6YM5YM4YM3YM2YM1YM0
Address: $(FF)FFFA0AReset Value: $01FF
Figure 4-11. Screen Height Register YMAX
YM8-YM0
This register (Figure 4-11) specifies the LCD panel height in term of pixels or lines. The
lines are numbered from 0 to YMAX for a total of YMAX + 1 lines, which is equal to the
screen height in pixel count.
Gray scale mode bit. This bit, if set, enables 4-gray level (2 bits per pixel) mode. Its default
value is 0, which selects binary pixel (no gray scale) operation.
1 = Gray scale enable
2 = No gray scale
4.7.4.2 POLARITY CONFIGURATION REGISTER (POLCF).
76543210
UNUSEDLCKPOL FLMPOL LPPOL PIXPOL
Address: $(FF)FFFA21Reset Value: $00
Figure 4-17. Polarity Configuration Register
LCKPOLLCD Shift Clock Polarity
This bit controls the polarity of the LCD shift-clock active edge.
0 = Active negative edge of LCLK
1 = Active positive edge of LCLK
ACD toggle-rate control code. The ACD signal will toggle once every 1 to 16 FLM cycles
based on the value specified in ACDRC register. The actual number of FLM cycles is the
value programmed plus one. Shorter cycles tend to give better results.
4.7.5 Line Buffer Control Registers
4.7.5.1 PIXEL CLOCK DIVIDER REGISTER (PXCD).
76543210
UNUSEDPCD5PCD4PCD3PCD2PCD1PCD0
Address: $(FF)FFFA25Reset Value: $00
Figure 4-19. Pixel Clock Divider Register
PCD5-PCD0Pixel Clock Divider
The PIX clock from the PLL is divided by N (PCD5-0 plus one) to yield the actual pixel
clock. Values of 1-63 will yield N=2 to 64. If set to 0 (N=1), the PIX clock will be used directly, bypassing the divider circuit. Input source is selected by PCDS in CKCON register.
4.7.5.2 CLOCKING CONTROL REGISTER (CKCON).
76543210
LCDON DMA16WS1WS0UNUSEDDWIDTH PCDS
Address: $(FF)FFFA27Reset Value: $00
Figure 4-20. Clocking Control Register
LCDCON
This bit controls the LCDC block.
0 = Disable LCDC
1 = Enable LCDC
NOTE
The internal LCDC logic will be switched off in step with the FLM
pulse.
DMA16
This bit controls the length of the DMA burst.
0 = 8 words burst length
1 = 16 words burst length
00 = Single clock-cycle transfer
01 = Two clock-cycle transfer
10 = Three clock-cycle transfer
11 = Four clock-cycle transfer
DWIDTH
Displays memory-data width indicating the size of the external bus interface.
0 = 16-bits memory
1 = 8-bits memory
PCDSPixel Clock Divider Source Select
0 = The SYS CLK output of PLL is selected
1 = The PIX CLK output of PLL is selected
4.7.5.3 LAST BUFFER ADDRESS REGISTER (LBAR).
76543210
UNUSEDLBAR7LBAR6LBAR5LBAR4LBAR3LBAR2LBAR1
Address: $(FF)FFFA29Reset Value: $3E
Figure 4-21. Last Buffer Address Register
LBA7-LBA1
The number of memory words required to fill one line on the display panel. The count is
typically equal to the screen width in pixels divided by 16 for black-and-white display, or
by 8 if in gray scale. For panning, add one more count for black-and-white and two for gray
display.
4.7.5.4 OCTET TERMINAL COUNT REGISTER(OTCR).
76543210
OTC8OTC7OCT6OCT5OTC4OTC3OTC2OTC1
Address: $(FF)FFFA2BReset Value: $3F
Figure 4-22. Octet Terminal Count Register
OTC8-OTC1
Controls the time interval between two lines; therefore, the frame refresh rate can also be
finely adjusted. The register value must be greater than LBAR by 4 for black-and-white
display and 8 for gray display.
BOS is used primarily in the non-gray scale mode and in conjunction with POS0-2. (BOS
must be set to zero for gray-scale data).
0 = Start from the first byte when retrieving binary pixel data for display
1 = Active display will start from the second byte instead
NOTE
The cursor reference position must be adjusted separately with
software when this register is changed.
POS2-POS0Pixel Offset Code
POS specifies which of the 8 pixels in the first or second (GS=0, BOS=1 only) octet retrieved from the line buffer is the first to be displayed on the screen. (e.g. 000 implies that
pixel 7, the first shifted out, will be the first to be displayed on every horizontal line in the
current frame).
4.7.6 Gray-Scale Control Registers
4.7.6.1 FRAME-RATE MODULATION CONTROL REGISTER (FRCM) .
76543210
XMOD3-XMOD0YMOD3-YMOD0
Address: $(FF)FFFA31Reset Value: $B9
Figure 4-24. Frame-Rate Modulation Control Register
XMOD, YMODFrame-Rate Modulation Control
These numbers modulate adjacent pixels at different time periods to avoid spatial flicker
or jitter when using FRC. These values must be optimized by manually fine tuning the target LCD panel. See Section 4.5.5 Gray Palette Mapping for details.
4.7.6.2 GRAY PALETTE MAPPING REGISTER (GPMR).
1514131211109876543210
0G12G11G100G02G01G000G32G31G300G22G21G20
Address: $(FF)FFFA32Reset Value: $0173
Figure 4-25. Gray Palette Mapping Register
GMN
Gray palette code (bit position n=0, 1, 2) output for pixel-input data m (0 for pixel data 00,
1=01, 2=10, 3=11). This 3-bit code will then select one of 7 bitstreams of different densities. See Section 4.5.5 Gray Palette Mapping for details.
Because LCD screen refresh is a periodic task, the load LCDC puts on the host data bus
becomes an important consideration to the high-performance handheld system designer.
4.8.1 Bus Overhead Considerations
The following example illustrates the issues involved in the estimation of bandwidth
overhead to the data bus.
Consider a typical case scenario:
Screen size: 320 x 240 pixels
Bits per pixel: 2 bits / pixel
Screen refresh rate: 60 Hz
System clock = 16.67 MHz
Host bus size: 16 bit
DMA access cycle: 2 cycles per 16-bit word
The period,
T
,, that LCDC must update one line of the screen is,
l
1
T
-------------
l
60Hz
--------------------
×=
240lines
1
69.4µs=
At the same period, the line buffer must be filled. The duration,
The real-time clock (RTC) module provides a current time stamp of seconds, minutes, and
hours. The RTC operates on the low-frequency, 32 kHz (or 38.4 kHz) reference clock crystal.
Timer features include:
• Full clock features - seconds, minutes, hours
• Minute countdown timer with interrupt
• Programmable alarm with interrupt
• Once-per-second, once-per-minute, and once-per-day interrupts
• 32.768 kHz or 38.4 kHz operation
5.1 OPERATING CHARACTERISTICS
Figure 5-1 is a block diagram of the RTC. This section describes the RTC operation.
5.1.1 Prescaler and Counter
The prescaler divides the 32.768 kHz reference clock down to 1 pulse per second. An alternate reference frequency of 38.4 kHz is also supported. The counter portion of this device
consists of 3 groups that are toggled by a 1 Hz clock. The seconds and minutes counters
are 6 bits long while the hours counter is 5 bits long.
The time counters offer seconds, minutes, and hours data in 24-hour format. The prescaler
stages are tapped to support several features. Periodic interrupts at 1 Hz and 1 minute are
available as well as an interrupt at the midnight rollover of the hours counter.
5.1.2 Alarm
Users can set an alarm by accessing the 3 alarm fields and loading the hours, minutes and
seconds for the time that the alarm is to generate an interrupt. The interrupt is enabled when
the alarm bit in the interrupt-enable register is set. The alarm is actually posted when the
current time matches the time in the alarm register.
5.1.3 Minute Stopwatch
The minute stopwatch performs a countdown with a resolution of one minute. It can generate an interrupt after some length of time. Example: The LCD is to turn off after 5 minutes of
inactivity. The minute stopwatch is programmed for 5 minutes and enabled. At consecutive
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
5-1
Page 75
Real-Time Clock
RTC_CLKO
RTC_IRQB
32.768 kHz
38.4 kHz
INTERRUPT
CONTROL
ADDRESS
DATA
BUS_CONTROL
PRESCALER
CLOCK
CONTROL
INTERRUPT
ENABLE
INTERRUPT
STATUS
EC000
BUS
DECODE
1 pps
SECOND
1 ppm
MINUTE
ALARM COMPARATOR
SECOND
LATCH
MINUTE STOPWATCH
MINUTE
LATCH
1 pph
HOUR
HOUR
LATCH
Figure 5-1. Real-Time Clock
minute increments, the minute stopwatch value is decremented. The interrupt is generated
when the counter counts to -1.
5.1.4 Registers
There are several registers (described below) associated with the RTC.
The hours, minutes and seconds can be read or written at any time. After a write, the current
time assumes the new values. Unused bits read 0.
HOURS
These 5 bits, when read, indicate the current hour and can be set to any value between 0
and 23.
5-2
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 76
Real-Time Clock
MINUTES
These 6 bits, when read, indicate the current minute and can be set to any value between
0 and 59.
SECONDS
These 6 bits, when read, indicate the current second and can be set to any value between
0 and 59.
5.1.4.2 ALARM REGISTER (RTCALRM).
31302928272625242322212019181716
UnusedHOURSUnusedMINUTES
1514131211109876543210
UnusedSECONDS
Address: $(FF)FFFB04Reset Value: $00000000
Figure 5-3. Alarm Register
The hours, minutes, and seconds can be read or written at any time. After a write, the current
time assumes the new values. Unused bits read 0.
HOURS
These 5 bits, when read, indicate the current setting of the alarm’s hour and can be set to
any value between 0 and 23.
MINUTES
These 6 bits, when read, indicate the current setting of the alarm’s minute and can be set
to any value between 0 and 59.
SECONDS
These 6 bits, when read, indicate the current setting of the alarm’s second and can be set
to any value between 0 and 59.
5.1.4.3 RTC CONTROL REGISTER (RTCCTL).
1514131211109876543210
UNUSED ENABLE
ADDRESS: $(FF)FFFB0CReset Value: $0000
UNUSED
38.4RESERVED
Figure 5-4. Control Register
ENABLE RTC Enable
This bit enables the RTC.
1 = Enable RTC
0 = Disable RTC
38.438.4 kHz Reference Select
1 = Reference frequency is 38.4 kHz
0 = Reference frequency is 32.768 kHz
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
5-3
Page 77
Real-Time Clock
UNUSED
These bits are not used and read 0.
5.1.4.4 INTERRUPT STATUS REGISTER (RTCISR).
This register indicates the status of the various real-time clock interrupts. Each bit is set
when its corresponding event occurs. Users must clear these bits by writing 1’s to clear the
interrupt. The interrupt registers can post interrupts while the system clock is idle (sleep
mode).
1514131211109876543210
UNUSED
ADDRESS: $(FF)FFFB0EReset Value: $0000
1 Hz
FLAG
DAY
FLAG
MIN
FLAG
RVSD
SW
FLAG
Figure 5-5. Interrupt Status Register
UNUSED
These unused bits read 0.
1 Hz FLAG
If enabled, this bit is set every second and an interrupt posted.
If enabled, an alarm flag is set on a “compare” match between the RTC and the alarm register value. (Note: the alarm will recur every 24 hours. If a single alarm is required, clear
the interrupt-enable in the interrupt-service routine.)
This bit enables the stopwatch interrupt. The stopwatch counts down and remains at decimal -1 until it is reprogrammed. Note: If this bit is enabled with -1 (decimal) in the stopwatch register, an interrupt will be posted on the next minute tick.
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
5-5
Page 79
Real-Time Clock
5.1.4.6 STOPWATCH REGISTER (STPWTCH).
1514131211109876543210
UNUSED STOPWATCH COUNT
ADDRESS: $(FF)FFFB12Reset Value: $0000
Figure 5-7. Stopwatch Register
UNUSED
These unused bits read 0.
STOPWATCH COUNT
This field contains the stopwatch countdown value. The highest allowable value is 62 minutes. The countdown will not be activated again until a nonzero value (less than 63 minutes) is written to the stopwatch-count register.
5-6
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 80
SECTION 6
TIMER
The MC68328 processor contains two identical general-purpose 16-bit timers with a programmable prescaler and a software watchdog timer. Figure 6-1 shows the block diagram
of the time module.
TIMER
CLOCK
CONTROL REGISTER
PRESCALAR REGISTER
EVENT REGISTER
COMPARE REGISTER
COUNTER REGISTER
CAPTURE REGISTER
PRESCALE
CLOCK GENERATOR
CAPTURE
DETECT
DID 16
Figure 6-1. Timer Block Diagram
The key features of the timers include:
• Maximum period of 524 seconds (at 32kHz)
• 240-ns resolution (at 16.67 MHz)
• Programmable sources for the clock input, including external clock
• Input capture capability with programmable trigger edge on input pins
SYSTEM CLOCK
32K HZ CLOCK
TIN
INTERRUPT
MPU BUS
TOUT
• Output compare with programmable mode for the output pins
• Cascading timers for constructing one 32-bit timer
• Free run and restart modes
The software watchdog timer has the following features:
• 16-bit counter and reference register
• Maximum period of 16.38 seconds
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
6-1
Page 81
Timer
WATCHDOG TIMER
COMPARE REGISTER
INTERRUPT
RESET
MPU BUS
32KHZ CLOCK
4KHZ
COMPARATOR
16-BIT COUNTER
CLOCK
PRESCALER
Figure 6-2. Watchdog Timer Block Diagram
• 0.25-ms resolution
• Time-out causes system RESET or issues a maskable interrupt
6.1 GENERAL PURPOSE TIMERS
The clock input to the prescaler may be selected from the main clock (divided by 1 or by 16),
from the corresponding timer input (TIN1 or TIN2) pin, or from the 32-kHZ clock. TIN is synchronized to the internal clock. The clock input source is determined by the CLK SOURCE
bits of the corresponding timer control register (TCR). The timer prescaler register is an 8bit wide read/write register.The prescaler is programmed to divide the clock input by values
from 1 to 256 (i.e. 0 to 255 in the register). The prescaler output serves as an input to the
16-bit counter.
Each timer may be configured to count until it reaches a reference. Then, it either starts a
new time count immediately or continues to run. The free run/restart (FRR) bit of the corresponding TCR selects each mode. Upon reaching the reference value, the corresponding
timer-status register (TSR) bit is set and an interrupt is issued if the interrupt-enable bit in
TCR is set.
Each timer may output a signal on the timer-output (TOUT1 or TOUT2) pin when it reaches
the reference value, as selected by the output mode (OM) bit of the corresponding control
register, TCR. This signal can be an active-low pulse for a system clock-wide, or a toggle of
the current output under program control. The output can also serve as an input to the other
timer, resulting in a 32-bit timer.
Each timer has a 16-bit timer-capture register that latches the value of the counter when a
defined transition (of TIN1 or TIN2) is sensed by the corresponding input-capture edge
detector. The type of transition triggering the capture is selected by the capture edge (CE)
bits in the corresponding TCR.
When a capture or reference event occurs, the corresponding TSR bit is set and a maskable
interrupt is issued. The timer is not activated after reset and must be programmed as users
require.
6-2
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 82
Timer
6.2 SOFTWARE WATCHDOG TIMER
The software watchdog timer protects against system failures by providing a means to
escape from unexpected input conditions, external events, or programming errors. The third
16-bit timer block serves as a software watchdog timer for providing protection.
Once started, software must clear the software watchdog timer on a regular basis so that it
never reaches its time-out value. Upon reaching the time-out value, it is assumed that a system failure has occurred, and the software-watchdog logic initiates a hardware reset of the
chip or a maskable interrupt to the CPU, depending on the force-interrupt (FI) control bit in
the watchdog control register (WCR).
The software watchdog timer uses the 32 kHz clock as the input to the prescaler. The prescaler circuitry divides the clock input by a fixed value of 8. The output of this prescaler circuitry is connected to the input of the 16-bit counter. The reference/compare register is a 16bit programmable register. The maximum value that can be programmed is 65535, i.e. FFFF
in hex.
The watchdog timer starts counting once it is activated by setting the enable bit in the control
/status register. The counter is locked after it starts running; it will be disabled and cleared
if and only if a software reset or external reset is asserted. Once the count reaches the reference value programmed in the reference register, either a maskable interrupt or a software reset will be issued to the system, depending on the FI bit in the control/status register.
The counter asserts an internal output to the system-reset logic for an input clock cycle, i.e.
the 32 kHZ clock if the FI bit is clear. Otherwise, the maskable interrupt is asserted to the
CPU. In the case of an interrupt, the counter will continue to count. Both the interrupt and
counter will be cleared by writing into the counter.
The reset source bits (RS1-0) in the SCR are updated with the cause of the reset identified
as the software watchdog. Users can also check the reset-status bit in the watchdog timer
control/status register to identify the reset source.
The value of the software watchdog timer can be read at any time.
6.3 SIGNAL DESCRIPTIONS
TIN
This pin is the input to the timer and can be used in capture mode to latch the contents of
the free-running counter. It can also serve as the source of the clock to the prescaler.
TOUT
This pin is the output of the timer and can be programmed to toggle or pulse whenever a
“compare” event occurs.
6.4 PROGRAMMER’S MODEL
Users may modify the general-purpose timer registers at any time.
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
6-3
Page 83
Timer
6.4.1 General Purpose Timer
This section describes the timer registers.
6.4.1.1 COUNTER REGISTER. The counter register is a 16-bit read-only register that can
be read at anytime without disturbing the current count.
1514131211109876543210
Timer 1 Address: $(FF)FFF608 or
Timer 2 Address: (FF)FFF614
Reset Value: $0000
Figure 6-3. Timer Counter Register
COUNT
This is the current count value.
6.4.1.2 TIMER CONTROL REGISTERS. These identical registers control the overall indi-
These bits control the operation of the capture function. The bits are encoded as:
00 = Disable interrupt on capture event
01 = Capture on rising edge and generate interrupt on capture
10 = Capture on falling edge and generate interrupt on capture
11 = Capture on rising or falling edges and generate interrupt on capture
OMOutput Mode
This bit controls the output mode of the timer after a reference-compare event.
0 = Active-low pulse for one SYSCLK period
1 = Toggle output
IRQENReference Event Interrupt-Enable
This bit controls the generation of an interrupt on a reference-compare event.
0 = Disable interrupt on reference event
1 = Enable interrupt on reference event
6-4
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 84
Timer
FRRFree Run/Restart
This bit controls the timer operation after a “reference” event occurs. In the free-run mode,
the timer continues running. In the restart mode, the counter is reset to $0000, then resumes counting.
0 = Restart mode
1 = Free-run mode
CLKSOURCE
These bits control the clock source to the timer. Stop-count freezes the timer without causing
the value in the counter to be reset to $0000.
000= Stop count (clock disabled)
001= System clock to timer
010= System clock divided by 16
011= TIN pin is the clock source
1xx = 32kHz clock
TENTimer Enable
This bit enables the timer module.
0 = Timer disabled
1 = Timer enabled
NOTE
When this bit transitions from 0 to 1, the counter is reset to
$0000. The other registers are not disturbed.
6.4.1.3 TIMER PRESCALER REGISTER. These identical registers control the overall indi-
This register is set to all 1’s at system reset. The “compare” value is not matched until the
counter increments to equal this value.
6.4.1.5 TIMER-CAPTURE REGISTER. Each capture register is a 16-bit register that
latches the counter value during a capture operation when an edge occurs on the TIN pin,
as programmed in the timer-control register. This register appears as a memory-mapped
read-only register to users and is cleared at system reset.
The status register indicates the timer status. When a “capture” event occurs, it is posted by
setting the CAPT bit. When a “compare” event occurs, the COMP bit is set. Users must clear
these bits to clear the interrupt (if enabled). These bits are cleared by writing $00 and will
clear only if they have been read while set, which ensures that an interrupt will not be missed
if it occurs between the status-read and the interrupt-clear.
The software watchdog timer module has a 3-bit prescaler that is not accessible to users: a
watchdog-compare register (WRR), a read-only 16-bit watchdog counter register (WCN),
and a 4-bit watchdog-control/status register (WCR).
6.4.2.1 WATCHDOG-COMPARE REGISTER. The 16-bit compare register contains the
“compare” value for the watchdog time-out. It appears as a memory-mapped read-write register to users.The reset value of the register is $FFFF.
1514131211109876543210
COMPARE VALUE
Address: $(FF)FFF61AReset Value: $FFFF
Figure 6-9. Watchdog-Compare Register
COMPARE VALUE
When the counter counts up to the value in this register, it generates a system reset . This
register resets to $FFFF. The programmed value in the register will not be affected if the
force-interrupt mode is set in the control register.
6.4.2.2 WATCHDOG COUNTER REGISTER. The watchdog counter register is a 16-bit up-
counter and appears as a memory-mapped register that may be read at any time.
1514131211109876543210
COUNT
Address: $(FF)FFF61CReset Value: $0000
Figure 6-10. Watchdog Counter Register
COUNT
This is the current count value.
A read cycle to the counter register causes the current value of the watchdog timer to be
read. Reading the watchdog timer does not affect the counting operation.
A write cycle to the counter register causes the counter and prescaler to be reset. A write
cycle should be executed on a regular basis so that the watchdog timer is never allowed to
reach the reference value during normal program operation.
6.4.2.3 WATCHDOG-CONTROL/STATUS REGISTER (WCR).
1514131211109876543210
UNUSEDW/DRST LOCKFIWDEN
Address: $(FF)FFF618Reset Value: $0000
Figure 6-11. Watchdog-Control/Status Register
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
6-7
Page 87
Timer
This register consists of 4 control or status bits. Upon reset, the watchdog timer is disabled.
All bits are cleared. The LOCK bit will set if and only if the watchdog timer is activated. Once
the bit is set, it will be cleared only by a software reset or external reset.
WDEN
This bit enables the watchdog timer. While this bit is low, the watchdog is disabled.
0 = Watchdog disabled
1 = Watchdog enabled
FI
This bit indicates that the interrupt should be generated instead of a software reset.
0 = Software reset mode, the watchdog interrupt is disabled
1 = Forced watchdog interrupt instead of software reset
LOCK
This bit is not user programmable. It is set when the watchdog timer is activated.
0 = Watchdog timer is not locked
1 = Watchdog timer is locked; disable writing to WDEN bit
W/DRST
This bit indicates software reset status.
0 = Not reset
1 = Set when software reset is activated.
This bit can be cleared only by writing a 0 to the bit in the control register.
6-8
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 88
SECTION 7
PARALLEL PORTS
7.1 I/O PORTS MODULE
The MC68328 processor provides 10 multipurpose, configurable parallel ports. This section
describes the operation of the ports and offers suggestions on how to best use them. Each
port is described and, where needed, individual pins are detailed.
7.1.1 Port Operation
There are three types of ports on the MC68328 processor. This section describes the functionality of each port.
7.1.1.1 BASIC PORT. Ports A, B, C, E, F, G, J and K are basic ports. Figure 7-1 illustrates
their operation.
Data to
module
Data from
module
MPU bus
Output Enable
from module
DATA
DIRECTION
SELECT
0
1
0
1
SEL
SEL
PAD BUFFER
PAD
Figure 7-1. Basic Port
Basic ports multiplex two functions onto one pin. One function is the I/O and the other is the
internal module connected to this pin. Figure 7-1 refers to signals to and from a module. For
example, for port K, bit 0, the “Data from module” signal is connected to the master SPI module TXD signal. Because this bit is output-only, the “Output Enable from module” signal is
always asserted (enabling the output) and the “Data to module” signal in Figure 7-1 is not
used. Another example is port K, bit 1, where this signal’s module function is the master SPI
RXD signal, which is input-only. In this case, the “Output Enable from module” input is
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
7-1
Page 89
Parallel Ports
negated and the “Data from module” signal is not used (0). The “Data to module” signal is
connected to the master SPI RXD input.
While the SELECT bit is clear (default), the module pin function is enabled. Port K, bit 0 is
the master SPI TXD signal. The master SPI module controls the direction of data flow
(always output). While the SELECT bit is set (if the DIRECTION bit is 1 [direction = output]),
data written to the DATA register is presented to the pin. If DIRECTION is 0 (input), data
present on the pin is sampled and presented to the CPU when a read cycle is executed.
While the DIRECTION is output, the actual pin level is presented during read accesses. This
may not be the same as the data that was written if the pin is overdriven. To prevent glitches
during a mode change from unselected to selected, the intended data should be written to
the DATA register before going to the selected mode.
A Programming Example for Port K:
Assume the slave SPI is to be enabled, the master SPI and the PCMCIA are not used.
The pins associated with the unused modules will serve as I/Os. Port K bits 2-0 will be
inputs and Port K bits 7-6 will be outputs.
Value in port K SELECT register:
$C7 bits 7-6 in I/O mode (1’s)
bits 5-3 in slave SPI mode (0’s)
bits 2-0 in I/O mode (1’s)
bits 7-6 are written with the value to be output on port K, bits 7-6
bits 5-3, when read contain the current value on the slave SPI pins
bits 2-0 contain current value on port K, bits 2-0
Bits that are in the module mode (SELECT = 0) can be read and written. While
bits are configured as outputs, data that is written can be read back. Bits configured
as inputs can be written but the current pin value is read back. In either case, writing to bits has no effect on the pins.
7.1.1.2 PULLUP PORT. Port M is a pullup port that operates like a basic port, but adds a
switchable pullup resistor to the pin. Figure 7.2 illustrates its operation. Users enable the pullup resistor by writing bits in the PULLUP register to 1. The pullup resistors can be individually selected and operate whether the I/O port is selected or deselected. Refer to the section
describing port M for more details.
7.1.1.3 INTERRUPT PORT. Port D is an interrupt port that has all of the basic and pullup-
port capabilities with the addition of interrupt capabilities. Figure 7-3 illustrates the operation
of the interrupt port. Port D does not have module signals associated with its signals; it is
intended as a general-purpose, interrupt-generating port or a keyboard-input port.
7-2
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 90
Parallel Ports
PULLUP
Data to
module
MPU Bus
IRQ OR
Data from
module
MPU bus
Output Enable
from module
Figure 7-2. Pullup Port
PULLUP
IRQ EDGE
POLARITY
DATA
DIRECTION
SELECT
SEL
0
1
SEL
0
1
SEL
0
1
PAD BUFFER
PAD
EDGE
DETECT
IRQ EN
Bit IRQ
DATA
DIRECTION
PAD BUFFER
PAD
Figure 7-3. Interrupt Port
The interrupt port generates 9 interrupt signals. The individual port bits generate 8 of the
interrupts. One interrupt is the logical-OR of all 8 bits. The individual interrupt bits can be
masked on a bit-by-bit basis. The OR interrupt must be enabled or disabled in the interrupt
module. Refer to the interrupt controller block (Section 2.3) for more information. Individual
interrupts can be configured as edge- or level-sensitive, and the polarity can be selected.
7.1.2 Port A
Port A is multiplexed with address lines A16-A23. Unused address pins can serve as parallel
I/Os on a bit-by-bit basis. After reset, these signals default to their address function. Three
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
7-3
Page 91
Parallel Ports
bits are associated with each port pin: data, direction, and select. Bit “n” of each register byte
controls its associated pin function. The programmer’s model for port A is:
These bits control the pin directions. While high, the pins are outputs; while low, the pins
are inputs. These bits reset to 0 and have no function while the SELECT bits are low.
DATA- D[7:0]
These bits control or report the data on the pins while the associated SELECT bits are
high. While the DIRECTION bits are high (output), D[7:0] controls the data to the pins.
While the DIRECTION bits are low (input), D[7:0] reports the signal level on the pins. The
data bits may be written at any time. Bits that are configured as inputs will accept the data,
but the written data will not be accessible until their respective pins are configured as outputs. The actual value on the pin is reported when these bits are read regardless of whether they are configured as input or output. These bits reset to 0 while the SELECT bits are
low.
SELECT- SEL[7:0]
These bits select whether address [23:16] or I/O port signals are connected to the pins.
While high, the port I/O functions are connected to the pin. While low, the address function
is connected.
7.1.3 Port B
Port B is multiplexed with data lines D7-D0. In an 8-bit-only system, these pins can be configured as a parallel port. However, the boot-up sequence must configure port B as I/O. This
port is not affected by the BUSW pin. On reset, the data lines are connected to the pins. The
programmer’s model for Port B is:
These bits control the pin directions. While high, the pins are outputs; while low, the pins
are inputs. These bits reset to 0 and have no function while the SELECT bits are low.
DATA- D[7:0]
These bits control or report the data on the pins while the associated SELECT bits are high.
While the DIRECTION bits are high (output), D[7:0] controls the data to the pins. While the
DIRECTION bits are low (input), D[7:0] reports the signal level on the pins. The data bits
may be written at any time. Bits that are configured as inputs will accept the data, but the
written data will not be accessible until their respective pins are configured as outputs. The
actual value on the pin is reported when these bits are read regardless of whether they are
configured as input or output. These bits reset to 0 while the SELECT bits are low.
SELECT- SEL[7:0]
These bits select whether CPU data-bus low byte or I/O port signals are connected to the
pins. While high, the port I/O function is connected to the pin. While low, the D7-D0 functions are connected.
7.1.4 Port C
Port C is multiplexed with various 68000 bus-control signals that are identified below.
All 8 bits are implemented in the registers, but only 6 bits connect to the outside. As with other
ports, each bit can be individually configured. Bit 0 can be used only when the on-chip PLL
is selected because the MOCLK function is needed to disable the PLL. The on-chip PLL will
be selected when this bit serves as a port I/O. The programmer’s model for port C follows.
These bits control the pin directions. While high, the pins are outputs; while low, the pins
are inputs. These bits reset to 0 and have no function while the SELECT bits are low. Note
that bits 2,3, and 7, while implemented, do not control any I/O port pins.
DATA- D[7:0]
These bits control or report the data on the pins while the associated SELECT bits are
high. While the DIRECTION bits are high, the DATA register bits control the pins. While
the DIRECTION bits are low, “other functions” report the signal driving the pins. These bits
reset to 0. The data bits may be written at any time. Bits that are configured as inputs will
accept the written data, but it will not be accessible until the respective pins are configured
as outputs. The actual value on the pin is reported when these bits are read.
SELECT- SEL[7:0]
These bits select whether address or port signals are connected to the pins. While high,
the port I/O function is connected to the pin; while low, the address pins are connected.
7.1.5 Port D
Port D has features intended for use as a keyboard input port; however, it can be used as a
general-purpose port. Multiple keyboard support functions are provided. As with the other
ports, each pin can be configured as an input or output on a bit-by-bit basis. While configured as inputs, each pin can generate a CPU interrupt. Additionally, a group interrupt can
be generated. This interrupt is the OR (negative logic) of all pins on the port. Generated
interrupts can be sensitive to either level or edges as selected by users. Additionally, the
polarity can be selected. Each pin is also equipped with a switchable pullup resistor. The
programmer’s model for port D is shown below.
These bits control the pin directions. While high, the pins are outputs; while low, the pins
are inputs. Because there are no SELECT bits associated with this port, the I/O function
is always enabled.
DATA- D[7:0]
These bits control or report the data on the pins. While the DIRECTION bits are high, DATA[7:0] controls the data to the pins. While the DIRECTION bits are low, DATA[7:0] reports the signal driving the pins. These bits reset to 0 while the DIRECTION bits are low.
The data bits may be written at any time. Bits that are configured as inputs will accept the
written data, but the data will not be accessible until the respective pins are configured as
outputs. Note that the actual value on the pin is reported when these bits are read. Bits
that are configured as edge-sensitive interrupts will read 1 when an edge is detected. The
interrupt is cleared by writing 1to the set bits.
PULLUP- PU[7:0]
These bits enable the pullup resistors on the port. While high, the pullup resistors are enabled. While low, the pullup resistors are disabled. The pullups are enabled on reset.
POLARITY- POL[7:0]
These bits select the input signal polarity. While high, the input data is inverted before being presented to the holding register; while low, the data is unchanged. Interrupts are active-high (or rising edge) while these bits are low. Interrupts are active-low (or falling edge)
while these bits are high.
INT ENABLE- IQEN[7:0]
These bits allow the interrupts to be presented to the interrupt controller block.
EDGE ENABLE- IQEG[7:0]
These bits, while high, enable edge interrupts. While low, level-sensitive interrupts are selected. The polarity of the edge (rising or falling) is selected by the POLARITY bits.
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
7-7
Page 95
Parallel Ports
7.1.6 Port E
Port E is multiplexed with 7 chip-select signals that are identified below.
All 8 bits are implemented in the registers, but only bits 7-1 connect to the outside. As with
other ports, each bit can be individually configured, as needed. The programmer’s model for
port E is shown below.
These bits control the pin directions. While high, the pins are outputs; while low, the pins
are inputs. These bits reset to 0 and have no function while the SELECT bits are low.
DATA- D[7:0]
These bits control or report the data on the pins while the associated SELECT bits are
high. While the DIRECTION bits are high (output), D[7:0] controls the data to the pins.
While the DIRECTION bits are low (input), D[7:0] reports the signal level on the pins. The
data bits may be written at any time. Bits that are configured as inputs will accept the data
but the written data will not be accessible until their respective pins are configured as out-
7-8
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
MOTOROLA
Page 96
Parallel Ports
puts. Note that the actual value on the pin is reported when these bits are read regardless
of whether they are configured as input or output. These bits reset to 0.
PULLUP - PU[7:0]
These bits enable the pullup resistors on the port. While high, the pullup resistors are enabled; while low, they are disabled. Port E, bit 7 pullup resistor is enabled after reset.
SELECT- SEL[7:0]
These bits select whether CSA1B-CSB3B or I/O port signals are connected to the pins.
While high, the port I/O functions are connected to the pin; while low, the chip-select function is connected.
7.1.7 Port F
Port F is multiplexed with address lines A23-A31. Unused address pins can serve as parallel
I/Os on a bit-by-bit basis. The programmer’s model for port F is shown below.
These bits control the pin directions. While high, the pins are outputs; while low, the pins
are inputs. These bits reset to 0 and have no function while the select bits are low.
DATA- D[7:0]
These bits control or report the data on the pins while the associated SELECT bits are
high. While the DIRECTION bits are high, D[7:0] controls the data to the pins. While the
DIRECTION bits are low, D[7:0] reports the signal driving the pins. These bits reset to 0
while the SELECT bits are low. The data bits may be written at any time. Bits that are configured as inputs will accept the written data but it will not be accessible until the respective
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
7-9
Page 97
Parallel Ports
pins are configured as outputs. The actual value on the pin is reported when these bits
are read.
PULLUP - PU[7:0]
These bits enable the pullup resistors on the port. While high, the pullup resistors are
enabled; while low, they are disabled. The pullup resistors are enabled after reset.
SELECT- SEL[7:0]
These bits select whether address or port signals are connected to the pins. While high,
the port I/O function is connected to the pin. While low, the address pins are connected.The I/O function is selected following reset.
7.1.8 Port G
Port G is multiplexed with timer and serial communication signals. The signals are identified
below. Refer to the timer, PWM, RTC, and UART sections for descriptions of signal functions. All 8 bits are implemented in the registers and each is connected to the outside. As
with other ports, each bit can be individually configured, as needed. The programmer’s
model for port G is shown below.
These bits control the direction of the pins. While high, the pins are outputs. While low,
the pins are inputs. These bits reset to 0 and have no function while the SELECT bits are
low.
DATA- D[7:0]
These bits control or report the data on the pins while the associated SELECT bits are
high. While the DIRECTION bits are high, the DATA bits control the pins. While the DIRECTION bits are low, the actual levels on the pins are reported. These bits reset to 0
while the SELECT bits are low. The data bits may be written at any time. Bits that are configured as inputs will accept the written data but it will not be accessible until the respective
pins are configured as outputs. Note that the actual value on the pin is reported when
these bits are read.
Note
While PC0MOCLK is high, the RTCOUT bit is disabled and becomes an input for the 32 KHz real-time clock reference.
PULLUP - PU[7:0]
These bits enable the pullup resistors on the port. While high, the pullup resistors are enabled; while low, they are disabled. Port E, bit 7 pullup resistor is enabled after reset.
SELECT- SEL[7:0]
These bits select whether the various functions or port I/O signals are connected to the
pins. While high, the port I/O function is connected to the pin. While low, the various functions are connected.
7.1.9 Port J
Port J is multiplexed with 8 chip-select signals identified below.
All 8 bits are implemented in the registers and all 8 are connected to the outside. As with
other ports, each bit can be individually configured, as needed. The programmer’s model for
port J is shown below.
These bits control the pin directions. While high, the pins are outputs; while low, the pins
are inputs. These bits reset to 0 and have no function while the SELECT bits are low.
DATA- D[7:0]
These bits control or report the data on the pins while the associated SELECT bits are
high. While the DIRECTION bits are high, the DATA bits control the pins. While the DIRECTION bits are low, the value on the pins is reported. These bits reset to 0 while the
SELECT bits are low. The data bits may be written at any time. Bits that are configured
as inputs will accept the written data but it will not be accessible until the respective pins
are configured as outputs. The actual value on the pin is reported when these bits are
read.
SELECT- SEL[7:0]
These bits select whether chip-select or port I/O signals are connected to the pins. While
high, the port I/O function is connected to the pin; while low, the chip-select functions are
connected.
7.1.10 Port K
Port K is multiplexed with signals related to the serial peripheral interfaces and PCMCIA.
The signals are identified below.
All 8 bits are implemented in the registers, and each is connected to the outside. As with
other ports, each bit can be individually configured, as needed. The programmer’s model for
port G is:
These bits control the pin directions. While high, the pins are outputs; while low, the pins
are inputs. These bits reset to 0 and have no function while the SELECT bits are low.
DATA- D[7:0]
These bits control or report the data on the pins while the associated SELECT bits are
high. While the DIRECTION bits are high, the DATA bits control the pins. While the DIRECTION bits are low, the levels on the pins are reported. These bits reset to 0 while the
SELECT bits are low. The data bits may be written at any time. Bits that are configured
as inputs will accept the written data but it will not be accessible until the respective pins
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
7-13
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.