Book description
Interfacing with C is about interfacing personal computers using C. Anyone who is interested in ports, transducer interfacing, analog to digital conversion, convolution, filters or digital/analog conversion will benefit from reading Interfacing with C. Students will also find this a practical introduction to realtime programming with a generous collection of tried and tested programs.The pace of the book is such that the reader is encouraged to run the programs and experiment with C. The principles precede the applications in most cases in an attempt to provide genuine understanding and encourage further development. Readers will gain much from the handson experience the authors' approach provides, an approach designed to enable readers to climb steep learning curves with the minimum amount of assistance.
The many programs included in the text provide the essential handson experience. Some of the programs inevitably become rather lengthy, so the source code used is available as a free download from the Newnes website. The aim of the book, however, is to give the reader enough confidence to rewrite and improve these programs.
In the second edition Mike James has thoroughly updated all aspects relating to software, operating systems and graphical interfaces. He has also increased the scope of the book to include current forms of C++. Material on data acquisition has been thoroughly updated and the section on peripherals increased.
 A practical and painless way of becoming an expert C programmer
 New edition also covers C++ and the Windows environment
 Get up to speed with the essential maths needed for C without having to buy a university maths text!
Table of contents
 Cover image
 Title page
 Table of Contents
 Copyright
 Preface
 Preface to second edition

Chapter 1: An introduction to C
 Properties and background
 Fundamental interfacing
 Programmable input–output devices
 8255 programmable peripheral interface
 Programming the 8255
 IBM PC bus
 Accessing specific memory locations with C
 Reading the contents of I/O space using pointers
 C program development
 Variables
 Data type
 Qualifiers
 Reading the status of an input port
 Controlling printf()
 The coercion operator: cast
 Writing from keyboard to output port
 Entering data using scanf()

Chapter 2: Loops and data conversion
 Repetition: unconditional jumps
 Named constants #define
 Infamous goto
 Forloops in greater detail – in a binary counter
 Port monitoring with a dowhile construction
 Light chaser effect
 Communicating with peripherals
 Successive approximation
 Flash conversion
 Dual and quad slope conversion
 Synchronization and software control
 12bit AtoD conversion
 IBMPC AD574A interface

Chapter 3: Data acquisition using C
 Data capture using CGA graphics
 Controlling the coordinate
 Data capture with EGA graphics
 Background and foreground colour
 Building a Windows Application
 Transducer interfacing with C/C++
 Conditioning the signal voltage
 Simplifying program development
 Displaying temperature using EGA graphics
 Introducing random noise
 A linear transducer
 Measurement of light intensity
 Statement of the problem
 Chapter 4: Essential mathematics

Chapter 5: Convolution
 Matching analogue signals and systems
 Frequencyshifting rule
 Convolution
 Graphical interpretation of the convolution integral
 Obtaining the digital output recursively
 Digital feedback
 Obtaining the digital output by convolution
 Reconciling timedomain and frequencydomain processes
 Computerized convolution
 System response testing
 Applying the program
 Sophisticated applications
 Chapter 6: Digital filters

Chapter 7: Fourier transforms
 Fourier transforms using a PC
 Discrete Fourier transform DFT
 Developing and explaining the program
 Graphical spectral analysis
 Understanding the logical system of coordinates
 Applying the DFT program
 Streamlining the arithmetic using the fast Fourier transform
 How many multiplications?
 FFT with realtime data capture and graphics
 Control of the peripheral board and data capture
 Signal truncation and spectral leakage
 Reducing spectral spreading with a Hanning window

Chapter 8: Correlation
 Correlation methods using a PC
 Linear systems and random inputs
 Wiener–Khintchine theorem
 Autocorrelation
 Effect of finite observation time
 Calculating discrete autocorrelation functions
 Computing the autocorrelation function
 Anatomy of the program
 Graphical autocorrelation
 Applying the program
 ACF of sampled sine wave
 ACF of decaying exponential
 White noise
 Generating random noise and computing the ACF
 Anatomy of the program
 Using autocorrelation to detect noisecorrupted signals
 ACF with realtime data capture and graphics
 Autocorrelation in the real world
 The crosscorrelation function
 System testing and characterization using random noise
 Order out of chaos
 Chapter 9: Kalman filters

Chapter 10: Data conversion
 Digitaltoanalogue conversion
 A primitive digitally controlled potentiometer
 Buffering a binaryweighted resistor network
 R2R ladder network
 Analog devices AD7226 DtoA converter
 Waveform generation using a DtoA and C
 Generating sine waves – realtime and playback digital synthesis
 Waveform synthesis
 Softwarebased randomnoise generator
 Digital transfer functions and waveform modification
 Generating echo and reverberation
 Historical records and circular buffers
 Antialiasing filters and filtering the DtoA output
 Quantization noise
 Simulating audio reverberation
 Special audio effects
 Chapter 11: Investigating the spectral and timedomain performance of ztransforms using computermanaged instruction
 Chapter 12: Introduction to digital signal processing

Chapter 13: Standard programming structures
 Introduction
 Modular design
 The internal structure of modules
 Standard programming structures
 Eight different ways to convert temperature in Celsius to Fahrenheit using Cbased code
 The sequence construct
 Using the preprocessor directive
 The repetition construct
 Branching and looping
 Writing functions in C
 Commentary
 Using purposebuilt I/O functions – Peeking and Poking
 Using the functions peek() and peekb()
 Using the functions poke() and pokeb()
 Portmapped data transfer
 Input circuit
 Output circuit
 Computer part of the problem
 Microsoft C I/O calls
 Turbo C I/O calls
 Appendix 1
 Appendix 2: Listings of programs described in Chapter 11
 Glossary
 Index
Product information
 Title: Interfacing with C, 2nd Edition
 Author(s):
 Release date: December 2000
 Publisher(s): Newnes
 ISBN: 9780080574356
You might also like
book
TCP/IP Sockets in C, 2nd Edition
TCP/IP Sockets in C: Practical Guide for Programmers, Second Edition is a quick and affordable way …
book
Codeless Data Structures and Algorithms : Learn DSA Without Writing a Single Line of Code
In the era of selftaught developers and programmers, essential topics in the industry are frequently learned …
book
Programming in C, Fourth Edition
will teach you how to write programs in the C programming language. Whether you’re a novice …
book
Head First Design Patterns, 2nd Edition
You know you don’t want to reinvent the wheel, so you look to design patterns—the lessons …