CS452 - Real-Time Programming - Spring 2008
Lecture 4 - Devices
Questions & Comments
- Hand in assignment 1
- Lab should be ready Friday
ISRs
Like function calls without arguments or return values.
- Save state of interrupted task
- Turn off source of interrupt
- Do the work
- Restore state of interrupted task
- Return to next instruction of interrupted task
Contrast RT to non-RT
- RT: may need to do a lot of work as quickly as possible
- non-RT: example is a real-time clock for the
date
command
Devices
Real-time clock
Usually a count-down timer
Programming
- mode: interrupt, continuous
- clock divisor
- cycle length
- start
Reading
- ready bit means timer reached zero
- latch and read gets where we currently are
USART
Universal Synchronous/Asynchronous Receiver/Transmitter
We load a piece of data, usually a byte. It shifts out the bits on a
time-multiplexed signal
Programming
- Bit-rate
- Synchronous/asynchronous
- Flow control
- 7 or 8 bit ACSII
- Start and stop bits
- Interrupt
- DMA
Using
Return to: