POSIX operating system serial programming (1)

xiaoxiao2021-03-05  26

Originally, Serial Programming Guide for POSIX OPERATING SYSTEMS (5th Edition, Michael R. Sweet, Copyright 1994-1999, All Rights Reserved.) Reprint this translation Contact the author Contact PangDae2005@yahoo.co.uk

POSIX operating system serial programming

Introduction

POSIX operating system serial programming will guide you how to compile success, valid, and portable procedures on UNIX workstations or PCs. Each chapter provides some routines that use the POSIX terminal control function to make them run in most UNIX operating systems such as Irix, HP-UX, Sunos, Solaris, Digital Unix, Linux. These operating systems use files as port devices and lock files.

Chapter 1 Serial Communication Foundation

This chapter introduces serial communication, RS-232 and other standards, and how to access the serial port using the C program.

What is serial communication?

Computer simultaneously transmits one or more information (data), serial communication includes most devices, keyboard, mouse, modem, and terminals. When the serial communication transmits and receives each word (such as characters or bytes), it is simultaneously sent and received, each bit or is on or off, and sometimes it can be recorded as (Mark) or no (Space). The speed of serial communication transmission data is usually represented by bit per second (BPS) or baud). It describes how many zero and one can be transmitted within a second. Looking back at the early age of the computer, 300 baud is considered to be fast, but the current computer can transmit 430800 baud according to the speed of the RS-232, when the baud rate exceeds 1000, uses thousand bats or Kbps to indicate, for example, 9.6K, etc. More than 1,000,000, use megabot or Mbps. In the serial port device or port, some are marked as a data transmission device DCE or data terminal device DTE, and the difference between them is alternate, such as transmission and reception, is alternate. When two DTE or DCE device interfaces are connected, the virtual data line or adapter is often used to exchange a pair of signals.

What is RS-232?

RS-232 is a serial communication standard electrical interface defined by the Electronic Industry Association EIA. RS-232 actually contains three different specifications, each specification defines different zero and one voltage range. The most common type is RS-232C, which defines the high potential range to -3V to -12V, low potential range 3V to 12V. RS-232C Specifications Signals Maximum can pass 8M. When Potter is low enough, the signal can be transmitted from 8m. The included or out of the wire is transmitted, the clock, state, and handshake signal.

转载请注明原文地址:https://www.9cbs.com/read-37817.html

New Post(0)