Transcript for:
Embedded Engineering Roadmap

let's discuss the ultimate road map to become the best embedded engineer see if your aim is to just get into a top company that pays you really well then this video is not for you this video is for those who genuinely want to know what it takes to be the best embedded engineer out there if you're good at what you do everything else will follow you can get good company with the best pay in this video we'll discuss the road map using practical examples which will make the video interesting and easy at the same time so watch this video till the end let's divide this video into four parts first Basics you need to master for embedded first build a strong foundation and only then go further then we'll see embedded in different words mainly semiconductor industry and consumer electronics Industry depending on which field you focus on the skills you need to develop will be different then we will explore projects and free open source tools to make them finally let's conclude with the skills that every embeded engineer must have but before we go any further make sure to like And subscribe so that we can build a strong Electronics community okay let's start with the basics these Basics will help you to be a great embedded engineer no matter the industry or the rule let's keep it like this first I'll convince you on why you need to master a particular topic or a skill and how it is exactly used in the industry then we'll discuss the best resources to master that very topic first C programming this is one language you definitely have to master and be very very comfortable with but YC as an embedded engineer you will be constantly interacting with the hardware C is the most closest you can get to the hardware after assmbly language so it's obviously very fast making it best for embedded systems you can yourself test this in C write a v Loop to count from 0 to 1 billion and similarly write it in Python if you're using a Linux based system which you should run the time command on the term and it will give you the execution time here I first compile the C code and then run it using time command and as you can see it just took 1.5 second to count till a billion now let's run the python code one eternity later okay the python code has finally executed and as you can see it took 1 minute 19 seconds whereas C had just taken 1.5 second to count to a billion that makes C almost 50 times faster than python but why is C faster than python one reason is of course because C is compiled and python is interpreted language in C the whole code is first translated into machine code that is your binary code which runs on your machine directly but in Python the code is translated line by line during the run time it's like two different translators one who first understands completely what you're saying and then translates and the other who translates each line of what you see now you tell me which one is faster of course the first translator that is your compiler but the main reason why C is the fastest and has the best performance is because it gives the entire control to the program you can literally do whatever you want but as they say with great power comes great responsibility remember with great power comes great responsibility you have to be very conscious while writing the code see in most of the languages there is something called garbage collector it basically manages the memory if there is any unused memory it automatically reclaims it ensuring the program does not run out of memory anytime but in C you don't have this you're totally in charge of the memory this has both pros and cons the advantage is that there is nothing extra running on the CPU like your garbage collector that consumes extra memory and clock cycles of your CPU the disadvantage is of course there is no memory safety and if you overuse the memory your code can very well Crush that is why you will have to be very very careful while using the memory but there is one emerging language that has all the best things of C with a memory safety let's discuss that later in the video not only C is the fastest but it also gives you the complete control by now you should be convinced why learning C is so very important for embeded but your approach to learn C cannot be like a general software engineer then what should your approach be to learn C for embeded systems first get comfortable with the basic syntax of c and then get used to doing all the basic things in C start Hands-On from the very first day itself then spend time in knowing all the data types in C you should know what data type will suit you best for the task like say there is some sensor data that can be only 32bit positive integer now to collect the data in a variable what data type will you use a regular software engineer will simply declare in type and go ahead but as an embeded engineer you should immediately think of unsigned int ins sign data type you waste one bit only to store if the number is positive or negative but here as we are dealing with only positive integers why to even waste a bit now you are literally in control you know what what Max data can fit in and you are using the memory efficiently and then if you're using some constant like Pi which is always 3.14 throughout the code you use cons data type then you should know how to use volatile for variables that can change values outside the scope of the program like a variable that is modified by an intera say you're detecting an object using a p sensor the variable that receives data from the pr sensor should be of volatile type so whenever the pr detects an object the variable is set one by the interrupt which is not under the control of the program going to the next level you can use const and volatile together now you tell me in the comments where this can be used and some other use cases of volatile once you are properly comfortable with all the data types move ahead and completely Master pointers and then work on the most important thing this skill will be evaluated in every embedded interview manipulation it can be bit manipulation string manipulation or pointer manipulation mainly concentrate on bit manipulation and for this you need to know all the logical operators like and or exor left shift right shift and especially know bit toggling and bit masking take it from me every recruiter will want to know how good you are in this topic even after you enter the industry you will be doing a lot of bit manipulations so practice this as much as you can then start with memory management as I said before the whole game is playing with the memory but very carefully for example you allocated some memory but you forgot to free it and your program ran out of memory this is called a memory lead you should always ensure that this never happens to your program so explore the complete memory layout of C you should know how the final compiled code is segregated in the memory where does the uninitialized and the initialized data go difference between stack and Heap very very important here is where you exactly understand the difference between static and dynamic memory make sure to keep this things in mind first how to allocate and deallocate memory when to use Malo Cog and reloc second what are the checks before and after allocating or freeing up the memory third when to free up the allocated memory and when not to we'll talk in detail about all of this in some other video after this start exploring data structures especially arrays and Link list only if you have mastered pointers will you be able to do link list properly do everything in link list traversal insertion reversing the link list deleting sorting double link list this will make you comfortable with pointers and this is more like an aptitude it will also make your brain sh for every code you write know the space and time complexity what I have seen mostly is people are very comfortable to tell the time complexity of the program when it comes to the space complexity most of the people struggle to answer once you're comfortable with link list start implementing stacks and cues using both arrays and Link list okay to summarize first Master different data types in C then get comfortable with pointers then Master bit manipulation string manipulation specially practice bit masking and bit toggling then understand the complete memory layout of c and then learn to create dynamic memory know when to use maloc Calo Realo free though dynamic memory is usually not recommended for real-time embedded applications as it is a bit dangerous to use memory during runtime in some cases you might still need it so it's better to learn it then start with basic data structures arrays and Link lists these topics are good enough to get you a very good foundation in C especially for embedded systems coming to the resources to master C first start with nisso Academy c playlist then in parallel practice from Geeks for geeks like study one topic and then practice the very Topic in Geeks for geeks for bid manipulation I'll share the resources to study and practice in the description below you can refer to C programming a modern approach by Ken king for a reference the next topic to master Master is rtos but why do you need an OS when you can directly load the firmware into the microprocessor or your microcontroller see when you have a lot of things running on the processor you need some kind of a manager that can manage and allocate the resources properly but why not a general OS instead of rtos for embedded systems take an example of an airbag system you need the airbag to be deployed in a few milliseconds after an accident a general OS will never guarantee you any hard deadline for this so there is a good chance that the airbag deployment can be delayed and even 1 second of delay can be fatal also a general OS is too bulky for a microcontroller that is where rtos comes into picture it can guarantee that the tasks meet its hard deadlines and is also lighter on the microcontroller if you're still not convinced about rtos let me tell you how rtos saved the day for NASA and helped Apollo 11 land safely on the moon in Apollo 11 there was a Apollo guidance computer AGC which was responsible for Landing Apollo 11 on the moon when the Lander was about to land on the moon there was a radar that was sending random data to the computer and was unnecessarily overloading it and because of this the computer started missing critical deadlines and mind you this was a very critical phase of Landing but to the rescue there was a special program on the computer which was managing all the resources and making sure critical tasks meet their deadlines this magical program was nothing but RT as soon as it identified that there was something overloading the system unnecessarily it immediately preempted it meaning discarded it and gave the CPU to the task with hard deadlines had the program not been there God knows what could have happened now you know how important rtos is but what all to study to master RTO concentrate on processes and threads different scheduling algorithms semop Force context switching memory management kernel Concepts inters and ISR and how they 100 you can Master Os from nisso Academy concentrate more on the about topics and then the best way to learn rtos is from free rtos website just hop onto their website and you will find everything there start with rtos fundamentals and then hop onto their build your first project section there are just three source files and one microcontroller specific file download these source files and follow the instructions it is given very clearly it will teach you things in real time I'll give both the links for free arts in the description below also you can use Kar which is a realtime scheduling simulator you can schedule your tasks with different scheduling algorithms and simulate it in real time I'll also add the link on how to install Kar in the description below for book you can refer to realtime systems by jws Le third the next topic is digital electronics all the processors we use today use digital Concepts to understand a processor in depth you need to know the basics like logical G GES flipflops counters and fsms it helps you understand what's exactly happening on your chip as a fresher you definitely have to master it to clear your first rounds of written test you can practice digital from this practice PDF I'll share the important topics and resources to study with this practice PDF in the description below fourth the next topic to master is computer architecture to use any processor you need to know how it's working from the inside you need to know the architecture to be a better programmer mainly focus on Cache Concepts like hit and Miss cache coherence and different cache mapping techniques for computer architecture you can refer niss Academy for Basics and Professor smyr lectures for book you can refer to computer architecture by pater and heny 851 and 86 are mostly covered in your syllabus and it is actually good to get started then explore risky architecture but how to choose a microcontroller to start with the basic flow is mostly the same across all the microcontrollers you can use ardino to make a projects to start with it is definitely good for beginners but not for people who are comfortable with embeded because of all the inbu libraries it has it makes it very easy for a fresher but as you go on you start taking things for granted and will never be able to write efficient codes so once you are level one or level two in aided you can use di MSP 430 family controllers and after that you can explore arm mclass microcontrollers like stdm 32 whatever microcontroller you use keep this in mind using GPI pins handling interrupts timers and using converters like ADC and D knowing interface protocols mainly uart i2c and SPI coming to embedded in different worlds to understand this let's take an example of arm-based controller the hardware chip here is made by a Semiconductor Company this chip is used in automative Aerospace and other consumer electronics Industry embedded engineers in these industries are understandable they use this chip to develop a system around it but what do embeded engineers in semiconductor industry do see once the chip is manufactured and if it has any Benchmark degradation or any other bug you can do nothing about it you will have to go back and do your chip design again and then again manufacture it this obviously costs a lot of time and money so what they do is even before the chip is made which is the pre-silicon phase embedded Engineers write firmware and emulate if it is working as expected and if there is any problem they immediately inform it to the vlsi engineers also once the chip is made you cannot simply give it to your customers you will have to develop some low-level drivers like your bootloaders and device drivers and then test the chip for its basic functionalities this is called a bring up face to be an embedded engineer in the semiconductor industry you will have to have a very good knowledge of computer architecture and be thorough with cache Concepts also you will be developing boot loaders so you have to have knowledge about smly language as well you can watch this video I have explained everything about boot loaders and embedded systems from scratch then you need to learn device drivers coming to the projects and tools first start with simple LED blinking and then interface a motor and control the speed of the motor using PW don't use any inbu library to start with write everything from scratch then add sensors like a PR sensor and learn interrupts like you can dim the LED on interrupt then use timers in your code once you're comfortable with all of this check this PDF for project list level wise coming to the tools this tool is just amazing qmu it emulates the hardware for you without needing any physical boot like you can take an arm mclass board like stm32 and load your LED blinking code and control the inbuilt LED on the board and simulate it real time without any physical Hardware you can also get a debugger to debug you basically get GDB integration here you can emulate all your Arm based boards like stm32 and as we discussed earlier you can use free OS and Kar for scheduling your tasks in real time I'll share all the tools in the description below finally coming to the skills I think every invited engineer should have these skills for sure writing efficieny codes and being comfortable with pointers and bit manipulations ability to go through the data sheets knowing the communication protocols at least art ITC and SPI knowing basics of electronics digital and basics of analog and network Theory being comfortable with Linux based systems also check out this video to know more about embedded systems if you have come till here you definitely have the best plan to prepare for embeded make sure to share this video with all your friends interested in embeded also check check out the Discord chip cam Community Link in the description below see you in the next one [Music]