Associate Professor Dept. of ECE, Manipal Institute of Technology, Manipal. 1 PORTS
• Interfacing with peripheral devices
• Speed and characteristics of these devices are different from the processor • Not connected directly • Interface chips are needed • They synchronize data transfer between processor and I/O
Dr. Sampath Kumar, Dept. of ECE, MIT 2
PORT STRUCTURE AND OPERATION • 8051 microcontroller has 32 I/O pins - Port 0 to port 3 • To monitor and control other devices • D-latch, output driver and input buffer
• To access external program and data memory, the output driver of port 0 and port 2 and input buffer of port 0 is used
• Addr/Data are Multiplexed
• The ports can be defined
as input or output port
Dr. Sampath Kumar, Dept. of ECE, MIT 3
Dr. Sampath Kumar, Dept. of ECE, MIT 4 Dr. Sampath Kumar, Dept. of ECE, MIT 5 TIMERS/COUNTERS
• 8051 has 2 timers – Timer 0 and Timer 1
• Both are 16 bit timers/counters • Both contain two 8 bit registers – TH0, TL0 and TH1, TL1 • It can be used to create time delay or to count the external events
Dr. Sampath Kumar, Dept. of ECE, MIT 6
Dr. Sampath Kumar, Dept. of ECE, MIT 7 Dr. Sampath Kumar, Dept. of ECE, MIT 8 Dr. Sampath Kumar, Dept. of ECE, MIT 9 DIFFERENCE BETWEEN TIMER - COUNTER