Home Tech Microcontroller – A blend of Software and Hardware (part 2)

Microcontroller – A blend of Software and Hardware (part 2)

Microcontroller – A blend of Software and Hardware (part 2)

Why do we have many different Microcontrollers?

Like there are so many different car manufacturers, Toyota, Honda, Mercedes and so on, so also are many manufacturers of microcontrollers. After the idea of having a programmable device, many electronics manufacturers took the idea to develop their own chip. The internal architecture therefore differs among the manufacturers in a little ways. So learning one microcontroller facilitates learning the other. Moreover the same company manufactures many different microcontrollers, which are all almost compatible. In electronics, the requirements of projects vary; for example to make a security device, you need little memory, whereas to make a data logger you need lots of memory.

 

A remote control will not need to display data on LCD, so needs lesser number of I/O lines, whereas an industrial control unit will need to display its data, and therefore needs more I/O lines. A calculator needs only digital input, whereas a temperature controller needs to acquire analog data. These differences in requirements, makes the manufacturers produce different microcontrollers with different memory size, number of I/O lines and number of integrated peripheral devices. Otherwise they are all similar to use. Again, if you have mastered one microcontroller, it’s easy to migrate to another. So the type of microcontroller to be used in a given project will be determined by the exact requirements.

Tekedia Mini-MBA edition 16 (Feb 10 – May 3, 2025) opens registrations; register today for early bird discounts.

Tekedia AI in Business Masterclass opens registrations here.

Join Tekedia Capital Syndicate and invest in Africa’s finest startups here.

 

Microprocessor vs. Microcontroller

Essentially these two devices are similar, but with a little bit of difference. The microcontroller contains the same main elements as any computer system:

• Central processing unit (CPU)

• Memory

• Input/Output

 

In a PC, these are provided as separate chips, linked together via bus connections on board, but under the control of the microprocessor (CPU). A bus is a set of lines which carry data in parallel form which are shared by the peripheral devices. The PC can be modified to suit a particular application, by changing the type of CPU, size of memory and selection of input/output (I/O) devices tailored to the system requirements. A microcontroller on the other hand will contain, the CPU, RAM, ROM, Timers, I/O etc. all packed within one integrated circuit. This facilitates the development process, as well as reduces the requirements of external components. In microcontroller, you cannot change the number and type of integrated devices. This means that the MCU for a particular application must be chosen to suit the application at the design level from the available range of microcontrollers. In any given circuit, the microcontroller has a single dedicated function in contrast to the PC that is multifunctional. Single task application in which microcontrollers are deployed is a type of system referred to as embedded system because they are often embedded in many devices.

 

Central processing unit (CPU)

In a microcontroller system, a CPU block is in charge of all input, output, calculations and control. This cannot operate without a program, which is a list of instructions that is held in memory. The program consists of a sequence of binary codes that are fetched from memory by the CPU in sequence, and executed. The instructions are stored in numbered memory locations, and copied to an instruction register in the CPU via the data bus. Decoding the instruction is a hardware process, using a block of logic gates to set up the control lines of the processor unit, and fetching the instructions.

 

Memory

There are two types of memory: volatile and non-volatile. Volatile memory loses its data when switched off, but can be written by the CPU to store current data; this is RAM (Random Access Memory). ROM (Read Only Memory) is non-volatile, and retains its data when switched off. In a microcontroller, we have Electrically Erasable Programmable Read Only Memory (EEPROM) which is used in storing data during power down; for example, a security code or combination for an electronic lock. The ideal memory is non-volatile, read and write, fast, large and cheap. Unfortunately, it does not exist! The main trade-off is cost, size and speed of access. Flash ROM, as used in memory sticks and MP3 players, is closest to the ideal, having the advantages of being non-volatile and rewritable. This is why it is used as program memory in microcontrollers which need to be reprogrammed.

 

Input and Output

In microcontrollers, ports (input and output) are based on a data register, and set of control registers, which pass the data in and out in a controlled manner, often according to a standard protocol (method of communication). There are two main types of port: parallel and serial. In a parallel port, the data is usually transferred in and out 8 bits at a time, while in the serial port it is transmitted 1 bit at a time on a single line.

 

Existing microcontrollers in the world market today? Next series (Part 3)

 

No posts to display

Post Comment

Please enter your comment!
Please enter your name here