C Programming Use Continues

C Programming Language

The C Programming Language was developed by Dennis Richie and Ken Thompson at Bell Laboratories between 1969 and and 1973. It was the successor to B and used to create Unix. The recent bad experience with the Multics time sharing operating system development had made Bell Laboratories sensitive to that sort of cost blowout so the project was not widely promoted until the first working version was complete.

 

Ken Thompson and Dennis Ritchie

Ken Thompson and Dennis Ritchie

So what did C bring to the table that made it such a valuable asset? Here is a list:

 

  • can be used to directly interface to and manipulate hardware and IO
  • so it allows you to get close to the hardware itself
  • was a procedural programming language supporting structured programming
  • can be used to write an operating system
  • or sits very close to the operating system
  • had flexible naming conventions
  • had flexible memory allocation (static, local, global and dynamic)
  • could be compiled to machine language with a relatively simple compiler
  • is portable (mostly)
  • compiles to very fast executing code
  • compiled program can run without an operating system and do not need a virtual machine or any other components

The disadvantage compared to more modern procedural programming languages is that you usually do more typing to achieve the same outcome, it isn’t object oriented by nature and the variable typing is flexible so you can create some spectacular program failures if you get the cast wrong or convert a void pointer (no type associated with it) to the wrong data type. And one big compatibility issue is Endianness where different computing architectures store multi-byte data with the high byte at the top or bottom of the word so you can’t just swap binary data and expect it to always work. So you surely you would think we would have moved on to something better?

 

Programming Language Usage Trends

A recent study of computer language trends over the past 10 years by Embedded Gurus shows that unlike the anticipated rise of the C++ Programming Language in embedded systems, the use of C is rising and C++ falling. You can read the full article at C: The Immortal Programming Language where we see that Assembly Language use is falling as expected, the use of  C Programming Language is actually rising.

 

Programming Language Use Trends

Programming Language Use Trends

Now to be clear, this is for Embedded Software Development. In Top Programming Languages 2017 we see that Python is the most used programming language in the world across all domains with the  C Programming Language coming in second overall. This is a very big jump for Python but also a jump for the C Programming Language.

 

Successful Endeavours Programming Languages

At Successful Endeavours the majority of our embedded systems code is written using the C Programming Language . Our Windows code is a mixture of C and C++. For website development it is PHP and Python. So that’s 4 of the top 10 programming languages listed in Top Programming Languages 2017 .

 

Top Programming Languages 2017

Top Programming Languages 2017

So I expect we will be continuing to program systems using C for quite some time to come. Especially smaller systems that don’t have an Operating System. Now maybe someone should focus a bit more attention on teaching C to the next generation of programmers.

 

Successful Endeavours specialise in Electronics Design and Embedded Software Development, focusing on products that are intended to be Made In AustraliaRay Keefe has developed market leading electronics products in Australia for more than 30 years. This post is Copyright © 2018 Successful Endeavours Pty Ltd.

The Internet of Insecure Things

Insecurity in Cyberspace

This is not one of those topics that makes you feel better initially. In IoT Security we looked at how the emerging IoT world needed to protect itself against attacks. This is a different problem to pure Software Security which has its own challenges.

 

It was with recent interest that I received a copy of the Barr Group 2018 Embedded Systems Safety & Security Survey . We contribute and so get access to a free copy. I recommend you do the same if this is an area of interest.

 

They have also put together an infographic that speaks to the The Internet of Insecure Things and I am reproducing a low resolution version here with their permission. You can get a full resolution version by registering at the Barr Group website.

 

The Internet Of Insecure Things

The Internet Of Insecure Things

It speaks to where the insecure aspects come from. As usual, better Embedded Software Development practice leads to better and more secure products.

 

Successful Endeavours specialise in Electronics Design and Embedded Software Development, focusing on products that are intended to be Made In AustraliaRay Keefe has developed market leading electronics products in Australia for more than 30 years. This post is Copyright © 2018 Successful Endeavours Pty Ltd.

Top Programming Languages 2017

Top Programming Languages

Each of the past three years IEEE Spectrum have conducted a survey of the Top Programming Languages. This year they have done it again and the results are in. The overall winner is Python with C taking out the Embedded Software category.

 

Here is the overall list covering all development platforms considered.

 

Top Programming Languages 2017

Top Programming Languages 2017

So Python is the winner and for the first time. It’s continued rise in usage is a testimony to the usefulness of the language and the ecosystem that sits around it. But the top 4, Python, C, Java and C++ are a long way ahead of the rest overall.

 

Top Embedded Programming Languages

And for Embedded Software development we have.

 

Top Embedded Programming Languages 2017

Top Embedded Programming Languages 2017

 

