Ch3 Advanced Hardware Fundamentals Lecture
Ch3 Advanced Hardware Fundamentals Lecture
Fundamentals
Simon Chapter 3
Fundamental signals
Address lines
Data lines
READ/ - to get data in
WRITE/ - to send data out
Clock – heartbeat to pace the system
“Microprocessor” vs. “Microcontroller”
Location/amount of RAM/ROM
No difference in programming
“microprocessor” becoming generic term for all
Buses
A sample system has the following
components:
A microprocessor with 64K address space
A ROM with 64K of memory
A RAM with 32 K of memory
What signals do we need?
Address Space?
Address Space
RAM
Addresses
Microprocessor
Addresses
ROM
Addresses
A0 D0 A0 D0
A1 D1 A1 D1
A2 D2 A2 D2
. . .
. . .
. . . . . .
CPU ROM
D7 D7
A14
A15 CPU
A15
READ/
Clock
A0 D0
A1 D1
A2 D2
. . .
. . .
RAM
D7
WRITE/ A14
Order of Events
1) uP puts address on the address bus
2) uP asserts READ/ line to tell ROM to get the requested data
3) RAM puts data on the data bus
4) uP reads data, then disables READ/ to end the bus cycle
Extending the Bus Cycle
extra waits
states can be
Order of Events added here
1) T1 rising edge - address on the address bus
2) T1 falling edge - READ/ line asserted
3) uP expects valid data during T3 HIGH
4) T3 falling edge - De-asserts READ/
Interrupts
Interrupt Request – IRQ
To interrupt processing
uP may have several IRQs
Asserted LOW
May be level or edge triggered
Device IRQs are open-collector – share the line
Lines -
IRQ/
TXD: Transmit Bits
WE/
RXD: Receive Bits
OE/
CE/
RTS: Request-to-Send
CTS: Clear-to-Send
Usually
different clock
Clock from uP
Glue Circuitry
Connecting inputs, outputs, changing assertion
levels, combining signals, etc.
Programmable Logic Devices (PLDs)
Programmable Logic Arrays (PALs)
Create custom connections between parts and pins
PAL programmer
Code defines INPUTS, OUTPUTS, and Equations
Ultimate Customization – ASICS and FPGAs
Application Specific Integrated Circuits (Core-based)
Field Programmable Gate Arrays (PAL on steroids)
Watchdog Timer
External timer that will expire after defined time
Output: Line will pulse if timer expires
Inputs: HW/SW logic that is allowed to restart the
timer
If the timer ever expires, the logic failed to restart
the timer
WHY?
Because the software probably crashed.
Therefore.....
Use the WD output line to reset the microprocessor.
Watchdog Timer Typical Use
RIGHT
Use “regular” code
Use external logic
Microprocessor Built-Ins
Auxiliary circuits (peripherals) - same silicon
Generally appear in uP memory map
Timers
DMA – Direct Memory Access
I/O Pins
Address Decoding
Memory Caches and Instruction Pipelines
Timers
A counter that can be preset
Prescaler - multiples of the clock frequency
Generally counts down to zero, the triggers
interrupt
Can be one-shot or periodic
Can be used to drive an output pin
VERY USEFUL!
Input/Output (I/O) Pins
Can be configured as Input or Output
Pin voltage changed by writing to a register
Purposes
Turning LEDs on/off
Resetting Watchdog Timer
Reading EEPROM
Switching between banks of RAM
Keypads
LCDs, etc.
Sample I/O
EECLK
EEROM EEDATA
I/O A0
I/O A1
EEENABLE/
I/O A2
I/O A3
EEWRITE/ I/O B0
I/O B1
RED
I/O B2
GREEN0
I/O B3
GREEN1
Watchdog
RESET
CPU
Schematic Conventions
A15...Address Lines
D3...Data Lines
P1, P3...Connectors
J1, J2...Jumpers (configurations)
Pins are numbered
X0, X1 ...crystal
TP....Test Point
U7...IC
R, C, D...discrete components