Você está na página 1de 5

Laboratory 6

Objectives

: Programming the input/Outputs ports


:

Describe the principles of 68000 input and output programming


Write programs to configure the 68230 pi/t port as inputs,
outputs or a mixture of both
Write programs which inputs and output data
Describe the operation of the Application Module (DAC)

Equipments :

Personal computer running windows 95 or later, and fitted with


RS232
Serial communications port
Merlin Development System software pack including 68000
Cross Assembler Reference Manual and RS232 cable
TIM 68000 microprocessor board
DT60 Power Supply

Theory

:
Memory Mapped
Port
Port
Port
Port
Port
Port
Port

Activity 1
Procedures

PI/T Register
General Control Register (pgcr)
A Data Direction Register (paddr)
B Data Direction Register (pbddr)
A Control Register (pacr)
B Control Register (pbcr)
A Data Register (padr)
B Data Register (pbdr)

TIM Address
400001H
400005H
400007H
40000DH
40000FH
400011H
400013H

: Write a program which will output the valueC3H from Port A


:

1.1 Application connected between Module to the TIM circuit board and the
Power Supply
1.2 Prgoram line was analyzed
1.3 Program was transfered to TIM
1.4 Observation was recorded
1.5 Instruction Change move.b #$C3, padr to move.b #$AA, padr.

Flowchart

Program A

Start
Set ports A to
general mode 0,
submode 1X

Configure Port A
as an output
port
Output the
value C3 H from
Port A

End

Pgcr
Pacr
Paddr
Padr

equ
equ
equ
equ

$400001
Declare the
$40000Daddress as
$400005
$400011 Pgcr,pacr,paddr,
padr

Org $1000
Move.b #00,pgcr
general mode

;set Port as

Move.b #$80,pacr
submode 1x
Move.b #$FF,paddr
A to O/P
Move.b #$C3,padr
output C3H

;set Port A to
;set all of port
;set Port A to

Explaination : Port A is a LED , when then paddr is $FF , thats mean the LED will
turn ON

Result

:
Flowchart
Start
Set ports to
mode 0,
submode 1X
Configure Port
A as an output
port
Configurate
PB0 as output

Output a 0 on
PB0 to enable
DAC

Set count to
zero

Output the
current count at
port A

Wait for about


0.5 second

Increment the
acumulater

Program A
Pgcr equ $400001
Pacr equ $C
Pbcr equ $E
Paddr equ $4
Pbddr equ $6
Padr equ $10
Pbdr equ $12

Address declare
as
pgcr,pacr,pbcr,pa
ddr,pbddr,padr,p
bdr

Org $1000
Movea.l #pgcr,a0

;address

register 0 points

Move.b #00,(a0)
mode 1
Move.b #$80,pacr(a0)

;pgcr set
;set port A as

submode 1x

Move.b #$80,pbcr(a0)

; set port B as

submode 1x

Move.b #$FF,paddr(a0)
A as O/p
Move.b #1,paddr(a0)
bit0 to O/p
Move.b #00,padr(a0)
00H initially

;set all port


;set port B,
;outputs
at Port A

Move.b #00,pbdr(a0)
on port B,

;outputs 0
Bit 0 to

enable DAC
again move.l #$45c12,d0
delay subq.l #1,d0
bne
delay
addq.b #1,padr(a0)
bra

again

Explanation : At value 80H , the motor start to rotate . Value of Voltage at the
80H is 1.0 V

Activity 2 : write a program which will produce a slowly increasing binary count
output (changing
about every 0.5 seconds) at port A which is passed, via
the DAC to either the optical
sender od the DC motor
Procedure :
2.1 - Step 1.1 Followed
2.2 - Program A was analysed
2.3 - Object was transfere and executed
2.4 - observation was recored

Discussion : At activity 1, we can determine the input or output of Port depend on


the Hexa Value
insert by programmer. When the number is FF, all the
port are setted to Output Port.
But if the number 00, all the port are setted
to Input Port
: At activity 2, when the value of hexa number is small , then the value
of voltage will 0
too, the motor do not rotate at 0.5V because there are
resisence on the motor, so its
dont have enough current to rotate the
motor. At the 1.0V , the motor can rotate.

Conclussion : As a conclusion , we know how to describe the principle of 68000


input and output
programming. Beside that, we learn how to configure
the 68230 PI/T ports as inputs,
outputs or a mixture both. Last but not
least, we know how to describe the operation
of DAC.

Você também pode gostar