Professional Documents
Culture Documents
SINGLE-PURPOSE
PROCESSORS: PERIPHERALS
Dr. ASSAF M. H.
Introduction
Timers/Counters
counter increments every 6 cycles while (user has not pushed reaction button){
if(Top) {
Resolution = 6*83.33=0.5 microsec. stop timer
set Cnt to MS_INIT
Range = 65535*0.5 microseconds = start timer
reset Top
32.77 milliseconds }
count_milliseconds++;
}
turn light off
printf(“time: %i ms“, count_milliseconds);
}
a signal checkreg
131070–X called */
}
For 2 min., X =
120,000 microsec.
Embedded Systems Design: A Unified 8
Hardware/Software Introduction, (c) 2002 Vahid/Givargis
Serial Transmission Using UARTs
UART: Universal
Asynchronous Receiver embedded
device
1 0
Transmitter 0
0 1
1 1
1
error checking
Start bit, stop bit
Baud rate
signal changes per second
bit rate usually higher 1 0 0 1 1 0 1 1
RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 Description
M1
M2
M3
M4 4
key_code key_code
keypad controller
N=4, M=4
Red A
White A’
Yellow B
Black B’
5/15 = d/(28-1)
d= 85 so Encoding: 01010101
Successive-approximation method