Cortex M0+, M1, M3, M4, M7

These are all built as supersets of M0. They keep adding more hardware, support more instructions, more debug support, and hence resulting in larger size and higher power. The only exception is M0+ which is actually smallest microcontroller of all of M0 family.

 



Cortex M0+ (ARMv6-M):

Cortex M0+ is an optimized superset of the Cortex-M0, and is still based on ARMv6-M. The Cortex-M0+ has complete instruction set compatibility with the Cortex-M0 thus allowing the use of the same compiler and debug tools (so compilers etc still refer to arch as Cortex-M0) . The Cortex-M0+ pipeline was reduced from 3 to 2 stages, which lowers the power usage. In addition to debug features in the existing Cortex-M0, a silicon option can be added to the Cortex-M0+ called the Micro Trace Buffer (MTB) which provides a simple instruction trace buffer. The Cortex-M0+ also received Cortex-M3 and Cortex-M4 features, which can be added as silicon options, such as the Memory Protection unit (MPU) and the vector table relocation.

 


 

Cortex M1 (ARMv6-M):

The Cortex-M1 is an optimized core especially designed to be loaded into FPGA chips, and is still based on ARMv6-M. It brought back the 3 stage pipeline to improve performance.

 


 

Cortex M3 (ARMv7-M):

The Cortex-M3 is the first M processor based on ARMv7-M arch. It supports entire Thumbs1 and Thumbs2 ISA.

 


 

Cortex M4/M4F (ARMv7E-M):

Conceptually the Cortex-M4 is a Cortex-M3 plus DSP instructions, and optional floating-point unit (FPU). A core with an FPU is known as Cortex-M4F. It's based on ARMv7-M arch (or to be precise Enhanced version of v7 known as v7E)

 


 

Cortex M7/M7F (ARMv7E-M):

The Cortex-M7 is a high-performance core with almost double the power efficiency of the older Cortex-M4. It is like a modern processor featuring a 6-stage superscalar pipeline with branch prediction. A core with an FPU is known as Cortex-M7F. and is capable of single-precision and optionally double precision operations. The instruction and data buses have been enlarged to 64-bit wide over the previous 32-bit buses.

 

 

 

Digital Logic Design:

Here we'll cover some of the logic blocks that are used very frequently in RTL. We'll show code using Verilog. Some of the most common Logic elements are:

  • Logic Gates, flip-flops, i.e NAND, OR, LATCH, etc. These need a circuit diagram, and will be covered as analog part of digital
  • Clk gaters: These are also parrt of logic gates (available in librrary), but will be covered separately
  • Async Fifo => Very popular technique to transfer data from one clk domain to other clk domain

Asynchronous FIFO

This is such a popular interview topic and also a highly used component in design, that I'm having a separate section for this.

There are 2 very good papers on Async FIFO design by Clifford Cummings of SunBurst.

Add hand drawn diagrams

 

 

Version Control Software (VCS):

This refers to Version control (also known as Source Control, or Revision Control or Source Code manangement), where changes to a file or files is managed via a software called as "Version Control Software". In any modern software development, any program that we write goes thru changes over it's lifetime. If we didn't maintain a revision history of the changes, it would pose too many problems. Some of the common ones would be:

  • If the file accidently gets deleted or corrupted, our whole program is gone for ever, unless we kept backups. VCS. allows us to keep multiple backups at regular interval (either automated or manual).
  • With changes happening to our program, we want to keep a snapshot of changes, so that it's easy to revert to any previous state of the program. As an ex, if we have 5 files for a program, and we get it to work, we might want to keep a snapshot of this working program. Then we go ahead and make enhancements. If we create a bug, where the whole program now now refuses to even compile, one way is to debug it. But other easier way would be go to the snapshot and see what all changed. Or we can just restore the copy from snapshot and start from there. VCS allows us to do that.
  • With multiple people working on the same program, VCS allows us to easily merge all these changes in the central repository, without having to manually figure out all the changes and then integrating them.

Wiki: https://en.wikipedia.org/wiki/Version_control

Popular VCS are RCS, CVS, Git

Very good explanation of how VCS should work: https://tom.preston-werner.com/2009/05/19/the-git-parable.html

RCS:

 

VCS:

 

Git:

 

 

 

 

Force:

There are 4 fundamental forces or interactions in nature. All the motion that you see around as are due to forces. These forces may be friction, gravitation, push, etc. They ultimately belong to one of these 4 forces. It's easier to visualize these forces by considering a field, and then this field exerting forces. Force is always a vector as the effective force due to multiple forces is a vector sum of these forces. We are omitting the arrow sign on top of force for simplicity, but it should always be there to indicate it's a vector. The 4 fundamental forces or fields are:

  1. Gravitational force: This is attraction force due to mass of an object, and it's range is infinite. Newton's formula for gravitational force (published in 1686) gives us the formula for this:
    1. Newton's Gravitational Law: Force between 2 bodies of mass m1 and m2 as F = G*m1*m2/R^2, where G=Gravitational Constant of 6.674*10^-11 m^3/(kg*s^2). Here both F and R are vectors.
    2. Gravitation Field is defined as field due to presence of mass M and is given as g = F/m = G*M/R^2. The other mass is removed in eqn here, as F =m*g where g is the Gravitation Field due to mass M,
    3. The value of G wasn't determined at Newton's time. It was used to calculate forces relative to one another. It was in 1798 (>100 years later) that value of G was found out experimentally. It can be seen that this gravitational force is very weak (as G is a very small number), and is only relevant when at least one of the bodies is very large as moons, planets, stars, etc. What in the mass causes gravity or gravitational field is unknown. Even Newton hypothesized that cause of this power is unknown and contrary to sound science.
  2. Electromagnetic Force: This is the attractive or repulsive force due to charge. Look under "ElectroMagnetism" section.

 

