Chapter 10
I.	Intro
	A.	Parallel: 8 lines at a time device is close
	B.	Serial is one bit at a time, used for long distances
II.	Basics of Serial Communication
	A.	Serial is much more efficient and reliable than parallel
	B.	There is a register to convert parallel into serial at both ends
	C.	Modem converts from 0s and 1s to sine waves
	D.	Synchronous: Transfers a block of data by characters
	E.	Asynchronous: Transfers a block of data by bytes
	F.	UART (Universal Asynchronous Receiver-Transmitter) and USART 		(Universal Synchronous-Asynchronous Receiver-Transmitter) chips are 		used.  
	G.	Half and Full Duplex Transmission
		1.	Data that can be transmitted and received is duplex
		2.	Data that is only sent is simplex
		3.	Transmission in one direction at a time is half duplex
		4.	Both ways at a time is full duplex.
	H.	Asynchronous Serial Communication and Data Framing: There must be 		a protocol or method of framing data.  
	I.	Start and Stop Bits
		1.	Asynchronous used to transfer character-oriented information
		2.	Each character placed between start and stop bit in asynchronous 			in method called framing
		3.	Start is always one bit, stop can be one or two
		4.	Start is low, stop is high
		5.	When there is no transfer, signal is high (1)
		6.	Order is start bit, D0-D7, and stop bit
		7.	Characters can be 7 or 8 bits
III.	8051 Serial Port Programming in Assembly
	A.	Intro
		1.	Serial communication of 8051 with COM port of PC is emphasized
		2.	Baud rate of 8051 mucst match PC's com port
	B.	Baud rate in 8051
		1.	Timer 1 used to program Baud Rate
		2.	Crystal frequency divided by 12 to get machine cycle frequency
		3.	UART divides machine cycle frequency by 32 before used by 			Timer 1 to set Baud rate.  
		4.	Timer 1 must be programmed in mode 2
		5.	Timer 1 Values (Baud rate -> TH1D -> TH1H
			a.	9600 -> -3 -> FD
			b.	4800 -> -6 -> FA
			c.	2400 -> -12 -> F4
			d.	1200 -> -24 -> E8
	C.	SBUF Register
		1.	8 bits, used for serial communication
		2.	Byte must be placed in SBUF to be transferred
		3.	Byte framed with start and stop bits when placed in register
	D.	SCON (serial control) register
		1.	The SCON register is 8-bits used to program start bit, sop bit, other 			bits for data framing
		2.	SM0, SM1
			a.	Specify number of bits per character and number of stop 				bits
			b.	Mode 1 is only one used today
			c.	10 bits are transferred including start and stop w/mode 1
		3	SM2: Set it to 0
		4.	REN (Receiver enable)
			a.	When high, data can be received from RxD pin
			b.	Turning to 0 can block data reception
		5.	TB8 = 0
		6.	RD8 (Received bit 8)= 0
		7.	TI (Transmit Interrupt)
			a.	When 8 bit character has been trasnferred, flag is raised
			b.	Indicates transfer of another character can happen	
		8.	RI(Receive Interrupt)
			a.	When data is received via RxD, start and stop bytes 					eliminated, byte is placed in SBUF
			b.	When done, RI raised to know byte has been received
	E.	Programming 8051 to Transfer Data Serially
		1.	TMOD loaded with 20H (timer 1 in mode 2)
		2.	TH1 loaded with correct value for baud rate (assume 					XTAL=11.0592 MHz)
		3.	SCON loaded with 50H (serial mode 1)
		4.	TR1 set to 1 (start timer 1)
		5.	TI cleared
		6.	WRite byte to transfer to SBUF
		7.	TI flag monitored to see if character has been transferred
	F.	Importance of TI Flag/Steps to Transmit Character via TxD
		1.	Byte written to SBUF
		2.	Start it transferred
		3.	One bit of character at time transferred
		4.	Stop bit transferred.  TI flag raised.  
		5.	This makes sure SBUF register isn't overloaded.  If another byte is 			written before, the untransfered parts will be lost.
		6.	After a new byte is loaded, TI is cleared
	G.	Programming 8051 to Receive Data Serially
		1.	TMOD loaded with 20H (timer 1 in mode 2)
		2.	TH1 loaded with correct value for baud rate
		3.	SCOn loaded with 50H (serial mode 1)
		4.	TR1 set to 1 to start timer 1
		5.	RI cleared
		6.	RI monitored to see if entire character received
		7.	When flag is raised, SBUF contains entire byte.  This is moved 			elsewhere. 
	H.	Importance of RI flag bit/Steps to Receive Character through 8051
		1.	Start bit is received, indicating character will be received			2.	When last bit received, byte formed and placed in SBUF.
		3.	Stop bit received, setting RI = 1
		4.	SBUF copied into safe register.  
		5.	RI must be set to 0 or else character will not be received properly
		6.	Character will be lost if not copied. 
		7.	If RI not cleared, byte will be moved before transmission is 				complete
	I.	Doubling Baud Rate in 8051
		1.	Use higher frequency crystal
		2.	Change bit in PCON register
		3.	Changing crystal frequency isn't actually feasible
		4.	SMOD in PCON is set to 0 initially
		5.	When SMOD set to 1, baud rate is doubled.  
		6.	PCON is not bit-addressable