Beginning Programming Books Part 2
I was in a bit of a dither in deciding whether to go down the C/C++/C# route or to go down the Java route for this second part of the beginning programming series. In the end I decided, for Part 2 to go down the C/C++/C# route. Why so ?
Since my thoughts are to a signifcant extent concerned with the theme of programming as a second career I chose these languages because I think that they have a most interesting career potential. Let me explain a bit more. There is much interest nowadays in the Internet of Things (IoT). Most of the small gadgets / widgets that populate the IoT space are embedded systems, and these are programmed in C. These small systems, unlike Workstations and the larger server machines which run things such as databases and web servers, for example, are called embedded systems. They have smaller processors on board which are called micro-controllers, and have relatively small amounts of memory (tens to hundreds of Kilo Bytes (KB)). By and large the code that runs on them is written in the C programming language. This is why learning C can be the start of a very interesting programming career.
In an earlier scribend about the history and importance of C I introduced some introductory books for learning C programming. Over several decades of teaching C programming I have found that, though initially, C looks easy it is, in fact a very subtle language that one learns to appreciate over several years of programming. C++ was, originally, developed as an extension of C by Bjarne Stroustrup. It is an object oriented programming language that builds on top of C. The first C++ standard took some time to materialise. More recently the C++ standard has been extended and modernised, and most modern C++ compilers support the C++11 standard. Further developments have led to the C++14 and C++17 standards.
C# was developed by Microsoft in conjunction with the development of the .Net framework. Rumour has it that is was meant to be a "better Java than Java", and, in all fairness it does have some nice features. The implementation of C# for Linux systems is called Mono, and it does a pretty good job of playing catchup with all the new features Microsoft keeps adding to C#. Once again, knowing the syntax of C is useful when learning C#. Knowledge of C# programming and .Net is essential for anyone aspiring to develop applications on Microsoft Windows platforms. Full proficiency requires mastery of various Microsoft frameworks such as WPM (Windows Presentation Foundation), WCF (Windows Communication Foundation) and ASP.Net, as well as the Microsoft MVC framework.
Beginnning Programming Part 2a - C Programming
If planning on a career developing embedded systems and IoT (Internet of Things) applications learning C programming is essential. For complex applications running on Linux and Unix C++ programming skills are in considerable demand, and C++ is becoming more widely used in implementing embedded systems applications. In the computer games world C++ programming is very much the language of choice e.g. your scribendist ran several C++ programming courses for King (the makers of Candy Crush) who switched many game developers from Action Script programming to C++ for performance reasons and the ability it gave developers to write complex and maintainable code efficiently. Interestingly we also ran a C++ unit testing course for them as well.
Learning C out of a book is not as easy as it sounds. Over quite a number of decades teaching C programming courses a common scenario in introductory C programming courses is the following ... " I started teaching myself C from a book / web links and then ... (a silence descends on the class .. and a wee shiver) .. I started on "pointers". If there is any area of C programming that causes "fear and anxiety" in relative beginners it is the area of "pointers and dynamic memory management". Yet it is precisely this aspect of C that gives it its power and versatility. Then, for the very brave and the more advanced there is the subject of "mixed C and assembler programming". Mastering C does not, to most of us come easily. If you are a "timid" programmer, like me, who literally "suffers" when compiler errors are displayed, or a program that compiled with no errors or warnings crashes and emits a "core dump" you will apreciate the assertion that mastering C takes a number of years ... and probably you never really master all its subtleties fully, even if you explore the art of implementing a C compiler in C. The good news is that C programming can be mastered. However, do not be seduced or impressed by "glitzy commercial web sites" that claim that by attending an intensive 12 week workshop in some "fashionable and luxurious venue" you will become a one of the "Jedi of the C programming world" and be able to command princely salaries and freelance consultancy fees. There is a great need for C programming skills, especially when it comes to developing IoT (Internet of Things) applications and there are good salaries to be earned. However, embedded software development is not the world of "high finance and international banking" which, as well as ability exploits the advantages of influential connections, education at top private schools and top Oxbridge and Ivy League colleges and business schools. The problem with aspiring to mastery of C programming is "where to begin".
Embarking on a pilgrimage to master C programming
Nowadays I recommend learning C by developing C programs on a number of different platforms. These should include
- Regular PCs and laptops running MacOSX, Windows or Linux
- BBC Microbit
- Embedded Linux systems such as e.g. the RaspberryPi and the BeagleBone Black
- Internet of Things - Concepts and Technologies
- Arduino IoT Courses
- RaspberryPi C Programming
- ARM Cortex M Microcontroller C Programming
- C Programming of Microchip PIC16 and PIC18 8 bit Microcontrollers
General Introductory or not too advanced specialised C Programming BooksThe books in this section provide an introduction to C programming without delving into the details of embedded systems application development.
- C Programming Absolute Beginner's Guide (Absolute Beginner's Guides (Que)) by Greg Perry
- Beginning Programming with C For Dummies by Dan Gookin
- C Programming: A Modern Approach by K N King
- C Programming In Easy Steps 4th Edition by Mike McGrath
- C Programming Language: The Ultimate Beginner's Guide by Easy Programming
- Programming in C (Developer's Library) by Stephen G. Kochan
Arduino Programming BooksThe Arduino was developed, originally, as a means for enabling the creation of interactive art installations. The Arduino IDE was based on the Processing IDE which, itself, was designed to enable artists to create interesting graphics displays in a language called Processing, without needing to be skilled in advanced graphics programming frameworks such as OpenGL.The history of the Arduino project and the early Arduino prototypes is quite fascinating. I only realised the ideological implications of the thinking behind the Arduino when teaching Arduino programming and marking assignments for working engineers taking a "foundation year" degree module at Carshalton College. They found programming very difficult, yet the practical projects they built were "gems of craftsmanship". This "epiphany" made me realise that software systems and software are tools that should be usable by craftsmen - hence "artisanal computing". The Arduino is programmed, essentially, in simplified C++ i.e. mostly C with a bit of C++ and libraries containing methods that hide much of the underlying low level detail needed to program an Arduino application. Learning to program an Arduino should provide inspiration and ideas to tackle larger and more complex projects. It can also serve as a stepping stone to being inspired and motivated to put in the effort to really master C programming. Not that long ago the head of IT for EMEA for a major "fizzy drinks manufacturer" booked an intensive Arduino programming course from Friday through to Sunday. As he put it "When I follow the various Arduino recipes I can build something that works. When I try to design a project of my own from scratch it seems to be a total failure". Another Arduino course I ran, which also explored serious Arduino C programming, was for a charismatic first year 6th former (year 12) and his younger brother planning to set up a robotics club at his school. Yet another Arduino course was for "some government employees from the Middle East" interested in using Arduino based sensors for monitoring applications which ended up as a moderately advanced embedded C programming course. The path from Arduino to C is quite a well trodden path and starting programming with an Arduino can be a good way to get started with C programming. The following books are all readable practical introductions to Arduino programming. The one by Mike McRoberts is really helpful. Mike used to put together Arduino kits and I got to know him through reselling his kits. They have since been overtaken by cheap kits manufactured in China and distributed by companies such as Seeed. Jack Purdum's book on beginning C for the Arduino serves as a good introduction to C programming centred on programming Arduino devices.
- Beginning Arduino: Second Edition by Michael McRoberts
- Arduino Cookbook by Michael Margolis
- Exploring Arduino Paperback by Jeremy Blum
- Programming Arduino: Getting Started with Sketches by Simon Monk
- Arduino Workshop: A Hands-On Introduction with 65 Projects by John Boxall
- Beginning C for Arduino, Second Edition by Jack Purdum
More advanced and specialised C Programming BooksDeveloping more advanced C programming skills involves, typically,
- Studying more advanced data structures and algorithms implemented in C
- Studying operating systems Application Programming Interfaces (APIs) implemented C
- Studying mixed C and assembler programming of various target microcontroller architectures
Data Structures and Algorithms in CLoudon's book on Algorithms in C is an excellent resource, especially when combined with related books published by O'Reilly such as Understanding and Using C pointers and, for coverage of recent developments in the C language Klemens' book 21st Century C.
- Mastering Algorithms with C by Kyle Loudon
- Understanding and Using C Pointers Paperback by Richard M. Reese
- 21st Century C: C Tips from the New School by Ben Klemens
Other classic books on algorithms and data structures in C are those by Robert Sedgewick, Thomas Standish, Mark Weiss and by G. Gonnet. Binstock's book on practcial algorithms for programmers contains some useful implementations. Skeppstedt and Soderberg's book on writing efficient C code covers recent developments in the C language standards and is more than just an introduction.
- Algorithms in C, Parts 1-4: Fundamentals, Data Structures, Sorting, Searching (3rd Edition) Robert Sedgewick
- Data Structures, Algorithms, and Software Principles in C by Thomas A. Standish
- Data Structures and Algorithm Analysis in C by Mark A. Weiss
- Handbook of Algorithms and Data Structures in Pascal and C 2E by G. H. Gonnet
- Practical Algorithms for Programmers Paperback by Andrew Binstock, John Rex
- Writing Efficient C Code: A Thorough Introduction by Jonas Skeppstedt, Christian Soderberg
Micrcontroller Programming in C
The following is a list of widely used microcontrollers including 8 bit, 16 bit, and 32 bit microcontrollers.
- 8051 microcontroller - a classic 8 bit architecture still in use
- Atmel 8 bit AVR - the original processor used in the Arduino
- Microchip 8 bit microcontrollers - PIC10, PIC12, PIC16 and PIC18
- PIC24 and dsPIC - Microchip 16 bit microcontroller families
- PIC32 - Microchip's 32 bit processor family - based on the MIPS processor architecture
- ARM Cortex M0, M3 and M4 - widely implemented 32 bit ARM microcontrollers designed for embedded applications
- FTT C Programming Courses
- The Training Arm - Specialised Embedded Systems Programming Training
- Internet of Things Devices Programming Training
8051 Microcontroller Programming
- C and the 8051: Vol. 1: Programming for Multitasking by Schultz, Thomas W. Schultz
- C and the 8051, Vol. II: Building Efficient Applications Textbook Binding by Thomas W. Schultz
- C and the 8051 (4th Edition) Paperback by Thomas W. Schultz
Atmel AVR 8 bit Microcontroller Programming
- Embedded C Programming and the Atmel AVR by Richard Barnett, Sarah Cox, Larry O'Cull
- AVR Microcontroller and Embedded Systems: Using Assembly and C (Pearson Custom Electronics Technology) by Muhammad Ali Mazidi, Sarmad Naimi, Sepehr Naimi
- Make: AVR Programming: Learning to Write Software for Hardware by Elliot Williams
PIC16 Microcontroller Programming
Chuck Hellebuyck's books on Embedded C Programming are useful introductory books covering C programming of Microchip's family of 8 bit microcontrollers. Though aimed at the hobbyist market (e.g. readers of the Nuts and Volts Magazine and Elektor) they do provide a good overview of many aspects of programming embedded systems in C. They do, however, need updating to cover recent developments in Microchip's new MPLABX IDE (Integrated Development Environment) Microchip's XC8 C compiler and Microchip's Code Configurator tool.
- Beginner's Guide To Embedded C Programming: Using The Pic Microcontroller And The Hitech Picc-Lite C Compiler by Chuck Hellebuyck
- Beginner's Guide to Embedded C Programming - Volume 2: Timers, Interrupts, Communication, Displays and More by Chuck Hellebuyck
- Beginner's Guide to Embedded C Programming - Volume 3: Creating the SimpleC Library of Functions by Chuck Hellebuyck
- M101 - PIC10, PIC12 and PIC16 Architectures and Assembly Language Programming (4 days)
- M102 - PIC18 Architecture and Assembly Language Programming (4 days)
- M103 - A Comprehensive Introduction to Embedded C Programming of Microchip 8 bit devices using the XC8 Compiler (5 days)
- M104 - A Comprehensive Introduction to USB and USB Programming Using PIC18 Microcontrollers (5 days)
- M105 - A Comprehensive Introduction to Embedded TCP/IP and Ethernet Programming Using PIC18 Microcontrollers (5 days)
- M106 - Multi-tasking and Finite State Machine driven application development with Microchip 8 bit Microcontrollers (5 days)
- M107 - Advanced C Programming using the XC8 Compiler
The PIC18 was developed by Microchip to extend the capabilities of the PIC16 and is widely used in many industrial and engineering applications. Probably the best book covering programming the PIC18 Microcontroller, and, also, an outstanding book on embedeed systems programming in general and programming of 8 bit microcontroller systems in particular is is Sid Katzen's The Essential PIC18 Microcontroller (Computer Communications and Networks). This too needs updating to cover MPLABX, XC8 and Code Configurator. It is, however, quite an expensive book and so only for the very serious programmer.
PIC24 and dsPIC Microcontroller Programming
These are the two Microchip families of 16 bit microcontrollers. The PIC24 is designed for standard industrial control applications, whereas the dsPIC is more complex and includes hardware support and an extended instruction set for carrying out digital signal processing computations.
Probably the most comprehensive book concerned with PIC24 programming is that written by Bryan Jones and colleagues and which is used in course ECE 3724 - Microprocessors at the University of Mississipi. It is very good value for money and very thorough. Programming 16-Bit PIC Microcontrollers in C by Lucio Di Jasio is also a good book. The second edition does cover the use of MPLABX. Lucio Di Jasio has had a distinguised career with Microchip and has much experience which has been distilled into some of the interesting and challenging projects covered in this book. The book is backed up by a website containing many further resources. Also worth having is Thomas Kibalo's introduction to PIC24/dsPIC33 programming. It focuses on the PIC24 architecture. However, code that does not involve use of DSP processing instructions is essentially the same for both the PIC24 and the dsPIC processors.
- Microcontrollers: From Assembly Language to C Using the PIC24 Family by Bryan Jones, Robert Reese, J. Bruce
- Programming 16-Bit PIC Microcontrollers in C: Learning to Fly the PIC 24 Paperback by Lucio Di Jasio
- Beginner's Guide to Programming the PIC24/dsPIC33: Using the Microstick and Microchip C Compiler for PIC24 and dsPIC33: Volume 1 by Thomas Kibalo
The First Technology Transfer courses oriented towards the PIC24 and the dsPIC processor families are shown below.
FTT Microchip 16bit Microcontroller Courses
- M201 - PIC24 Architecture and Assembly Language Programming (4 days)
- M202 - A Comprehensive Introduction to Embedded C Programming using the XC16 Compiler (5 days)
- M203 - A Comprehensive Introduction to USB and USB Programming Using PIC24 and dsPIC Microcontrollers (5 days)
- M206 - A Practical Introduction to Digital Signal Processing (DSP) for dsPIC developers (5 days)
- M207 - A Practical Introduction to Digital Control Systems for PIC24 and dsPIC Developers
- M208 - Multi-tasking and Finite State Machine driven application development with Microchip 16 bit Microcontrollers
- M209 - Advanced C Programming using the XC16 Compiler
PIC32 Microcontroller Programming
The PIC32 microcontroller family is the top end of the Microchip microcontroller families. These are 32 bit processors that are based on the MIPS processor architecture. The high end members of the PIC32 have maths floating point units and are DSP capable processors. Over the coming years now that Microchip owns Atmel and, therefore, controls the Atmel AVR and Atmel ARM brands it will be very interesting to see how all these brands evolve and are further developed. It is worth bearing in mind that ARM itself is now in Japanese ownership and there have been rumours that it may, at some point in the future be sold to a Chinese company. This suggests that developing both MIPS and ARM based microcontrollers may have strategic advantages for Microchip. We certainly live in "interesting times".
I think that, currently, the most thorough and well thought out book on PIC32 programming is that developed out of the work at Cornell University by Kevin Lynch and his colleagues. The book and underlying course material is oriented around the NU32 board, and this aspect has been criticised in several reviews. However, I suspect that the reviewers are not approaching the book as engineers or as developers of course materials. Lucio Di Jasio's book on programming the PIC32, though it needs some updating is still a very good book. It was one of the first books to provide serious examples and approaches to PIC32 programming in C. Bill Petrick's book on working with Microchip's Harmony MPLABX tool for developing PIC32 real world applications is, to the best of my knowledge, currently the only book on this subject. Harmony is a very interesting tool that tries to take care of the hard work of configuring device driver code for particular PIC32 microcontrollers and which also provides support for the implementation of multi-tasking applications,including those using real time operating systems such as FreeRTOS.
- Embedded Computing and Mechatronics with the PIC32 Microcontroller Paperback by Prof Kevin Lynch, Nicholas Marchuk, Matthew Elwin
- Programming 32-bit Microcontrollers in C: Exploring the PIC32 (Embedded Technology) by Lucio Di Jasio
- Harmony for PIC32MX Applications Paperback by Bill Petrick
The First Technology Transfer courses oriented towards the PIC32processor family are shown below. These are instructor led courses, however, distance learning based variants of these courses are available.
FTT Microchip 16bit Microcontroller Courses
- M301 - PIC32 Architectures and MIPS Assembly Language Programming (5 days)
- M302 - A Comprehensive Introduction to Embedded C Programming using the XC32 Compiler (5 days)
- M303 - A Comprehensive Introduction to USB and USB Programming Using PIC32 Microcontrollers (5 days)
- M304 - A Comprehensive Introduction to Embedded TCP/IP and Ethernet Programming Using PIC32 Microcontrollers (5 days)
- M306 - A Practical Introduction to Digital Signal Processing (DSP) for PIC32 developers
- M307 - A Practical Introduction to Digital Control Systems for PIC32 Developers
- M308 - Multi-tasking and Finite State Machine driven application development with Microchip 32 bit Microcontrollers
- M309 - Advanced C Programming using the XC32 Compiler
ARM Cortex M0, M3, M4 Microcontroller Programming
The books selected here have been chosen based on research and development work carried out by FTT when developing its ARM Cortex M embedded systems courses. Course materials have been adapted to use various development tools such as those from Keil, IAR, Atmel and Atollic. These devices are widely used in the development of IoT devices. The BBC Microbit, itself, is based on an ARM CortexM0 core. Books dealing with the BBC Microbit and IoT programming will be covered in a later section.
- Embedded Systems with ARM Cortex-M Microcontrollers in Assembly Language and C: Third Edition by Yifeng Zhu
- Embedded Systems: Introduction to Arm® Cortex™-M Microcontrollers: Volume 1 by Jonathan W Valvano
- Embedded Systems: Real-Time Interfacing to Arm® Cortex™-M Microcontrollers: Volume 2 by Jonathan W. Valvano
- Embedded Systems: Real-Time Operating Systems for Arm Cortex M Microcontrollers: Volume 3 by Jonathan Valvano
- The Definitive Guide to ARM® Cortex®-M3 and Cortex®-M4 Processors 3rd Edition by Joseph Yiu
- The Definitive Guide to ARM® Cortex®-M0 and Cortex-M0+ Processors by Joseph Yiu
The First Technology Transfer courses oriented towards the ARM Cortex M processor families are shown below. These are instructor led courses, however, distance learning based variants of these courses are available.
FTT Microchip ARM Cortex M0, M3, M4 Microcontroller Courses
- ARM Cortex-M Assembly Language Programming
- Introduction to ARM Cortex-M C Programming
- Advanced ARM Cortex-M C Programming
- Introduction to ARM Cortex-M C++ Programming
- ARM Cortex-M USB Application Development
- ARM Cortex-M Wireless Application Development
- ARM Cortex-M Internet of Things Application Development