Search This Blog

Sunday, April 8, 2018

Embedded System Podcast - Episode 4 Discussing Embedded System


An unplanned and impromptu discussion with one of my colleagues. Here we try and discuss the basics of the embedded system. How the architecture comes into being. The basic architectures, discussing the Program Memory, Data Memory, Control Unit and Arithmetic and Logical Unit.

Pretty basic information hopes it helps. Haven't verified what has been discussed. Lets see if I made any mistake during explanation.

Give it a thumbs up and share if you like. Will be launching on iTunes soon.

Hope this helps.

Thanks.


Saturday, March 17, 2018

Introduction to Code Composer Studio - Creating your First Project

Obvious is not that obvious. One of my friends wanted to learn CCS and work on C2000. While teaching him the same it came to my realization that some of the most obvious things are not that obvious to the first timers. So here in this post i try to capture the question and process i followed to catch him up with the CCS and C2000.

Before we jump in making something with C2000 lets understand what is the IDE(Integrated Development Environment) that is the Code Composer Studio. Lets see how we can make first project in it and understand the workspace and paths that are assigned to it.


Friday, March 2, 2018

200th Post: Lets set the goals for the future

Wow. Cant believe reached this landmark post. It is even difficult to believe that the blog survived for this long. So I must have done something right. 

I started this blog in around November 2010 just for fun and see what blogging actually is. It took a while for my blog to grow to this level where now i consistently get close to 15k views a month (not bad for a writer of my skill level). I started because I wanted to really learn embedded system and the best way to learn is to write about it. I believe that when you write about it you make sure that you are factually and technically correct. Cause once it is on the internet it is always on the interner. 

I have learned a lot more in past 4 years and would soon be sharing all the information. I have learnt about C2000 and C6000 architecture. I have programmed DSPs for Power Electronics applications especially for Power Converters. I have programmed MCUs for train. Have done a lot of fun stuff which has solidify my passion for engineering. Published papers and what not. 

On the professional front the volatility of my movement have slowed down and this year i have decided to revisit my roots and start consistent blogging again. A post per day I will. (Lol lets see how much that is possible.) Why am i even sharing this i dont think that anyone will read this. Anywho its my blog and i can write whatever i want. I am at a junction in professional front where i will need to think how i want to move forward and what i want to do professionally. I am hoping that  revisiting my root will give me a clarity. 

So let me set my goals from this day onward.
1 - Complete the Embedded System Podcast 10 episode series.
2 - Texas Instruments DSP Tutorials
3 - Continue with the M3 DSP Tutorials

Let see which of the three goals i achieve first. I got a writers block while doing the embedded system podcast. Hoping that will end soon. I have no clue how to best represent the idea and facts behind the architecture that i want to discuss on the podcast. Hopefully i will find something good and share it with the world.

Anywho Let me close this iconic 200th post which i never thought would happen. Best of luck to me.
Logging 2 March 2018 the 200th Post for this blog.

Thanks for reading. Enjoy.

PS: If you find this post cliche and not relevant. Well to bad for you cause this is my blog. Lol. Here is something you will probably enjoy. The piano playing cat. This was a fad way back in 2009.


Saturday, December 9, 2017

Embedded System Podcast - Episode 3 Design Metrics

Took a little while to write this episode. Was going through a writers block. Here is the episode 3 of my embedded system podcast on topic Design Metrics. Here i discuss certain points that are kept in mind during designing of any product(*COUGH* cost).

Thinking of attaching show notes in case anyone wants to refer.

Give it a thumbs up or share and comment if you like.

Have episode planned out till number 10. Hopefully will try and continue after that as well.

Thanks.

----

Show Transcript as follows:

This is the episode 3 of my podacast on embedded system and today i am going to talk about design metrics.

I have been involved in multiple projects both at the corporate level and as a independent freelancer. The description for these design metrics is based on my personal work experience and to be honest i have more info about some aspects of design and pretty less in the other.

For the listeners to have a better reference i will list out all the general aspects in the design metric and one by one dwell into it.

  1. Power Dissipation
  2. Performance (check)
  3. Process Deadlines (check)
  4. User Interface
  5. Size (check)
  6. Engineering Cost (check)
  7. Manufacturing Cost (check)
  8. Flexibility (check)
  9. Prototype Development Time (check)
  10. Time to market (check)
  11. System and User safety (check)
  12. Maintenance (check)


