Interfacing with C
eBook - ePub

Interfacing with C

  1. 302 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Interfacing with C

About this book

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 real-time 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 hands-on 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 hands-on 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!

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Interfacing with C by Howard Hutchings,Mike James in PDF and/or ePUB format, as well as other popular books in Design & Programmazione. We have over one million books available in our catalogue for you to explore.

Information

Publisher
Newnes
Year
2000
Print ISBN
9780750648318
eBook ISBN
9780080574356
Edition
2
Topic
Design
1

An introduction to C

C is a medium-level programming language developed by Dennis Ritchie of Bell Laboratories and implemented there on a PDP-11 in 1972. Historically, C was preceded by B, a language written by Ken Thompson in 1970 for the first UNIX system run on the PDP-7. B, in turn evolved from the Basic Cambridge Programming Language BCPL, developed by Martin Richards at Cambridge in 1967 as a systems programming language.
The C Programming Language (1978), by Kernighan and Ritchie is the definitive text. Although it is not adopted as an international standard, it is generally accepted as standard C. This original and enigmatic text is not an introductory programming manual; it assumes familiarity with basic programming concepts such as variables, assignment statements, loops and functions – and is probably best read once you have mastered C. The increasing popularity of the language has encouraged numerous less esoteric works, many attempting to simplify the original Kernighan and Ritchie text. Each of these introductions has its relative merits; no doubt you will make your own choice and find what suits you best.
In 1979, Bjarne Stoustrup added the concept of object-oriented classes to C. His first incarnation of this was called C with Classes and was the subject of a Bell laboratory report in 1980. By 1984, this had evolved into C++; a programming in-joke to reflect the C method of incrementing the value of a variable. Many compilers were available by 1987 when the language had attracted the attentions of the ISO and ANSI standardization committees.

Properties and background

The versatility of C and C++ allows them to be run on the full range of processors; from 8-bit microcontrollers up to the Cray series of supercomputers. Designed to make programs fast and compact, this portable assembly language was used to program the remarkable computer-animated sequences in Return of the Jedi and Star Trek II. In many cases programs written in assembly language for ‘efficiency’ have been outperformed by comparable programs written in C/C++. Despite being medium-level languages, they still embody advanced structural programming features associated with higher level languages such as Pascal or ADA. C/C++ is a concise language and small can be beautiful when programming. It has a particularly rich set of operators, ideal for configuring programmable input–output devices and flag testing.
The purpose of this book is to teach those aspects of the C/C++ language you will require to interface effectively. Our strategy is to teach C/C++ program constructions as we go along, presenting the information in ‘byte’ sized packets in an attempt to make it more attractive and digestible. We have tried to organize the programs in a progression of complexity, so that each program presents a new feature of C/C++ or an alternative program construction. Where possible the construction is illustrated with a flowchart and the program liberally littered with comments to aid comprehension.
All of the program examples have been tried and tested originally on an IBM PC clone using a Microsoft C compiler version 5.1 and more latterly with a Pentium II under Windows 95 and Borland C++ Builder. The emphasis is on effective interfacing rather than elegant programming. Where possible we have included alternative program constructions in an attempt to demonstrate the flexibility of this remarkable language. The text encourages you to run the programs and experiment with C/C++. Inevitably some of the programs become lengthy, which tends to discourage even experienced programmers! To maintain interest the fundamental construction is presented separately. Most programs exist to be rewritten; and if after working through the examples you cannot do better, we’ll be disappointed.
Rather than design and build our own interface circuits we chose to use the Blue Chip Technology data acquisition and control cards. These plug-in cards are port mapped and may be driven by any language, simplifying the task of interfacing – allowing us to concentrate more effort and attention on the programming aspect of the problem.
Of course, a separately purchased and internally installed Parallel Input-Output card is not the only way of acquiring data for the PC. There are advantages (and some disadvantages) of using the existing ports, not the least that they already exist and drivers are built into the PC. Ports which could also be used include:
• Parallel Printer Port
• RS232 Serial Port
• USB Port.

Parallel Printer Port

The standard PC Centronics Port has three independant ports which perform the functions of a
• Data Output Port
• Control Output Port
• Status Input Port.
It is possible to design or buy interface cards for the Printer Ports which use an 8255 interface device to provide 24 line of 3 × 8-bit ports in the same way as will be described for the Parallel I/O port. Indeed, a similar technique is already use...

Table of contents

  1. Cover image
  2. Title page
  3. Table of Contents
  4. Copyright
  5. Preface
  6. Preface to second edition
  7. Chapter 1: An introduction to C
  8. Chapter 2: Loops and data conversion
  9. Chapter 3: Data acquisition using C
  10. Chapter 4: Essential mathematics
  11. Chapter 5: Convolution
  12. Chapter 6: Digital filters
  13. Chapter 7: Fourier transforms
  14. Chapter 8: Correlation
  15. Chapter 9: Kalman filters
  16. Chapter 10: Data conversion
  17. Chapter 11: Investigating the spectral and time-domain performance of z-transforms using computer-managed instruction
  18. Chapter 12: Introduction to digital signal processing
  19. Chapter 13: Standard programming structures
  20. Appendix 1
  21. Appendix 2: Listings of programs described in Chapter 11
  22. Glossary
  23. Index