Professional Documents
Culture Documents
D(7-0) 8
8
Port A PA (7-0)
5
RS(5-1)
__ H1
H2
68230 R/W Control
and
8 Handshake
H3
H4
CS* Status
CLK 8
Port B PB (7-0)
Reset*
Parallel Interface / Timer
PC7 / TIACK*
68230 PI/T Timer
Prescaler
Port C 8 PC6 / PIACK*
PC5 / PIRQ*
PC4 / DMAREQ*
PC3 / Tout
PC2 / Tin
PC1
PC0
Data Data
H2 and H4 means PI/T to CPU IN IN
is ready to receive another Latched
( or Buffer) Double BUFFER PORT Double
byte. in PIT
Buffered Buffered
Input: Non-latched
or double-buffered
Timer Functions
Timer Enable bit. (TCR0)
68000 8
Data CNTRH PIT+$2E
8 24
Bus CNTRM
8 Counter Register
CNTRL
PIT+$32
0 load
•• Counter
Counter register
register CNTR:
CNTR: 3,
3, 8-bit
8-bit registers
registers Set function
of port C lines from CPR Still
Set source Bit
CNTRH, CNTRM,
CNTRH, CNTRM, CNTRL
CNTRL including interrupt 1 roll over none
of timer clock 0 Disable
Scaled by 32 1 Enable
–– Found
Foundat at addresses
addresses (PIT
(PIT +$2E,
+$2E, $30,
$30, $32)
$32) usage (PC3/Tout) on zero ;-)
or not
detect
–– Address
Address PITPIT++ $2C
$2C has
has no
noreal
realregister
registerbut
butused
used
as fake address for CNTR to complete
as fake address for CNTR to complete a longa long
word.
word.
Tout/TIACK* ZD Timer
Control Control None Clock Control
Enable Using Interrupts for I/O and Timer
Systems
Mode 1 = Real-time clock Mode 4 = Elapsed time measurement
Mode 2 = Square wave generator Mode 5 = Pulse counter
Mode 3 = Interrupt after timeout Mode 6 = Period measurement
MAIN
MAIN MOVEA.L
MOVEA.L #$07FFE,A7
#$07FFE,A7 Initialize
Initialize SPSP
LEA
LEA H1_ISR,A0
H1_ISR,A0 Load
Load A0
A0 with
with address
address of
of PIT
PIT Routine
Routine
MOVE.L
MOVE.L A0,H1_V_A
A0,H1_V_A Put
Put ISR
ISR address
address in
in vector
vector table
table
MOVE.B
MOVE.B #H1_VEC,PIVR
#H1_VEC,PIVR Initialize
Initialize PIVR
PIVR with
with interrupt
interrupt vector
vector
1 0 1 0 0 0 0 1
MOVE.B
MOVE.B #PGCRM,PGCR
#PGCRM,PGCR Initialize
Initialize PGCR
PGCR
MOVE.B #PACRM,PACR After ZD,
MOVE.B #PACRM,PACR Initialize
Initialize port
port AA PC3/Tout used as timer PC2/Tin
MOVE.B #$00, counter
MOVE.B #$00, PADDR
PADDR Set
Set Port
Port AA as
as input
input interrupt request line not used
MOVE.B #%00011000,PSRR restarts Enable
MOVE.B #%00011000,PSRR Enable
Enable vectored
vectored interrupts
interrupts inin PSRR
PSRR PC7/TIACK* used counter clock
LEA
LEA BUFFER,A1
BUFFER,A1 Load
Load DATA
DATA address
address in in A1
A1 from initial timer
to acknowledge timer CLK/32
ANDI
ANDI #$0F0FF,SR
#$0F0FF,SR Enable
Enable interrupts
interrupts in in SR
SR preloaded
LOOP NOP Fake interrupts
LOOP NOP Fake loop
loop just
just for
for example
example value
BRA
BRA LOOP
LOOP main
main program doing other tasks
program doing other tasks here
here
68000 Lecture notes week 7 29 68000 Lecture notes week 7 31
Reset Sequence
Minimal Configuration Using 68K
Set SR S ß 1
Set ST T ß 0
• Used in stand-alone mode Set SR mask ß 111
• Memory expandable
• No interrupts and multiple processors Transfer longword
to PC
Begin processing in
the supervisor state
– SR = $2700
Power on
BR* HALT*
– SSP is loaded with longword at $00 0000 BG* RESET*
Reset
Circuit
BGACK*
– PC is loaded with the longword at $00 0004
IPL2*
IPL1* Clock
CLK*
IPL0* Generator
Vcc
RS232C
Peripheral CS PIA* ACIA
VPA* Address
CS ACIA* PIA E CS*
VMA* Decoder
E CS* Baud
rate
BERR* E CSACIA*
Vcc generator
CSPIA*
14
DTACK, VPA
A23-A10
CS
RTSA RS2-RS0
DTACK A3-A1
properties TxDB
D7-D0
8
8
D7-D0
6840
PTM
RxDB
CTSB CS E
Serial RTSB R/W
Channel 2
B IRQ
Address Bus
Data Bus
MC68000 CPU
(System)
16
D15-D0 ROM
E, R/W 13
A13-A1 8K x 16
UDS, LDS
DTACK
VMA, AS
CS
DTACK, VPA
A23-A16
16 Addr.
IPL2-0
D15-D0
A23-A1
FC2-0
FC2-0, AS,
VMA
LDS, UDS,
decode
CS
Multiprocessing
16 CPU
D15-D0
13 (System)
3 A13-A1
3
RAM
R/W
8K x 16
An Operating System Kernel
LS148 IRQ EN
3x8 3
Priority Enc.
Decode A3-A1
I1 I4 I7 Y7 Y4 Y1
16
13 D15-D0 (User)
A13-A1 RAM
R/W
8K x 16
Jumpers Jumpers
CS