There has been some discussion around whether Arduino is a Language since it is a platform with a development tool set built around C and some libraries. But this is a compilation of responses from software development practitioners and so they obviously think it is.

 

The surprise for me is Haskell. Functional Programming is still in its infancy and there is a lot we don’t fully get about it so I was surprised to see it ranking so highly. What would be really useful is to also get an understanding of what types of problems/solutions/applications the programming was being applied to rather than just the language the solution was implemented in.

 

Of interest is the correlation with the languages we use here at Successful Endeavours. Here is our short list:

 

  • C
  • C++
  • Python
  • PHP
  • Perl
  • VHDL
  • Assembly
  • HTML
  • Arduino

The previous results can be found in

 

Successful Endeavours specialise in Electronics Design and Embedded Software Development, focusing on products that are intended to be Made In AustraliaRay Keefe has developed market leading electronics products in Australia for more than 30 years. This post is Copyright © 2017 Successful Endeavours Pty Ltd.

I Nearly Retired

Manufacturing Profits you can retire on

I was talking with one of our past clients a little while ago. They told me they had a problem. They said, “Ray, I nearly retired“! So I asked them what that meant. And they explained.

 

We had developed a product for them a decade ago. The total project cost then around $50,000 as it included both the product Electronics Design, Embedded Software and also the Automated Test Equipment (ATE) for Production Test which also had an Electronics Design, Embedded Software and Windows PC ATE Software component to it. And from that product they made nearly $2,000,000 in retained profit. From their perspective, nearly enough to retire on. And since they own the company it is theirs to distribute as they please. Now they wanted to do it again. So we are onto another very exciting Product Development for them. Can’t say any more about that yet.

 

So I thought about the value proposition here. The maths says:

 

2,000,000 / 50,000 = 40:1 Return On Investment (ROI).

 

And that ignores the total value of the economic activity and profits their suppliers and customers have made.

 

Return On Investment (ROI)

Return On Investment (ROI)

Manufacturing Spearheads Economic Growth

The Victorian Government estimates that every $1 spent with a business like Successful Endeavours, there is $100 of overall economic value generated for the state. Makes you wonder why they don’t invest themselves? They used to through things like the Technology Voucher Program but all of that is currently shut down.

 

And of course there are the jobs this generates. Again, Victorian Government estimates are that every job in manufacturing creates another five jobs around it in the supply chain and supporting businesses. That is the highest ratio of any industry.

 

So what’s not to love about Australian Manufacturing! Let’s look at the benefits:

 

  • creates fundamental value (so the service sector has something to leverage off)
  • creates jobs and then more indirect jobs than any other industry so it is great for employment
  • creates profits

 

And far from being in decline, the Australian Manufacturing PMI has been in growth most of the past  2 years so that is also really positive for the overall economy. Check out he graph below from the Australian Industry Group (AIG).

 

Australia Manufacturing PMI 2015-2017 shows growth the whole way

Australia Manufacturing PMI 2015-2017 shows growth the whole way

The above graph was created by Trading Economics. They provide a a useful way to use the AIG Australian Manufacturing PMI figures to get reports in the format you want. If you explore it more deeply, you can see that we took a hit to Australian Manufacturing during the Global Financial Crisis (GFC) but it has been an upward trend from then on.

 

AIG

AIG

 

Go Australian Manufacturing!

 

Successful Endeavours specialise in Electronics Design and Embedded Software Development, focusing on products that are intended to be Made In Australia. Ray Keefe has developed market leading electronics products in Australia for more than 30 years. This post is Copyright © 2017 Successful Endeavours Pty Ltd.

Electronics Design: Technology Selection

Technology Selection

Before we look at how to choose a Technology, what does Technology mean?

In very general terms, Technology is understanding how stuff works and how to get it to do what you want.

Technology Selection

Technology Selection

There is lots of different stuff available. In the case of Electronics Design this stuff is the type of Electronics you will use and how you will make use of it. The most important choice to make is to determine:

  • What functions will I implement using Electronic Hardware ?
  • What functions will I implement using Embedded Software ?
  • What functions will I implement using local or Remote Communications ?
  • What does the user do?
  • How is it powered?
  • How is it packaged?
  • Does it need to sense anything?
  • Does it involve any chemical processes?

In looking at the answers to these questions I also need to consider:

  • Cost to Design
  • Cost to Manufacture
  • Cost to support
  • Production Volume
  • Power Consumption
  • Performance
  • Time to market

In the process of Product Development it is often Technology Selection that can make the biggest difference.

 

Electronics Hardware

If there is no software involved, then this is the choice of which devices can be used to implement the design and how best to use them.

Electronics Hardware

Electronics Hardware

