C for Engineers
Homework
There is homework due every week. It will count to your assessment. The homework exercises are here.
I have written a detailed explanation about how to add C:\Dev-Cpp\bin to your PATH
Lecture notes
- Review of C: presentation slides, handout for printing
- Portability and Security: presentation slides, handout for printing
- Printer Ports: presentation slides, handout for printing
- The source to the lectures, diagrams are here.
Example programs
All the source files from the lecture notes are here; one zip file: now includes Andrew Eager's libioports, code, libraries and example programs.Syllabuses
This subject
- Interfacing Applications Using C: PDF, text, RTF formats.
- Advanced Control Using C: I do not have a soft copy yet; it will be here soon.
Prerequisites
- Electrical Control (C) Programming: PDF, text, RTF formats;
- Microprocessor System Assembly Lang Prog: PDF, text>, RTF formats.
Useful resources
Port I/O on Windows XP, 2000, NT
Port I/O on Windows XP, Windows 2000, Windows NT is a complex, unsupported mess. Use Linux if you want something simple, standardised and supported. Several people have built device drivers to work around the limitations of Windows. We will use the logix4u.net device driver. There are no open source solutions for Windows that I have seen yet.- The logix4u driver: logix4u.net. This comes with source, but you can only use the source for non-commercial applications, so it is not free software.
- Andrew Eager's handy binary installation of the logix4u driver and his wrapper for the driver: ioports.h, example program ledscan.c, install.bat, libioports.a (binary), A bundle with the source code
- Andrew Eager's wrapper source code for the logix4u driver, libioports.c
- Other example programs using the logix4u library for parallel port I/O, including test2.c
- Here are a few other miscellaneous solutions that various people have come up with to solve the problem: PortTalk from BeyondLogic.org (not an open source license), io.dll ("io.dll is completely free", but source code costs $1000.00!!!!! Thanks, but no thanks), giveio.sys (note that 'GIVEIO, by the way, "merely" makes use of a few undocumented kernel calls'), Direct IO, shareware, evaluation period, PortIO32 (no source)
Other Resources
Thanks to Andrew Eager, and also to Peter Bishop, who sent me many of these links in a few emails:
- Andy Eager's course notes for beginning C programming.
- About programming hardware: Learn C, Interfacing the Standard Parallel Port, Linux I/O port programming mini-HOWTO, Linux: A Clear Winner for Hardware I/O, Linux Analog to Digital Converter, About the parallel port
- Free Compilers and Documentation
- Some free books on C
- More free books on C
- Tour of C++, part of Bjarne Stroustrup's The C++ Programming Language. Learning Standard C++ as a New Language.
- The Dev-C++ compiler can be freely downloaded from here.
- Please note that the free Borland 5.5 command line compiler is available here. After installing it, put a little configuration file into the Bin directory. This configuration file would go into C:\Borland\BCC32\Bin. Email me any questions.
- Essays and Tutorials on C
- Marshall Cline's "C++ FAQ Lite" Err, I think Marshall means "light".
- Student Assessment Guide: HTML version, PDF version, Complete with an excruciatingly annoying delay as it slowly paints "2005" on each page