Introduction to Microprocessors 6809
Introduction to Microprocessors 6809
Computer science
Industrial
2
Introduction to the microprocessor
Von Neumann Architecture
03/06/2021 5
Introduction to the microprocessor
Basic elements of a microprocessor system:
The microprocessor:
Often called Central Processing Unit "CPU" which takes care of the
elementary arithmetic/logical calculations and tests.
The memory unit:
Including both RAM "RAM" and
dead memory "ROM, EPROM, ..."
This section receives the program and the data, the latter being
modified as the process unfolds.
This section also serves to memorize values
intermediate values and final values of the calculations carried out during
the execution of the program.
03/06/2021 6
Introduction to the microprocessor
Basic elements of a microprocessor system:
Input/Output interfacing:
consists of two modules: input module and output module.
The input module: contains all the devices used for sampling.
The output module: brings together all the elements that we have planned.
to transfer data and information from the computer to the
the control unit to send stored data in memory or
03/06/2021 7
Introduction to the microprocessor
Elements of a microprocessor-based system:
the buses
A data bus:
Allowing the transfer of information over a bundle of several
parallel conductors. The number of wires is one of the characteristics
essentials of the UC. In principle, the width of the data bus is equal to the
size of words manipulated by the microprocessor (8 bits, 16 bits, ...).
The bus is one-way for the following three connections:
Dead Memory Microprocessor
Microprocessor Output Unit,
Entry Unit Microprocessor
The bus is bidirectional for communication with the microprocessor
with the RAM.
03/06/2021 8
Introduction to the microprocessor
Basic elements of a microprocessor system:
the buses
A bus of addresses:
a set of unidirectional parallel ducts allowing to
point all the memory addresses addressable by the computer
digital. The number of lines of this bus determines the size
maximum of memory.
03/06/2021 9
Introduction to the microprocessor
Basic elements of a microprocessor system:
the buses
A command and control bus:
Behavioral:
Lines that allow the CPU to specify to the RAM or to
input and output ports if she wants to make a write or a
lecture.
Lines used by the CPU to respond to the peripherals, by
acceptance of a request for interruption or access
direct memory, ...
03/06/2021 10
Introduction to the microprocessor
Basic elements of a microprocessor system:
03/06/2021 11
Introduction to the microprocessor
Definition and evolution of microprocessors:
Definition:
A µP is generally a programmable integrated chip.
03/06/2021 12
Introduction to the microprocessor
Definition and evolution of microprocessors:
Evolution:
03/06/2021 13
Introduction to the microprocessor
Components of a microprocessor:
The three elements
An arithmetic and logic unit (ALU).
A control unit (CU).
The registers.
03/06/2021 14
Introduction to the microprocessor
Components of a microprocessor:
The UAL:
It allows you to perform arithmetic operations (+, -, *, /) and
logics (OR, AND, XOR).
03/06/2021 15
Introduction to the microprocessor
Components of a microprocessor:
The control unit
It allows to 'sequence' the execution of instructions.
She performs the retrieval in memory of the instruction,
decoding, execution and preparation of the instruction
next. The control unit generates all the signals of
internal or external synchronization (command bus) to
microprocessor.
03/06/2021 16
Introduction to the microprocessor
Components of a microprocessor:
The registers:
03/06/2021 17
Introduction to the microprocessor
Components of a microprocessor:
The registers:
the accumulators:
03/06/2021 18
Introduction to the microprocessor
Components of a microprocessor:
The registers:
03/06/2021 19
Introduction to the microprocessor
Components of a microprocessor:
The registers:
State registry:
03/06/2021 20
Introduction to the microprocessor
Components of a microprocessor:
The registers:
03/06/2021 21
Introduction to the microprocessor
Components of a microprocessor:
The registers:
The program counter (PC pointer):
It contains the address of the instruction to be searched in memory. The unit of
Example:
(PC)=10000H ; it points to the memory that contains the instruction MOV C,B which is
coded on two bytes (89 D9H); the control unit will increment by two
the content of the PC: (PC) =10002H (memory will be assumed to be organized
in bytes).
03/06/2021 22
Introduction to the microprocessor
Components of a microprocessor:
The registers:
The stack pointer (SP):
and subprograms.
The stack is managed in LIFO: (Last IN First Out) last entered
first released. The operation is identical to a battery
of the plate.
The stack pointer SP points to the top of the stack, it is
decremented before each stacking, and incremented afterwards
each unstacking.
There are two instructions for pushing and popping: PUSH and
POP.
03/06/2021 23
Introduction to the microprocessor
Components of a microprocessor:
The registers:
The stack pointer (SP):
example:
PUSH A will push the register A and POP A will pop it.
03/06/2021 24
The 6809 microprocessor
03/06/2021 25
The 6809 microprocessor
Introduction to the 6809 processor:
Motorola's 6809 microprocessor is an 8-bit microprocessor and the
Great successor of the 6800 whose internal organization is oriented 16 bits.
It has 59 instructions (more than 1460 instructions with all the
It includes:
An 8-bit Data bus;
03/06/2021 26
The 6809 microprocessor
Presentation of the 6809 processor:
There are two versions of this processor, the 6809 and the 6809E. Their pinout
differs as well as their signals but their instruction set is identical.
The Le6809 has an internal clock.
The Le6809E requires an external clock.
The 6809 has 9 addressing modes:
Inherent addressing
Immediate addressing
The direct addressing
Extended addressing
Extended indirect addressing
The short relative address
Long relative addressing
Indexed addressing
Indirect indexed addressing
03/06/2021 27
The 6809 microprocessor
Organization of the 6809 processor
03/06/2021 28
The 6809 microprocessor
External organization of the 6809 processor:
The corresponding circuit has 40 pins in the form of a casing.
DIL (Dual Inline Package)
03/06/2021 29
The 6809 microprocessor
Organization of the 6809 processor:
two versions: 6809 and 6809E.
The 6809 is timed by an internal clock (f=1 MHz, 1.5 MHz and
03/06/2021 30
The 6809 microprocessor
Control bus:
Read/Write line (R/W):
03/06/2021 31
The 6809 microprocessor
Control bus:
Bus status lines: BA (Bus Available) - BS (Bus State)
1st case: The microprocessor is operating normally, it manages the
address and data bus.
03/06/2021 32
The 6809 microprocessor
Control bus:
Line Halt: (Microprocessor Stop)
Input line for the µP, when it is at a high level, the
6809 works normally. But if by an electric signal,
we set it to '0' and as long as we keep it there, we stop the
operation of the microprocessor. The latter completes
the current instruction then sets: BA (BusAvailable) and
BS (Bus Status) set to 1.
03/06/2021 33
The 6809 microprocessor
Control bus:
RESET line: (complete initialization of the microprocessor)
03/06/2021 34
The 6809 microprocessor
Control bus:
Interrupt lines: (NMI, IRQ, FIRQ)
NMI: (Non Maskable Interrupt)
03/06/2021 35
The 6809 microprocessor
Control bus:
Interrupt lines: (NMI, IRQ, FIRQ)
IRQ: (Interrupt ReQuest)
It is a line to enter requests for maskable interruptions,
active in the low state. It works like on the 6802. It has its
vector in $FFF8-$FFF9.
03/06/2021 36
The 6809 microprocessor
Control bus:
ClockXtal and EXtal input lines:
These are two input connections for the internal oscillator to an external quartz of 4, 6 or
The EXTAL pin can be used as a TTL level input for a clock.
external by grounding XTAL.
Clock output lines E and Q:
E: It is a clock output for bus timing (synchronization with the
Q: It is a clock output in quadrature with 'E'. The addresses on the bus will be
03/06/2021 37
The 6809 microprocessor
Internal architecture:
The 6809 microprocessor is composed of nine internal registers:
Accumulators A and B: are two registers of size 8 bits.
the concatenation of registers A and B gives birth to
Accumulator D. The accumulator A representing the high bits and B
low weights.
The DP (Direct Page) register is an 8-bit register. It forms the
03/06/2021 38
The 6809 microprocessor
Internal architecture:
03/06/2021 39
The 6809 microprocessor
Internal architecture:
03/06/2021 40
The 6809 microprocessor
Internal architecture:
The program counter (Program Counter - PC) is a
16-bit register. It can point to all memory locations. It
contains the address of the next instruction to be executed.
The stack pointers U and S: These are two 16-bit registers that
both operate identically. They function in 'LIFO' mode.
These two registers can occasionally serve as an index register.
with all the possibilities of X and Y. The register S (System) is
used by the 6809 for all backup operations in case
03/06/2021
The 6809 microprocessor
Internal architecture:
The State Register (ConditionRegister Code - CCR):
This register defines the state of the µP at all times resulting from a
03/06/2021 42
The 6809 microprocessor
Internal architecture:
The state register (ConditionRegister Code - CCR):
Carry: This bit takes the value 1 each time the
Example 2:
SUBA #$22
03/06/2021 43
The 6809 microprocessor
Internal architecture:
The state register (ConditionRegister Code - CCR):
"V" Overflow: It's an overflow bit. It's set to 1 if
the result (in 2's complement) of an arithmetic operation
overflows, that is to say exceeds the byte. Otherwise, it remains at 0.
Example 1:
LDA #$12 loading the accumulator A with the value $12
Example 2:
ADD #$A0 adds the content of register A and the value
$A0
03/06/2021 44
The 6809 microprocessor
Internal architecture:
The state register (ConditionRegister Code - CCR):
"Z" Zero: It is a bit that simply indicates whether the result
an instruction or operation is null. In this case, it is
Example 1:
AND #$C4; Logical AND between the content of Acc A ($3B) and
Example 2:
AND #$C3; logical ET between the content of Acc A ($3B) and
the value C3, the result in A.
03/06/2021 45
The 6809 microprocessor
Internal architecture:
The state register (Condition Register Code - CCR):
"N" Negative: It is a sign indicator. It is positioned
if the result of an instruction or an operation is negative.
Otherwise, it remains at 0. It contains exactly the most significant bit of
the byte resulting from the previous operation. A negative result
for a two's complement operation, set N to 1.
Example:
LDA #$C1 loading A with the value $C1
03/06/2021 46
The 6809 microprocessor
Internal architecture:
The state register (ConditionRegister Code - CCR):
03/06/2021 47
The 6809 microprocessor
Internal architecture:
The state register (ConditionRegister Code - CCR):
03/06/2021 48
The 6809 microprocessor
Addressing modes:
Definition:
The term 'addressing mode' refers to the way in which the data is
in the machine.
03/06/2021 49
The 6809 microprocessor
The addressing modes:
The mP6809 has 59 'basic' instructions.
Combined with the different addressing modes, they offer
(1 or 2 octets) (1 or 2 octets)
03/06/2021 50
The 6809 microprocessor
The addressing modes:
03/06/2021 51
The 6809 microprocessor
Addressing modes:
Inherent addressing:
03/06/2021 52
The 6809 microprocessor
The addressing modes:
Simple inherent addressing:
The operation code contains all the information necessary for execution.
example:
03/06/2021 53
The 6809 microprocessor
The addressing modes:
The inherent parameterized addressing:
The instruction includes an additional byte to specify the
operands involved in the instruction. the presence of this byte
supplementary is essential for instructions of the type:
Exchange and transfer of records.
Access instructions for the pile.
Waiting for interruption.
exchange and transfer of register: the first byte determines the code
pure operational, the second the source and destination registers.
TFR U,S transfer from U to S
Access instruction to the stacks: the first byte determines the operation code
pure, the post-byte, the registers involved in accessing the stack.
PSHS A, B, X save in stack of A, B, X
Waiting for an interrupt: the first byte is associated with the instruction
CWAY,le second sert à masquer ou à valider les interruptions.
CWAY#$FF waiting for NMI interruption (masked IRQ and FIRQ)
03/06/2021 54
The 6809 microprocessor
The addressing modes:
Immediate addressing:
In this addressing mode, the operation code is followed by a
value that is the operand of the instruction (on one or two
octets). This allows loading the internal registers of the µP with
the value of the operand.
Example: LDA #$80, Loading A with the value
hexadecimal 80.
03/06/2021 55
The 6809 microprocessor
The addressing modes:
Immediate addressing:
There are three types of instructions in this addressing mode:
Instruction on two bytes:
The first byte contains the opcode, the second the 8-bit constant.
This type of instruction is reserved for working on 8-bit registers.
Load Accumulator with #$43 load the value $43 into accumulator A.
03/06/2021 56
The 6809 microprocessor
The addressing modes:
Direct addressing:
This addressing mode has the advantage of requiring only 2
octets to access data located across the entire
the memory space of the µP. The first byte defines the code
operational, the second represents the 8 least significant bits of
the effective address whose 8 most significant bits are located in
the page register of the µP (DPR).
It is therefore enough to initialize the page register (DPR) in order to
work in direct addressing on 256 bytes of the selected page;
Beyond that, it is necessary to access the DPR again.
Upon power-up, the page register is set to zero. We
has access to the 256 bytes of page 0.
03/06/2021 57
The 6809 microprocessor
The addressing modes:
Direct addressing:
Example:
If the page register is $D3:
the LDA instruction <$42 will load
the accumulator 'A' by the content of
the memory cell $ D342 which is $7F.
Note:
the direct addressing will be specified by the
the sign " < " placed before the operand,
in assembly language syntax.
03/06/2021 58
The 6809 microprocessor
The addressing modes:
Direct addressing:
There are two types of instructions in this addressing mode:
Instruction on two bytes:
The first byte defines the opcode, the second the low weights of
the effective address
Example:
LDA $37ouLDA <$37 loading accumulator A with the content
of $D437 (DPR =$D4).
Instruction on three bytes:
The operational code is defined by the first two bytes. The third byte
Specify the reliable points of the effective address. The first octet is only
necessary for the instructions that operate on the stack pointer S, the register
of index Y and on the comparison instructions CMP operating on 16 bits
LDY $17 or LDY <$17 loading register Y with the content of $
2317 and $2318
03/06/2021 59
The 6809 microprocessor
The addressing modes:
Extended addressing:
The extended absolute addressing allows to find
data in memory.
The operation code (8 bits) is followed by 2 bytes.
constituting the effective address of the operand.
The symbol " > " is an assembler directive that
force extended addressing.
There are two types of instructions in this mode
of addressing:
Instructions on three bytes.
Instructions on four bytes.
03/06/2021 60
The 6809 microprocessor
The addressing modes:
Extended addressing:
Example:
LDA $21C0 or LDA >$21C0 loading of
the accumulator A with the content of address $21C0.
In this case, the operand is the accumulator A.
03/06/2021 61
The 6809 microprocessor
Addressing modes:
Extended addressing:
03/06/2021 62
The 6809 microprocessor
Addressing modes:
Extended Indirect Addressing:
03/06/2021 63
The 6809 microprocessor
The addressing modes:
Extended indirect addressing:
Instruction on four bytes:
Example:
LDA [$2000] charging of accumulator A with the
content whose address is located at $2000 and $2001.
03/06/2021 64
The 6809 microprocessor
Addressing Modes:
Extended indirect addressing:
Instruction on five bytes:
Example:
LDY [$2000] loading the Y index register with the
content whose address is located at $2000 and $2001.
03/06/2021 65
The 6809 microprocessor
The addressing modes:
Short relative addressing:
This addressing mode is reserved for instructions of
connection
The branch instruction operating in short relative addressing does
call for a format of only two bytes:
The first byte determines the operation code which specifies the
connection type at the same time as the corresponding test.
The second octet is the displacement value that can be
positive or negative.
In short relative addressing mode, the displacement is encoded on a
octet, we can move back by 128 octets and 127 octets
forward concerning the value of the ordinal counter (PC) at the end
of processing the connection instruction.
03/06/2021 66
The 6809 microprocessor
Addressing modes:
Long relative addressing:
Identical to the short relative addressing mode, it is always reserved
to the connections.
The essential difference between short relative addressing and relative addressing
how long the displacement is coded on 16 bits in the second case.
Instructions are encoded on four bytes, the first two
déterminent le code opération, les 3éme et 4éme octets donnent la
signed displacement value.
One can move forward by +32767 ($7FFF) bytes and
-32768($8000) backward, in relation to the value of the counter
ordinal (PC) at the end of the branch instruction processing.
At the machine code level, a pre-byte of value is added.
constant ($10) in the operation code to indicate addressing
relatively long.
03/06/2021 67
The 6809 microprocessor
The addressing modes:
Indexed addressing:
principle:
The instruction specifies a base (index) plus an offset relative to it.
base.
Effective address = base + displacement
03/06/2021 68
The 6809 microprocessor
Addressing modes:
Indexed addressing:
All these options will be selected by the post-octet that follows the code.
operative.
03/06/2021 69
The 6809 microprocessor
Addressing modes:
Indexed addressing:
Remarks:
The bits 5 and 6 of the post-byte allow to define the base.
03/06/2021 70
The 6809 microprocessor
Addressing modes:
Indexed addressing: No displacement.
In this mode, the selected pointer register contains the address
effective data to be used by the instruction.
There are two types of instruction:
Instruction on two bytes: the opcode is followed by
post-octet specifying the options chosen for the instruction in
course.
Example:
LDA ,X loading of accumulator A with the value of which
The address is the content in X.
Instruction on three bytes: for certain registers of
microprocessor, it is necessary to add a pre-byte to both
operational octets.
Example:
Load the Y register with the value of the X register Loading the Y index with the value whose address
is the content of X.
03/06/2021 71
The 6809 microprocessor
Addressing modes:
Indexed addressing: auto-increment/decrement.
03/06/2021 72
The 6809 microprocessor
Addressing modes:
Indexed addressing: auto-increment/decrement.
Example:
loading A with the value at the address
Load Accumulator, X plus
the content of X, post-incrementing X by 1.
Example:
LDY , - - X loading Y with the value whose address
The base is the content of X–2.
03/06/2021 73
The 6809 microprocessor
Addressing modes:
Indexed addressing: Constant displacement.
03/06/2021 74
The 6809 microprocessor
Addressing modes:
Indexed addressing: Constant displacement.
Movement on ±4 bits:
Example:
ADDB - 3, Y addition of the content of memory address Y -3 to
content of the accumulator B, the result is in the accumulator B.
03/06/2021 75
The 6809 microprocessor
Addressing modes:
Indexed addressing: Constant displacement.
Movement on ±7 bits:
Example:
loading the Y pointer with the content
Load the value from address $65 into register U
memory whose base address is the content of U + $65.
03/06/2021 76
The 6809 microprocessor
The addressing modes:
Adressage indexé: Déplacement constant.
Displacement on ±15 bits:
Example:
Load Accumulator with the value at memory address $2000 plus the content of register X. charging of the accumulator A with the
content memory address X + $2000.
03/06/2021 77
The 6809 microprocessor
Addressing modes:
Indexed addressing: Accumulator displacement.
03/06/2021 78
The 6809 microprocessor
The addressing modes:
Indexed addressing: Accumulator displacement.
Shift on ±7 bits accumulator A or B.
Example:
Load A, X loading accumulator A with the content
memory whose address is X + B.
Example:
LEAY D, X loading the Y index of the effective address
given by the sum D + X.
03/06/2021 79
The 6809 microprocessor
Addressing modes:
Indexed addressing: Base = program counter.
03/06/2021 80
The 6809 microprocessor
The addressing modes:
Indexed addressing: Base = program counter.
03/06/2021 81
The microprocessor 6809
The addressing modes:
Indexed addressing: Base = program counter.
Example:
ADD $9000, PC addition of the memory content whose address
is the current value of PC +$9000 and of the accumulator A, the
result is in A.
03/06/2021 82
The 6809 microprocessor
Addressing modes:
Adressage indexé: Base = compteur programme.
Localized etiquette:
The assembly syntax does not directly use a
movement but a localized label located at ±128 of
the following instruction (move on 8 bits) or anywhere
on the memory space of the microprocessor ( displacement on 16
bits) .
The effective address is equal to the program counter.
current plus a displacement encoded on 8 or 16 bits. The instruction
is encoded on three or four bytes.
the assembly syntax contains the mnemonic of the instruction,
the name of the localized label plus the base. The assembler
calculate the value of displacement based on the position of
the label.
03/06/2021 83
The 6809 microprocessor
The addressing modes:
Indexed addressing: Base = program counter.
Localized Etiquette:
Example:
03/06/2021 84
The 6809 microprocessor
Addressing modes:
Indirect indexed addressing:
03/06/2021 85
The 6809 microprocessor
the instruction set of the 6809
03/06/2021 86
The 6809 microprocessor
the instruction set of the 6809
data processing instructions
Arithmetic instructions.
The rotation and shifting instructions.
The logical instructions.
The increment instructions/
decrementing, resetting and
supplementation.
03/06/2021 87
The 6809 microprocessor
the instruction set of the 6809
data processing instructions
03/06/2021 88
The 6809 microprocessor
the instruction set of the 6809
data processing instructions
03/06/2021 89
The 6809 microprocessor
the instruction set of the 6809
processing instructions of
data
The logical instructions:
03/06/2021 90
The 6809 microprocessor
the instruction set of the 6809
data processing instructions
The increment/decrement instructions,
reset, complementation:
03/06/2021 91
The 6809 microprocessor
the instruction set of the 6809
data transfer instructions
Data transfer instructions can be classified into
three categories:
03/06/2021 92
The 6809 microprocessor
the instruction set of the 6809
data transfer instructions
Instructions operating on internal registers and memory:
03/06/2021 93
The 6809 microprocessor
the instruction set of the 6809
test and connection instructions
These instructions can be divided into three categories
distinct:
03/06/2021 94
The 6809 microprocessor
the instruction set of the 6809
test and connection instructions
The test and comparison instructions:
03/06/2021 95
The 6809 microprocessor
the instruction set of the 6809
test and connection instructions
The test and wiring instructions:
03/06/2021 96
The 6809 microprocessor
the instruction set of the 6809
testing and connection instructions
The jump and branch instructions:
03/06/2021 97
The 6809 microprocessor
the instruction set of the 6809
instruction operating on pointers
The 6809 has a single instruction of this type that offers
to the user several possibilities. The processor calculates
an effective address based on the addressing mode
specific (always indexed) then load this value into
the pointer (U,Y,S or U).
03/06/2021 98
The 6809 microprocessor
the instruction set of the 6809
instruction operating on interrupts
These are the instructions related to the
interruptions of the 6809. There are three on the 6809.
software interruptions and three hardware interruptions.
03/06/2021 99
The 6809 microprocessor
The interruptions
Generalities
03/06/2021 101
The 6809 microprocessor
The Interrupts of the 6809
The 6809 microprocessor has four lines for this purpose, called
material interruption entries that are prioritized.
03/06/2021 102
The 6809 microprocessor
The interrupts of the 6809
03/06/2021 103
The 6809 microprocessor
The interruptions of the 6809
03/06/2021 104
The 6809 microprocessor
The interrupts of the 6809
03/06/2021 105
The 6809 microprocessor
The interrupts of the 6809
03/06/2021 106
The 6809 microprocessor
The hardware interrupts of the 6809
03/06/2021 108
The 6809 microprocessor
The hardware interrupts of the 6809
03/06/2021 109
The 6809 microprocessor
The hardware interrupts of the 6809
03/06/2021 110
The 6809 microprocessor
The hardware interrupts of the 6809
03/06/2021 111
The 6809 microprocessor
The hardware interrupts of the 6809
03/06/2021 112
The 6809 microprocessor
The hardware interrupts of the 6809
03/06/2021 113
The 6809 microprocessor
The hardware interrupts of the 6809
03/06/2021 114
The 6809 microprocessor
The hardware interrupts of the 6809
03/06/2021 115
The 6809 microprocessor
The hardware interrupts of the 6809
03/06/2021 116
The 6809 microprocessor
The software interrupts of the 6809
03/06/2021 117
The 6809 microprocessor
The software interrupts of the 6809
03/06/2021 118
The 6809 microprocessor
The interfaces of the 6809
Generalities:
Interfaces ensure communication (unidirectional / bidirectional)
between the microprocessor and the external environment
(devices).
Two main families of interfaces associated with the same central unit:
Passive interfaces.
Active interfaces.
03/06/2021 119
The 6809 microprocessor
The interfaces of the 6809
Passive interfaces:
Their main characteristic lies in the fact that it is the
application microprocessor that has the task of management of
transfer.
Advantages:
Ease of implementation.
Ease of use.
Disadvantages:
The processor time used for managing exchanges with the
peripheral.
03/06/2021 120
The 6809 microprocessor
The interfaces of the 6809
Active interfaces:
the interface itself manages exchanges with the device (thanks to a
slave processor to the central processor.
Advantages:
Management autonomy of exchanges.
Disadvantage:
The hardware architecture of the application is more complex.
03/06/2021 121
The 6809 microprocessor
The interfaces of the 6809
According to the process of information transmission between the
microprocessor and the peripheral(s), we distinguish:
Parallel interfaces.
Serial interfaces.
03/06/2021 122
The 6809 microprocessor
PIA 6821
Parallel input/output interface: PIA 6821
03/06/2021 123
The 6809 microprocessor
PIA 6821
Parallel Input/Output Interface: PIA 6821
03/06/2021 124
The 6809 microprocessor
Internal and external organization of the PIA 6821
Internal organization:
03/06/2021 125
The 6809 microprocessor
Internal and external organization of the PIA 6821
External organization:
The PIA is presented in the form of a 40-pin mono DIL package.
tension (0.5V).
03/06/2021 127
The 6809 microprocessor
Internal and external organization of the PIA 6821
External organization:
Liaisons with the periphery:
03/06/2021 128
The 6809 microprocessor
Programming of the PIA 6821
This register concerns the programming of the special pins CA1, CA2 for the
portAet CB1, CB2 for the port to B.
b7 and b6: The status indicators accessible for reading, it's the PIA that will provide
day these bits according to the activity on the pins Cx1 and Cx2.
b5 to b0: The operating parameters accessible for reading and writing.
129
03/06/2021
The 6809 microprocessor
Programming of the PIA 6821
03/06/2021 130
The 6809 microprocessor
Programming of the PIA 6821
03/06/2021 131
The 6809 microprocessor
Programming of the PIA 6821
03/06/2021 132
The 6809 microprocessor
Programming of the PIA 6821
8000 DDRA and ORA
8001 CRA
8002 DDRB and ORB
8003 CRB
[Link] #$00 Access to DDRB Write a value
[Link]$8003 or CLR $8003 in port B
[Link] #$FF Port B output
[Link]$8002
[Link] #$04 Access to ORB
[Link]$8003
[Link] #$E0 1110 0000 on PortB
[Link]$8002 03/06/2021 133
The 6809 microprocessor
Programming of the PIA 6821
STA CRA
LDB #$80
STB NOW
END
03/06/2021 134
The 6809 microprocessor
Programming the PIA 6821
03/06/2021 135
The 6809 microprocessor
Programming the PIA 6821
PIACRA EQU $8001
PIACRB EQU $8003
EQU STONE $8000
PIADRB EQU $8002
PIAORA EQU $8000
PIAORB EQU $8002 Copy a value
CLRA from port A and
STAPIACRA
STAPIACRB transmit to the port
STAPIADRA
COMA B
STAPIADRB
STAPIACRA
STAPIACRB
AGAIN:
LDA PIAORA
STAPIAORB
GOOD AGAIN
END 03/06/2021 136
The 6809 microprocessor
Programming the PIA 6821
Exercises
03/06/2021 137
The 6809 microprocessor