When fresh out of college armed with all the technical knowledge i had a very incorrect assumption of product being only a technical masterpiece. When i first joined the Research and Development in Corporate, it was there i recieved hands on experience in developing products for both cost sensitive market like india and quality driven market like that of uk, germany and italy. We were into developing solar inverters for the same. Then slowly there i realised that the number 1 factor that determines the design is the cost. This cost includes what the company will pay for development of the product that includes the engineering cost (which is also known as the research and development cost or most commonly recurring or non recurring cost) and Manufacturing cost(which includes the procurement, marketing, assembly and operation costs.) 

Whatever we are working on and whoemever we are working for there is always, always a paying customer. The paying customer is the reason we are developing the product. If there was no paying customer nobody would be working on it. This is true even when you are working as a freelancer. Even if i am working on a product as a freelancer there is always a customer i need to deliver the product to. Even though we as an engineer hate this fact but the cost is the number 1 driving factor behind each and every design of any product. 

Lets understand what kind of cost are actually involed. First there is this feasibility research that company does during new product development where they decide whether it is feasible for them provide an end to end solution or they need to adapt the solution from some other providers. This usually includes cost for initial research the prototype development and analysis of the factories assembly line. These usually are call non recurring engineering cost. As once this is done and the system is designed, there wont be any other design cost. 

This cost is separate from the unit cost, which is the cost the company would incur in actually manufacturing the product. Companies usually have a formula that determines feasibility. This formula takes into the account the Non recurring cost, the cost of unit when it will be produced and the predicted number of units that will be produced. The formula differs from company to company and is responsible in determing whether the product is feasible or not. 

Next factor is the time to market. How much time the company will take to bring the product into the market. This is essential as if the product comes out to be too late then the market has actually moved way ahead of the time and our product is obsolete. And if the product is release way to ahead of time then our product also may not work as it is far to advance for the market and there could not be any requirement for it. Hence in both the cases the product is deemed unfit and un required and company is the one that loses the money. 

There are actually many examples for this. We have seen many smartphones becoming obsolete as soon as they are launched as the competitor comes out with another advance smartphone and eats into the market share. 

So time to market is also one of the important factors that decides the design pattern. Best examples of this are video games like EA's FIFA and Other sports franchise. When the release date are commited it is absolutely neccessary for better sales that the games are released on time. So what developers does is that release the game in unfinished state and then after a month of release of the video game they send out a patch which sometimes tunes into GBs of download. 

Same is with embedded products. The product is released with a reduced feature just to get into the market and then over a period of time incremental releases are send to update the product to its full feature capacity.

Then another important factor that affects the design of the hardware software is how safe the product needs to be. In case of health care and avionics family of products, they need to go through rigiours system and safety tests. These products also needs to get certified. This is an additional cost on the product and is usually charged from the end customer. 

Let me give you example for two different products, a grid connected converters and metros and train sets. 

So the train sets and metros that carry lot of passengers on daily basis need to prove their safety by having SIL certificats. These are Safety Integrity Level. The SIL levels are defines on two numbers PFD(Probability of failure on demand) and RRF(Risk Reduction factor)
So the higher the SIL number the lower the PFD and the Higher the RRF. 

PFD is like probability of failure of product. The number shows what is probability the device will fail when demand is there for failure. The lower the number the more safe the device is. But still the product could fail. 

Here comes the next number RRF. This shows how much redundancy is there in the product. The higher the RRF number the more redundancy the product has and more it will be able to reduce the risk in case of failure. 

These kinds of certification are expensive and may require additional design components in the product that is apart from the base requirement that comes from the customer. 

Similar to this in the second example that i will talk about is grid connected converters. For safety they are tested through profiles like MEOST(Multiple Environment Over StressTesting) and Highly Accerelated Life test. They also have safety features like antiislanding and surge protection that needs to be taken care during designing the embedded product. 

As the grid connected converters are connected to a grid in remote locations and are exposed to the ambient environment 24/7. They need to pass tests that put them through stress both mechanically and electricall and thermally. The aim is that under any of the following stress the operation fo the grid converter should not alter and all the safety should work. Another is the Highly accerelated Life test that is done to identify at what point in normal operation that the converter will eventually fail. 