A recent example for us was the interface and power supply for a new GPS module for the Yarra Trams Passenger Information Systems. There was a problem with the existing GPS modules in scenarios where buildings either side caused the GPS module to lose position. And guess what you have a lot of in the central part of a city? That’s right, taller buildings. The Passenger Information Systems required an accurate GPS position to work correctly. So the GPS module had been selected including the use of dead reckoning to update the position based on the wheel rotation and the interface between this and the rest of the tram had to be designed including some level shifting to adjust voltage levels. We also manufactured the interfaces for them.

Yarra Trams VPIS

Yarra Trams VPIS

So that is an example of a project that required no Software.

But most of the time there will be Embedded Software involved. And there are several really good reasons for this:

  • Embedded Software costs less in manufacture – see Reducing Electronics Manufacturing Parts Cost
  • Embedded Software is extremely flexible
  • Embedded Software can test itself
  • Embedded Software improves field support, service and upgrade capability
  • The Electronics Hardware to run Embedded Software gets cheaper every year
  • Remote Communications is getting cheaper all the time

So today we spend 80% of our time writing Embedded Software in C and C++ to run on the Electronics Hardware we design through the PCB Prototype or even Production. This is known as an Embedded System.

For this typical project type we do as much in Software as we can.

 

Embedded Software

Embedded Software is the software that runs on the Electronics Hardware. Unless the product must be super Low Power Electronics, we will do everything in Software except for the power supply and physical interfaces to the outside world. But there are a few caveats:

  • signal filtering is usually more power effective in Analog Electronics than DSP
  • sleep and wake timing for high powered systems is often best done with external Electronics Hardware
  • you have to be able to select a Microcontroller that has the right combination of price, features and performance
Embedded Software

Embedded Software

Given the enormous range of devices available today you would think the last point was easily covered but a recent project we did ended up with only 1 possible choice in the whole world for the Microcontroller. Here is the requirements list:

  • Run from a button cell for at least 2 years
  • Has a beeper
  • Has an LED
  • Operated from -20C to +70C
  • After a period of dormancy, start flashing the LED and activating the beeper
  • Beeper frequency, on time, off time, number of cycles and gap time are configurable
  • LED on time, off time, number of cycles and gap time are configurable
  • Dormant period is configurable
  • Unit timing must be accurate to better than 1 hour per year
  • Unit price in 100K quantities must be less than US$1
  • Software must be protected from copying

The solution was an MSP430 based device from Texas Instruments with a 32KHz crystal. Actual cost ended up at US$0.71. And absolutely everything was done in Software.

 

Remote Communications

With ubiquitous Internet enabled devices, knows as the Internet of Things or IoT, it is more cost effective than ever to add Remote Communications to products. This can have many benefits that reduce the cost of field and service support for a product and also makes possible features you could not have provided any other way.

Remote Communications GSM Modem Cinterion

Remote Communications GSM Modem

An example from a recent water metering project we undertook. This is a remote water dispensing system, also known as a Bulk Filling Station, that records who took water, how much water, when and where. The transaction is sent to a website via GSM modem and the Council can get the records to bill for the water without having to travel. It also means the tanker drivers don’t have to manually fill out log books and the Council don’t have to chase them for the data. Great savings there alone. But there were some extra benefits for us and the client that they hadn’t considered. These were:

  • Remote updates to the system application
  • Maintenance monitoring of batteries and valves
  • Regular check in to confirm the system was still operational

So if a new feature is needed, we can update the software and remotely distribute it the units in the field. Since these are currently spread over half of the east half of Australia that is an enormous saving.

Internet of Things - IoT

Internet of Things – IoT

And we can also determine when the batteries need to be swapped out so that can be a preventative maintenance operation at a time of the Council’s choosing and not an emergency call out when a truck driver can’t get water. It is quite common for the first tanker to fill up before dawn when the solar charging has been off overnight and the temperature is at its minimum for the day. The worst timing from the batteries perspective so it just works better all round if we known for sure how the batteries are travelling by keeping track. It also means that if a solar panel is damaged the Council can see there is an issue before the system stops working.

And the regular check in allows the Council to know if a unit is still operational or not. A recent example from NSW was a fire fighting crew going to a water dispensing point to refill their tanker during a bushfire only to find it had failed sometime last winter and never been repaired. With Remote Communications you can avoid that and although it costs more to design, manufacture and operate (due to SIM costs) it can still reduce the overall cost of a system significantly.

So that is the general process. Once we have decided what we will do in Electronics Hardware, Embedded Software and how much Remote Communications to use we are ready to get into the Electronics Design in detail.

 

And of course, no post like this is complete without an input from Dilbert.

 

Technology Selection - Get It Right

Technology Selection – Get It Right

Successful Endeavours specialise in Electronics Design and Embedded Software Development. Ray Keefe has developed market leading electronics products in Australia for nearly 30 years. This post is Copyright © 2014 Successful Endeavours Pty Ltd.