Newtonian Laws:

 

Ex of force/work => To get an idea of how much 1N of force is, consider a 100g weight that you carry on your hand. That is 1N of force that you are applying to counteract earth's gravitational force. Now if ou lift it up by 1m, that's 1J of work that you did. So, 1N of force and 1J of force look like very small amounts, as your body doesn't feel any tiredness doing this.

 

Pressure: Pressure is Force per unit area. i.e P = F/A. SI unit of P is Pascal (Pa) which is 1N/m^2. 1 N is the force equiv to holding 100g of weight. This doesn't sound like too much weight. Now if we spread this weight over 1m^2, that's almost negligible Pressure. 100g of weight over 100cm*100cm = 0.01g/cm^2 of weight is 1 Pa. It's more convenient to use 1kPa (1 kilo pascal) or 1 bar (=100 kPa). 1kPa is 10g/cm^2, while 1 bar is 1kg/cm^2. Atmospheric pressure due to air is measured in atm (atmospheric pressure), where pressure at sea level is defined as 1 atm=101,325 Pa, which is ~1 bar (To be precise, 1 atm is slightly greater than 1 bar). Pressure is also measured in inches/mm of Mercury (Hg) where pressure at sea level = 760mm = 29.9 inches (approximated to 30 inches) = 1 atm pressure.

In USA, pressure is measured in pounds of force per square inch (psi)—for example, in car tires. 1 lb=453.6g => 1 lb force = 453.6g*9.8N/kg = 4.445N. So 1 psi = 4.45N/(0.0254)^2=6897.5N/m^2 = 6.9kPa. => 1 bar = 100/6.9=14.5 psi. So, 1 atm=14.7 psi. Pressure readings in excess of atmospheric pressure are usually more relevant in measurements, so we use psig (pounds per square inch gauge) in such cases. PSIG is measured relative to atm pressure, i.e 1 PSIG = 1 PSI - 14.7, so at sea level PSIG =0. PSI measures pressure relative to vacuum.

Barometer: Barometers are used to measure pressure. We take a tube closed at end end, and fill it with liquid as Mercury or water. Now, if we invert and immerse it in container of same liquid, then liquid inside the tube will rise until the point where pressure due to weight of liquid (+ any air/vapor pressure inside the tube in the empty space above the liquid) inside is same as pressure due to air outside. Mercury rises to 760 mm (or 2.5 ft), while water rises to 34 ft (since Hg is ~13,6 times denser than water). P = h*ρ*g.

In pressure gauges (usually in HVAC applications), pressure is usually shown as PSIG. In a barometer, if the air inside the tube is at atm pressure, then the mercury level will be at 0 inside the tube. But if the air inside the tube is in perfect vacuum, then the mercury will rise to 30 inches. We take these readings inverted to indicate relative pressure and indicate it as inch Hg Pressure, So a pressure reading of "0 in Hg" means the pressure is same as atmospheric pressure, while a "-30 in Hg" pressure means absolute 0 pressure. These can also be shown in bar as "0 bar" for 1 atm pressure and "-1 bar" for absolute 0 pressure. However, showing these on linear scale is hard, because we can never go to 0 vacuum. We keep on going down by a factor of 10 or something infinitely. So, a log scale is preferred in many gauges, where very precise measurement is required.

Micron unit: Since pressure becomes very low close to vacuum, we use another unit called micron in pressure gauges to indicate very low level of pressures. 1 mm Hg of pressure is divided into 1000 parts called microns. So, 1 micron pressure = 0.001 mm of Hg pressure.  At 1kPa (or 0.01 bar), water boils at 10C. We usually try to get to this vacuum level, when we want to get rid of moisture in any system (as at this pressure, liquid water will get converted to steam, and get sucked out via vacuum pump). 100 kPa = 760 mm of Hg, so 1kPa=7.6mm Hg or 7600 micron. As a thumb rule, going to 1% of atm pressure starts the process of water to boil at room temp. People in HVAC industry accept a pressure of 1000 micron or lower in order to guarantee that no water is present in the evacuated system. Usually 500 micros or lower is what people shoot for when vacuuming an HVAC system. These kind of low pressures can only be read by "micron gauge", which are very expensive ($200 for branded ones)

1 Pascal = 7 micron of Hg (implying 1 micron is extremely low pressure, since 1 Pascal is already too low of pressure)

1000 micron = 1 mm of Hg pressure = 0.02 psi

100K micron = 100 mm of Hg pressure = 2 psi or 0.1 atm (this is the highest pressure that a micron gauge will read, since it's designed to read vacuum pressure and NOT high pressure)

Link => https://vacaero.com/information-resources/vacuum-pump-technology-education-and-training/633-understanding-vacuum-measurement-units.html

Manometer: These are similar to Barometer, and are used to measure pressure of gases. Manometers are used in measuring blood pressure using device called a sphygmomanometer (Greek sphygmos = “pulse”).