DOC PREVIEW
UB CSE 321 - UART and UART Driver

This preview shows page 1-2-3-4-5-6 out of 18 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 18 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

UART and UART DriverUART16550 UART ChipRS 232C StandardXINU UART DriverReferencesDevice driver contextUART Driver in EXINUDevice DriversSerial Port Block Diagram (general)Our SetupDevice driversDevice driver (contd.)Device Driver PhilosophyGeneral Purpose OS vs. Embedded SystemDevice Driver development stepsExample: A serial device driverSummaryUART and UART DriverUART and UART DriverB. Ramamurthy1•UARTUARTUART: Universal Asynchronous Receiver/Transmitter deviceDevice connected to the system bus; it takes parallel data converts into RS232C serial format and transmits it; and receives data in serial format and converts it to parallel format for CPU bus -- parallel byte is converted into start bit, 8 bits, parity bit and stop bit serial form and vice versaAsynchronous transmission allows data to be transmitted without the sender having to send a clock signal to the receiver. Instead, the sender and receiver must agree on timing parameters in advance and special bits are added to each word which are used to synchronize the sending and receiving units.-- That’s why you set the baud rate in your xinu environment216550 UART Chip16550 UART ChipLets study the layout and operation of 16550 UART chip.Page 1: The featuresPage 2: Basic chip configurationPage 6 …: RD and WR cycle timingPage 11: Pin descriptionsPage 14: Register summaryPage 15…: Register explanation3RS 232C StandardRS 232C Standard Serial communication standard.See the DE-9 pin configuration: G (5), TxD (3), RxD(2), DTR(4), DSR(6), RTS(7), CTS(8), DCD(1), RI (9)4XINU UART DriverXINU UART Driverxinu_mips-1.0/include/uart.hxinu_mips-1.0/uart/*Map all that you learned in the last few slides to the code in uart.h and the driver implementation in uart directory5ReferencesReferenceshttp://www.freebsd.org/doc/en/articles/serial-uart/http://cache.national.com/ds/NS/NS16C552.pdfhttp://xinu.mscs.mu.edu/National_Semiconductor_16550_UART#Physical_UARThttp://en.wikipedia.org/wiki/RS-232Linux device-driver:http://www.networkcomputing.com/unixworld/tutorial/010/010.txt.html6Device driver context Device driver context User processOperating System: dev/xyzDevice driverPhysical Devicehardware7UART Driver in EXINUUART Driver in EXINU1. General device driver related files: device.h, devtable.c2. Uart files: uart.h defining the physical features of the uart3. All the files in the uart directory that implement the operations related to the uart. ◦uartControl.c uartInit.c uartIntr.c ◦uartPutChar.c uartWrite.c uartGetChar.c uartRead.c8Device DriversDevice DriversChapter 7 of programming embedded systems (available on Safari)On board devices are called internal peripherals and one outside are called external peripherals◦UART Chip (internal)◦TTY (external)UART transceiverRS232D-9 connector  laptop serial socket ◦WRT54GL board and modifications910Serial Port Block Diagram Serial Port Block Diagram (general)(general)ProcessorUARTPeripheralRS-232TransceiverCOM1DB-9connectorOur SetupOur Setup11WRT54GLProcessor:BCM5353UARTPeripheralTI 16552RS-232TransceiverAMD202COM1DB-9connectorTo do: Read the book Chapter 7Device driversDevice driversEmbedded processor interacts with a peripheral device through a set of control and status registers.Registers are part of the peripheral device.Registers within a serial controller are different from those in a timer.These devices are located in the memory space of the processor or I/O space of the processor-- two types: memory-mapped or I/O mapped respectively.12Device driver (contd.)Device driver (contd.)The keyword volatile should be used when declaring pointers to device drivers.Our text goes on to discuss bit manipulation: please read it)◦Bit patterns for testing, setting, clearing, toggling, shifting bits, bitmasks, and bitfields.Struct overlays:◦In embedded systems featuring memory mapped IO devices, it is common to overlay a C struct on to each peripheral’s control and status registers.◦This will provide the offsets for the various registers from the base address of the device.1. 13Device Driver PhilosophyDevice Driver PhilosophyHide the hardware completely: hardware abstractionIf the device generates any interrupts include interrupt controllers.Device driver presents a generic interface for applications at higher level to access the devices: device.hDevice drivers in embedded systems are different from general purpose operating systems: See diagram in slide #7 ◦Applications in general purpose systems accesses OS (Operating Systems) which in turn accesses device drivers.◦Applications in embedded systems can directly access device drivers.1415General Purpose OS vs. General Purpose OS vs. Embedded SystemEmbedded SystemApplicationprocessOperating System: dev/xyzDevice driverPhysical DevicehardwareApplicationprocessDevice driverPhysical DevicehardwareDevice Driver development Device Driver development stepssteps1. An interface to the control and status registers.2. Variables to track the current state of the physical and logical devices -- Major and minor device number, device name3. A routine to initialize the hardware to known state4. An API for users of the device driver -- Read, write, seek5. Interrupts service routines16Example: A serial device Example: A serial device driverdriverRead the text for explanation and general example of a timerNow lets look at the UARTdriver of the embedded xinu and WRT54GL.Study the tty driver that is a logical device that is layered on top of the UART driver.In our Project 3 you will write a device driver for a logical device.17SummarySummaryWe studied the design and development of device drivers.We analyzed the code for a sample UART driver.To do: read chapter 7 from embedded system book; read the UART device driver exinu and


View Full Document

UB CSE 321 - UART and UART Driver

Documents in this Course
Anomaly1

Anomaly1

48 pages

ProcSept9

ProcSept9

17 pages

LecSept2

LecSept2

30 pages

CRCNov23

CRCNov23

14 pages

Load more
Download UART and UART Driver
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view UART and UART Driver and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view UART and UART Driver 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?