The safety features in converter such as antiislanding and surge protection are put in place to protect both the device and user from grid abnormality. These are complicated features to implement in the product and usually accompanies with a higher cost.

One of the product that i was working for was a kind of small form factor modbus controller. That need to be out in just 3 months, as the production line would be free for a 3 day period after that and we would be able to get our hands on the first production prototype and they would be able to set their process for the same. Though it was a proven thing for our team, we were not able to meet the delivery timeline and hence eventhough we had the best solution we could not go ahead with this as we were not able to complete the prototype in time. It was later analyzed that no matter how much effort we would have put in, it would not have been possible to put the prototype in that timeline. Hence even though you may have the most proven tech you may not be able to deliver the prototype in correct timeline or miss some or the other deliverly timeline making it unfeasible for the company to pursue any further.

Another important factor is the maintenance. Usually in case of small scale electronics and embedded products, no maintenance is required as they are just use and throw. But incase of higher complexity products like convertors and healthcare equipments, It is required that periodic maintenance is done. This maintenance is usually collecting the data of lifetime of product in the operation and then analyze it for any abnormal behaviour of the device. One of the example is a solar grid connected inverters. The inverter over its operation time collects data such as power delivered, consumed,duration of generation, numer of faults, types of faults, faults related voltage and current values and many more. This is done periodically, in certain interval of time. This data is then taken out and analyzed and then based on the climate details it is analyzed did it behave properly or not. Using this data especially of power generated and duration for which it is generated, it is easy to identify when inverter triped and didnot provide any power to the grid. That point is then cross verified with fault data and seen whether the trip happened due to grid side fault or due to some other internal fault. This is quite helpful and needs a proper design to be incorporated in the product.

In terms of flexibility, the more complex the product more flexibility is required for the product to accept changes such as software changes or sometimes some component changes. A simple home based UPS doesnt require frequent quality or performance update but in case of grid connected inverters change in grid requirements and to increase the performance it should be flexible enough to handle software update over the air or through some sort of user interface or engineering interface. Flexibility allows product to be used in many scenarios or requirement or sometimes to extend the product range. This requires an additional thought procses and intelligent design to allow for these changes in the near future. 

Size as a design metric sometimes can be a bit tricky requirement. Especially when concerning the wearable devices. A digital watch looks ugly if it crosses certain dimension diminishing the sales. On the other hand if size is reduced we end up removing most of the feature and moreover we make the product more expensive. This is where a tradeoff needs to be made. For this purpose companies decide that for certain sets of features like bluetooth, clock and a small display size will be x. For more intense features like having a full blown color screen and heart monitoring and many more the size increases from x to y dimensions. This is something that not only happens at the consumer electronics level but also in the industrial level. In case of solar inverter lets say the design should be such it should be able hang from a wall or from a pole. As the studies showed that the inverter will be connected in a shed kind of form where the solar panels will be like the shed feeding the PV voltage in the inverter hanging from the pole. In trains for example. The propulsion set cannot be largers than the dimension of the engine otherwise it will not fit. Because of this you can find that the propulsion set have such weird dimensions, longer in length and shorter in width. From design perspective a 2 level inverter for example cannot be made in a size of small compass. But as we go on increasing the level of inverter and keep pushing for better PWM techinques we can actually reduce the size of inverter to as small as credit card. The little box challenge of google is one such example where the companies compete to make the smallest inverter possible. Though it has many application but again the negatives are high too. The negatives come in the form of reduced reliability in such a small design and reduced long term usage and safety of such products.

Now how much excellent the product is at doing its job is another design metrics that i will be talking about. Performance is kind of a market driven requirement. In cases of smartphones the performance of the device is how fast it computes and how long it lasts on single charge. In case of camera performance is how better it captures the images at low light and how high the resolution is. In case of inverter is the effeciency with which it converts the DC to AC with minimal losess. Performace in propulsion system is how much torque it can deliver reliablily with minimum power drawn from the grid. So obvisousl this is a design metric that changes from product to product. Making a high performance product is a costly affairs both in terms of time and cost. Again as with all design metrics a tradeoff needs to be made. After reaching a certain performance parameter it is upto the developer to decide okay going beyond this will exponentially raisee the cost and makes no sense to do. Moreover it could also be possible like in case of solar inverter that you cannot actually achieve a 100% performance as it is physically not possible to do. So you need to settle with less than 100% and come out with a more reliable product.

