C is for Car

por

C is for Car

C is for Car

C and its derivative C++ are the two most prevalent and relied upon languages used for the provision of Safety Critical Systems in the automotive industry and adherence to the ISO 26262 Certification Standard is mandatory.

But to understand why we need to wind the clock back in time to the glorious 1980s. Electronically controlled ignition and fuel injection systems were the first major embedded systems developed in the automotive industry.

The replacement of mechanical and analogue ignition and injection systems heralded the introduction of controllable digital alternatives, which kept pace with the availability of cheaper, faster, more robust and reliable micro-controllers.

Some modern motor vehicles have 100 or more ECUs

Those micro-controllers were used to control the ignition and fuel-injection systems and were the first complex embedded systems used in road vehicles. ‘ECU’ stood for ‘Engine Control Unit‘. With the adoption of similar systems in other domains, the name changed to a more generic “Electronic Control Unit”.

Most modern road vehicles now have around 50 ECU’s on board with higher end, high performance or specialist vehicles reaching 100 or more. Functions include Engine Management, Transmission Control, Passive and Active Safety Systems such as ADAS, ABS, Infotainment, Driver Displays, Climate, Navigation, and a host of systems that most drivers do not understand are lurking beneath the bodywork. Current estimates are that around 35% of the cost of a road vehicle in 2020 is in the electronics, and these systems all need to talk.

C and C++ are the dominant programming languages within the automotive industry

This brings us back to a question of language. A 2011 VDC Research Survey set the percentage of C language used in the industry at just over 70%, closely followed by C++. Languages such as Java, Pearl or Python are easy to exclude in safety critical arenas as they fall short on functional safety stability, mainly for difficulties in qualifying their Virtual Machines, compilers and interpreters. Complex behavioural requirements and functional safety demands of the automotive industry and the ISO 26262 standard have without doubt strengthened the position of C within the industry. C and C++ code can reconcile high-level structured programming with low-level mechanisms.

This makes it an obvious choice, especially when considering it is supported by a wide range of cross-platform compilers covering most classes of CPU, coupled with an ease of migration for platform-specific changes and support libraries. Efficient mechanisms exist within C for memory access, supporting integration and the friction free exchange of data, addressing of hardware specific requirements.

C is far from a perfect language, humans don’t have one, so why would computers?

C can be non-deterministic in its behaviour for some features, it has a propensity to allow for development bugs also, but despite these issues, C is a mature and widely supported and used programming language that offers an impressive range of high-performing and stable compilers for CPU architectures when addressing standards such as ISO 26262 and IEC 61508 which it derives from.  The popularity of C within safety critical environments is also helped by the extensive tools available that allow for both Static Analysis and Dynamic (Functional) Testing and metrics gathering which inspire a level of trust through the development community which permeates into the end user group.

A graphic showing the embedded systems contained within the typical modern car

That level of trust within the industry and end-user community, together with demands to deliver continuous changes in onboard technology can provide increases in efficiency, environmental friendliness and safety. They also allow a plethora of driver aids and systems designed to provide occupant safety, comfort and entertainment, and these demands will only increase.

There was a time when a new car buyer expected a car to have windows that wound up and down, a heater, lights that adequately lit up the road and an AM/FM radio. Even seatbelts were not a consideration with a vinyl roof probably being a more important option. Scary, but not that long ago!

The systems now found on road vehicles programmed in C are almost limitless

In 2020 the end-user demands a level of sophistication, reliability, efficiency, entertainment and safety that would have impressed airline pilots not that long ago. The systems now found on road vehicles programmed in C are almost limitless, with new technologies and new demands raising the level of complexity ever higher.

Mechanical actuation systems such as steering, clutch control, throttle and braking are now redundant and replaced by complex “drive-by-wire” systems developed initially by Formula 1 racing teams, the pinnacle of motor sport.  Dynamic controls such as Traction and ESP, Automatic Braking, Ice Detection, Adaptive Cruise Control, Automatic Wipers and headlights and even auto-dipping of lights and steering lights are now commonplace. All of which provide elements of safety and control in the blink of an eye without the drivers intervention and mostly taking place without the drivers knowledge.

Autonomous driving

The approaching technological marvel that will be autonomous driving is fast approaching and bringing with it levels of safety, efficiency and convenience never previously known; another step-change in transport.

Driverless vehicles will bring them a level of safety for vehicle occupants, to pedestrians and other road users beyond those we have today.. We are getting closer to a time when your highly efficient vehicle will take you from point A to point B without you intervening in its operation.

Sit back and relax, play a game with the family, watch a movie or have a sleep, driving will be a choice and it will no longer be demanding upon the driver. It will become a relaxing and enjoyable environment, highly efficient and environmentally sound.

Without the future development of hardware and the reliability of languages such as C and C++ and the use of reliable tool chains to qualify and certify vehicles and their systems, we would literally grind to a stop!

C is for Car.

RELATED RESOURCES