Innovation... driven by intelligence and logic

Serial Port Driver

Abstract :

A Serial Device Driver is used to drive the serial port of Personal Computer . Serial driver is a linux Kernel Driver written in Embedded 'C' language which controls the UART (Universal Asynchronous Receiver Transmitter ) IC - PC16550D . Serial Port is a character device so using this serial driver serial communication can be established i.e. we can send or receive the data byte by byte through serial port by implementing system calls like OPEN, CLOSE, READ, WRITE . There is a international Protocols for the serial communication named RS-232 , RS-422 and RS-485. So we have to implement this protocol in our serial driver so that it can communicate with the standard serial devices .

Introduction :

A serial driver is fall in the category of character device driver . This driver Controls the UART IC for the transmission and receiving . Two connectors are available for the serial communication DB-9 and DB-25 D-type connectors . When you write driver for any hardware then you should have the full understanding of the hardware level and its registers . For this serial driver you must have the full knowledge of the registers of the IC which you can studied through the data sheet of the IC .

A RS-232 (Recommended Standard -232 ) is a standard interface approved by Electronics Industries Association (EIA) for connecting serial devices . So RS-232 is a long established standard that describes the physical interface and protocol for relatively low speed serial data communication between computers and related devices .

A serial driver used by the Linux Kernel to control long distance serial communication .Rs-232 has been around as a standard for decades as an electrical interface between Data Terminal Equipment (DTE) and Data Circuit-Terminating Equipment (DCE ) such as modem or DSUs .RS-232 is used for asynchronous data transfer as well as synchronous links such as SDLC,HDLC,Frame Relay etc .

8 different Signals are used for serial data communication i.e. Tx(transmitting data), Rx(Recieving data),DSR/RI(Data Set Ready / Ring Indicator ), DCD(data carrier detect ),DTR(Data Terminal Ready), SG(Signal Ground),CTS(Clear To Send),RTS(Request To Send) . All these signals used to control the serial communication and controlled by the serial driver.

Prospects:

Every serial device needs serial driver for communication so this device is very effective for the character devices operated through serial port i.e. Printer . Today USB port replaced most of the I/O ports but if you need to interface any character device through USB then you also need the character driver.

 

Pre-requisites:
  1. Good Knowledge of Embedded 'C' language programming .
  2. Knows about the linux commands and their use .
  3. Must implemented the character driver , serial driver .
Training Topics In Brief:
  • Study of Data sheet used for the serial Communication
    • Data-sheet for IC- UART (PC16550D ) used for the serial communication.
    • Characteristics of the PC16550D
    • Register's Information and their description
  • Initialization Of Serial driver
    • Registration of serial driver
    • Memory allocation for the device representative structure
    • Initialization of character device specific structure
    • Register's Mapping in memory region
    • Registration of Interrupt line and its handler
  • Exit Function of serial Driver
    • Unregister the interrupt line and handler
    • Release the region where the registers are mapped
    • Free the memory
    • Unregister the serial driver
  • Functionality
    • Opening the device
    • Closing the device
    • Read ? Write operation on the device
    • Synchronization between device operation
  • Testing
    • Establish the 2-way communication between two PC using your serial driver
Go to Top ^