Now lets talk about the final point the user interface. How the end user will interact with the product and how much the end user is allowed to interact with the product is something of science of its own. Give the end user lesser control over device you have an iphone on your hand and give more control to users you have an android device on your hand. This is classical debate where should the developers take the control to protect users from themseleves or should they allow them to do whatever they can with the device. Again this varies from product to product. For consumer electronics such as an Air conditioner you have a remote allowing to set very certain parameters like temperature, mode, on time and off time. For devices like refrigerators users can only interact by changing the cooling parameter. Most of them allow setting it to low, medium and high. How the user will interact with product affects the major design aspect, size and physical design and weight. 

Here i will conclude this episode on design metrics. Do feel free to comment share and stay tuned for the next episode. 
----

Sunday, November 5, 2017

Embedded System Podcast - Episode 2 RISC Vs CISC




Continuing the experiment here i present the second recording where i discuss majorly about the reduced instruction set and complex instruction set architecture. Also talking about some numbers.

Hope you guys like it. Share and give it a thumbs up and share your feedback if you enjoy it.

Thanks.

Embedded System Podcast - Episode 1 Introduction





Trying out something new. Like the new INTERNET standard try it out before ruling it out. Welcome to the podcast where i discuss about concepts, architecture problems and probably solution to various problems faced in the embedded domain.

Give it a thumbs up if you like it and share your feedback.

Thanks.


Friday, July 22, 2016

Raspberry Pi - The APT Command

The easiest to manage installation,upgradation and uninstallation APT is the command used in all the linux based operating systems. APT stands for Advance Packaging Tool. To install or remove packages one must have root user permissions. So user should be a sudoers or one must be logged in as a root user.


Obviously an internet connection is required for anyone to update the packages or install new ones. A point to note is that one cannot perform multiple installation at the same time.

APT keeps a url from where to get the software in the file located at:



/etc/apt/sources.list
 
One can see the contents of the file by using any installed editor:
 
sudo nano /etc/apt/sources.list 


Content of file sources.list


Before installing anything new lets update our list. The command for the same is apt-get update.

sudo apt-get update


Installing a package with apt-get



We will for example will install and uninstall a package called motion.
Typing the following command will prompt user for confirmation and will also provide disk usage information.


sudo apt-get install motion


Say yes and confirm the installation. Now we will move forward to removing the installed package of motion.

Removing a package with apt-get


We will now completely remove the package and its dependencies using command purge.

sudo apt-get purge motion

This will remove the package and all associated configuration files. The user is prompted for removal. Another similar command is the remove command which can be used to uninstall a package
 
sudo apt-get remove motion

The user is prompted to confirm the removal.

Raspberry Pi - My Experiments with Raspberry Pi

Unless and until you are not living under a rock everybody knows what is a raspberry pi. It is a small embedded linux based computer(Yes it is a computer. Almost full blown computer with limitations)

The official site for the same is:
https://www.raspberrypi.org/

One can find list of all the available pi boards, communities, amazing projects, host your own project and many many many more things.

There is also a long list of OSes that one can install on raspberry many generic and some serving a specific purpose.

I am a control engineer i develop control firmware for a living. The raspberry pi has provided a lot of options for prototyping algorithms like never before. Here i am going to log all the things that i experiment with my Raspberry Pi. Some might be old, some new and some totally badass but its just a log a kind of memory.

I assume that you have a simple setup of Raspberry pi and a computer ready.
I will be using putty for communicating with my pi.

So in the label raspberry pi you can find my experiments with raspberry pi.

Tuesday, July 29, 2014

SPI Registers in AVR



Most controllers in the AVR family support SPI. AVR has 3 register associated with the SPI.
1.       SPSR (SPI Status Register)
2.       SPCR (SPI Control Register)
3.       SPDR (SPI Data Register)


Monday, July 14, 2014

Serial Peripheral Interface Protocol



SPI – Serial Peripheral Interface is a bus interface used in many peripheral devices and nowadays almost all microcontrollers have it. Basically it connects a single masters to multiple slaves. So a single master controller can receive and transmit data to multiple slave microcontrollers.