Lab Ash
Lab Ash
Lab Ash
Objectives
Equipments :
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
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
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
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