CCS News

A Way to Teach C in the Classroom

Wednesday 22 December, 2021

The Microchip PIC® Microcontrollers (MCUs) have become the most popular choice for new 8 bit embedded designs. Other features include running at a speed of up to 280 million instruction per second, a low cost of some under $1, and large number of interfaces like USB, Ethernet and analog signals are useful features of PIC® MCUs.

The C programming language, originally developed by AT&T Labs by authors Brian Kerninghan and Dennis Ritchie, known as K&R C, became an international standard by ANSI in 1989. The C programming language syntax is the core of many newer programming languages. In 2003 a new standard derived from C defined the C++ language. C++ has some complex language elements that make it impractical for use on a microcontroller as opposed to a desktop PC. C is now the most popular language for programming microcontrollers and it is important for students to learn.

Whether you are an instructor looking to teach embedded C programming in a classroom setting, or a hobbyist looking to learn a new skill, Embedded C Programming:Techniques and Applications of C and PIC® MCUs by Mark Siegesmund is a great resource. It provides hands-on introductory concepts of C programming using PIC® microcontrollers with the CCS C compiler. The book demonstrates programming methodology and tools used by professionals in the field of embedded design by using a step-by-step approach. The writing is reader-friendly and the principles of the C programming language are introduced gradually. Each chapter builds on concepts introduced in the previous chapter, forming a strong foundation in embedded C programming.

There are endless possibilities in the field and the book encourages readers to alter, expand, and customize code for use in their own projects. The book focuses on real-world applications, programming methodology and tools, and best-practice techniques. Some other key features include:

* Each chapter includes C code project examples, exercises, and quizzes
* Tables, graphs, charts, references, photographs, schematic diagrams, flow charts, and compiler compatibility notes
* Publisher support and resources for educators
* Free Single-chip IDE Compiler for PIC18FK50 included with book purchase



The hands-on exercises in the book have been tailored to be used with the CCS E3mini development board. This board uses the PIC18F14K50 microcontroller. The board has a bootloader, so no device programmer is required to reprogram the board. Included is a USB cable that can send data to the PC for running the programs. Everything is included that you need to get started!

Chapter 3 example of an exercise:

1. Write a program that turns the green LED on for 10 seconds, the yellow LED on for 3 seconds, and red LED on for 10 seconds.
...

Chapter 3 example of a quiz question:
(3) What happens if a #define uses its own identifier name in the text of the define?
(a) This is the only way to get that identifier in the code post-preprocessor
(b) An error will be flagged on the #define line
(c) An error will be flagged where the define is used
(d) When the identifier is used it is turned into white space
(e) The computer hangs because it replaces the identifier with itself forever

CCS also has a Sensors Explorers kit. This product includes the E3mini Board, bunch of sensors and a tutorial book with examples for each sensor.

* Human Touch
* Temperature
* Light
* Barometric Pressure
* Humidity
* Accelerometer
* Magnetic Field
* Ultrasonic Range
* Vibration
* Sound
* Rotary Encoder

Included Output Devices:
* Full Color LED
* Generic Relay
* Stepper Motor

Also available to add on for additional purchase:
* GPS Unit
* 7-Seg LED
* Keypad

Learn more about our books here: https://www.ccsinfo.com/books.php

CCS provides many development tools in the world of embedded software, with our specialty being in embedded C programming for PIC® MCUs. A variety of options for our famous C-Aware IDE compilers and Command Line compilers, custom engineering and consulting services, and personalized technical support, are just a few of the tools and resources we have to offer. Check out our website and dive deeper into the world of embedded C programming! https://www.ccsinfo.com



Like us on Facebook. Follow us on Twitter.

About CCS:

CCS is a leading worldwide supplier of embedded software development tools that enable companies to develop premium products based on Microchip PIC® MCU and dsPIC® DSC devices. Complete proven tool chains from CCS include a code optimizing C compiler, application specific hardware platforms and software development kits. CCS' products accelerate development of energy saving industrial automation, wireless and wired communication, automotive, medical device and consumer product applications. Established in 1992, CCS is a Microchip Premier 3rd Party Partner. For more information, please visit https://www.ccsinfo.com.

PIC® MCU, MPLAB® IDE, MPLAB® ICD2, MPLAB® ICD3 and dsPIC® are registered trademarks of Microchip Technology Inc. in the U.S. and other countries.