We learnt about the different types of microcontrollers (MCUs), their selection and their various applications in previous chapter.
We will learn in this chapter about the architectures and on-chip resources in MCUs. The chapter describes the resources of memory, ports, DAC, PWM, ADC, timers and watchdog timers. It also describes the power-down mode. Details pertaining to individual MCU resources will be dealt with in later chapters.
The 8048 and 8049 microcontrollers are predecessors to 8051. Figure 2.1 shows a functional overview with the help of a block diagram of an exemplary 8048 microcomputer (microcontroller). Additional details of the basic processing unit are given in Section 2.3.1. Figure 2.2 shows the pin signals in an 8048 series microcomputer. Table 2.1 lists the pin signals. [Bar over a signal means that the signal activates when it is 0. For example, activates read when made 0 by the processor.]
Table 2.1 Signals at the Pins in 8048 and whether the Signal Input(I) or Output (O) Input and Output (I/O)
Figure 2.1 shows that the 8048 has the CPU, clock circuit (oscillator circuit), and reset circuit. This is similar to a microprocessor. There is control and sequencing logic. It functions and sends the signals as in a microprocessor. There are flags for the processor status as in a microprocessor. The parts of a basic processing circuit are as follows: RESET is the signal to reset the CPU when XTAL2 and XTAL1 are crystal oscillator inputs for the processor clock. IR is the instruction register, ID the instruction decoder, ACC the accumulator-latch and A the accumulator. Section 2.3.1 will explain basic processing unit in detail with the examples and refer Example 2.15 for the understanding of the meaning of multiplexing.
Sections other than CPU are as follows:
The 8048 microcontroller has the following sections:
Whenever AD0 to AD7 bus has the data signals, the signals at , and signals are used for selecting the external operations. When is active, then there is read from data memory. When is active, then there is write to data memory. When is active, then there is read from the program memory.
Harvard Architecture in Memory
Harvard architecture means that program memory and data memory are separate address spaces and accessed separately by different instructions and control signals. The 8048 can be interfaced to the program memory to store 216 bytes for the codes at addresses from 0000H to FFFFH. The 8048 can be interfaced to the data memory to store 216 bytes for the codes at addresses from 0000H to FFFFH.
pin—external address enable; it disables the external 1 kB addresses when it is made 1 and the on-chip ROM 1 kB is used in 8048. It enables when it is made 0 then an address of the external 64 kB memory from 0000H is used and internal ROM is then not used.
There are separate control signals to read the codes and data. These are and . When = 0, the code from a program-memory address is read and when = 0, the data from a data-memory address is read.
There is a separate control signal to write the data. When = 0, the data-bits are sent by the processor to a data-memory address when writing and using the external data memory between 0000H and FFFFH.
Program Counter
The 8048 has addressability of code-memoiy from 0000H to FFFFH for 216 bytes. Therefore, Program Counter (PC) is of 16 bits.
Figure 2.1 shows program counter in two registers: PCL— program counter lower byte, which has an out bus of 8-bits and when MCU is used in the single-chip mode, PCH—program counter higher byte register, which outputs only 2-bit and its 2-bit out bus to program memory in 8048 (Figure 2.1), 3-bit in 8049 and 4-bit in the 8050 as well as standard 8051/8052 families. This is because of on-chip program memories in 8048, 8049 and 8050/8051/8052 basic versions are 1 kB, 2 kB and 4 kB, respectively. PCH higher byte register outputs 8 bits, when an external memory is used.
Multiplexing of the Lower byte Bus for the Address and 8-bit Data Bus
The external data bus D0 to D7 multiplexes with A0 to A7 by multiplexing in 8048. A byte of code or data can be transferred at an instance. The time interval during which the address latch enable (ALE) is active (=1) P0 there is the address at the multiplexed bus. The time during which the ALE is inactive (= 0) there is data on the bus. Section 2.3.3 gives additional details about the ports.
Figure 2.4 Families of 68HC11/12/16 Series
A microcontroller family member has the same basic architecture, but can differ in the number of pins and the mode of packaging. Further, there are different variants as shown in Tables 1.1 and 1.2 for the 8051 and 68HC11/12 families. Figures 2.3 and 2.4 show the families of 8051 series and 68HC11/12/16 series and the resources in these. PIC and ARM microcontroller families will be described in Chapters 13 and 16, respectively.
Each microcontroller has a basic processing unit (Section 2.3.1) and has a number of resources.
The commonly present resources are as follows:
Additional Resources
Section 2.4 will describe the additional on-chip resources in next-generation microcontrollers.
Basic processing unit: Processing unit processes the instruction. It fetches, decodes, read operands, executes and writes back the results during processing an instruction. After each fetch of the instruction, the program counter sets for the next instruction. When one instruction is completed, the processing of other instruction begins.
Each microcontroller has a basic processing unit, which is similar to the one present in a microprocessor. The processing unit has the IR (instruction register) into which an instruction is fetched at an instant. It has an ID (instruction decoder), which decodes the fetched instruction. It sends internal signals for the control and sequencing logic.
There is the ALU (arithmetic and logic unit for arithmetic and logic operations) and the PSW (processor status word). The PSW saves the flags after each ALU operation. For example, it saves carry resulting from the addition instruction. It also saves the processor status, for example, what is the status of an interrupt, enabled or disabled.
The basic processing unit has an oscillator circuit or is connected to a crystal (X-TAL) oscillator circuit through two external pins. The oscillator unit controls the generation of the sequences of control signals by the control and sequencing logic.
The basic processing unit has an internal reset circuitry and is connected to an external reset circuit through the reset pin (Section 2.3.15). The reset unit controls the starting of the processor on power-up or actions of the RESET external input.
Internal buses: Most of the subunits inside a microprocessor or microcontroller are interconnected through a common set of parallel lines called the internal bus. An internal bus carries the signals (bits) from one internal subunit to another at an instant (Figure 1.4). At that instant, one subunit is active and gets the control signal to send (write) the signals onto the bus, and another subunit is also active and gets another control signal to receive (read) the signals from the bus. A control and sequencing logic subunit (Figure 2.1) activates different units and subunits at different instants.
Example 2.1
An internal bus with 8 lines carries 8 bits (byte) from an accumulator to the port P1 at an instant, if accumulator and port P1 get the write and read control inputs from the control and sequencing logic at that instant (Figure 2.1).
Example 2.2
Figure 2.1 shows the internal bus width in 8048 as equal to 8 for data. Registers and internal RAMs need only 8-bit addresses in 8048/8051. They save and give 8-bit data. The 8051 and 8096 families also have the 8-bit data bus. A control and sequencing logic unit activates different sections and subsections at different instants; therefore, the same 8-bit bus is used internally for carrying all the data, addresses and instructions (codes).
A bus width equal to 8 is sufficient because two operands are of 8 bit each only in an 8-bit MCU’s ALU. An 8 bit MCU can add or subtract 8-bit in an instruction.
The 8048 and 8051 are 8-bit MCUs. A 16-bit operation has to be performed in two separate instruction cycles and the 32-bit operation in four cycles.
Example 2.3
MC68HC11 internal 16-bit address-bus accesses in single cycle. The 8048/8051/8096 facilitates access only in two cycles.
External buses: Many units in a system, such as microprocessor or microcontroller, RAM and flash memory and IO devices are interconnected through a common set of parallel lines called the external bus. (Figures 1.1 to 1.3). There are three sets of external buses—control bus, address bus and data bus.
The buses carry the signals (bits) from one unit to another at an instant. At that instant, one unit is active and gets the control signal to send (write) the signals onto the bus and another unit gets another control signal to receive the signals from the bus. The control and sequencing logic subunit in microprocessor or microcontroller activates different units and subunits at different instants through the external signals on the control bus using the control and sequencing logic in the processing unit.
A data bus of 8 lines carries 8 bits (byte) from an accumulator in the controller to a RAM memory address at an instant, if the accumulator and RAM get the internal-read and external-write control inputs, respectively, from the control and sequencing logic.
Example 2.5
The external address bus width (A0 to A15) is 16 in 8048/8051 (through port P0 and P2 pins) as well as 68HC11 (through port PB and PC pins). Therefore, the external address space is 216 = 64 kB in these MCUs (1 kB memory = 1024 B).
Multiplexing of the Lower Byte Bus for the Address and 8-bit Data Bus Signals
External data bus D0 to D7 multiplexes with lower address bus A0 to A7 by multiplexing in 8048/8051 as well as 68HC11. Multiplexing means that in one instant the same bus lines function as data bus. In another instant, the same bus lines function as the lower address bus. A byte of code or data can be transferred at that instant. Figure 2.5 shows the timing diagram. The time interval during which the address latch enable (ALE) is active (=1), there is the address at bus. The time intervals during which the ALE is inactive (= 0), there can be the data on the bus [ALE is called ADV (address valid) in 68 HC11].
Figure 2.5 Timing Diagram in Case of Multiplexing of Lower Address Bus Signals A0 to A7 and Data Bus Signals D0 to D7
The external data bus width (D0 to D7) is 8. Therefore, since A0 to A7 eight lines multiplex with D0 to D7, the external address space is 216 = 64 kB. (1 kB memory conventionally means 1024 B.) The external data bus D0 to D7 multiplexes with A0 to A7 by multiplexing. Using a latch like 74LS373, the address bus signals can be latched using AD0-AD7, and the latch connects to the memory/port devices.
Example 2.6
The external data bus width can be optionally used as 8 or 16 in the 8096 series family. Either the address-bus lower-byte (A0 to A7) or address-bus lower and upper bytes (A0 to 15) multiplex with D0 to D7 or D0 to D15, respectively. The 16-bit operands are aligned in 8096. An alignment of operands means that the lower and higher bytes are at the even and next available odd addresses, respectively. [It can be viceversa in certain MCUs. It can be unaligned also in certain MCUs.]
Example 2.7
Figure 2.6 shows the buses and their widths in three series—8051, 68HC11 and 8096. ALU in the processing unit of these performs the 8, 8 and 16-bit operand operations, respectively, in a cycle. Instructions can perform operations on 1-bit, 8-bit and 16-bit operands in 8051 and 68HC11 and up to 32-bit operands in ARM and 8096. Each MCU has an internal bus of fixed width, which controls all the operations in an instruction cycle of the MCU.
Interrupt Handling
The basic processing unit has an interrupt handler subunit and connects to the external interrupt source(s) through the INTR pin. [ and pins in 8051]
A memory has a large number of addresses. Each address saves 1 B (8-bits). Assume the data bus width equal to 8 bits. Then at each address, 1 B is written at an instant. From each address, 1 B is read at another instant.
When the data bus width is equal to 32 bits and 1 word = 32 bits (4 B), then at four consecutive addresses, 4 B are written at an instant. From each set of four addresses, 4 B are read at another instant.
Memory Capacity in Bytes and Memory Addresses
Let us learn by two exemplary cases:
Case 1: If a memory chip has 12 address bus inputs A0 to A11, then it has 212 = 4096 B at 4096 addresses in address space from 0000 0000 0000 0000b to 0000 1111 1111 1111b i.e. (0000H to 0FFFH) when the chip selects in case the A12, A13, A14 and A15 are 0s.
Case 2: If memory has 12 address bus inputs A0 to A11, but the chip selects only when A12 = 0 and A13 = 1, A14 = 0 and A15 = 0, then the chip has 212 = 4096 B at 4096 addresses but at the address space from 0000 0010 0000 0000b to 0010 1111 1111 1111b, i.e. 2000H to 2FFFH.
Example 2.8
Assume at an instant the following situation:
A number or instruction or character or text, each is specified in terms of the binary bits in a system. A number or instruction or character or text is saved in the memory as the bytes with each byte at the distinct address. A microcontroller has separate memory spaces for the program (codes) and data, called code space and data space, respectively.
Program memory: Program memory can be on-chip and/or external in the MCU-based system. Program functions and routines in an MCU are mostly in a non-volatile read only memory (ROM). The program memory stores the read-only codes, constant input data and parameters of the programs. There is a separate address space for the program memory starting from the 0000H address in Harvard memory architecture in an MCU. Example 2.9 gives the exemplary contents in the program memory in a system. [Non-volatile means do not change on switching off of power.]
Example 2.9
Table 2.2 gives the exemplary contents at the program memory in the MCU-based systems
Table 2.2 Exemplary Contents in the Program Memory in a System
Memory | Exemplary contents | Preferred type of memory |
---|---|---|
Program memorya |
Program functions, routines, boot-up program and interrupt service routines for the system after the development phase is over. Standard macros and functions for program building block functions; for example, for preset delay, for UART communication at the pre-select baud rates; needed library functions, for example for finding maximum, minimum, average and standard deviation values of a set of values, for sorting the set of values in descending or ascending order. |
External or internal EPROM or Flash at laboratory test stages and on-chip masked ROM at the mass production stage. |
|
Permanent constants for the bytes for displaying the pictogram for the companies, emblem on LCD display; constants for maximum and minimum limits; for example, channels 0 to 99 in a TV remote control, number of maximum acceptable digits in the phone number when dialing. |
Internal EPROM or Flash at laboratory test stages or masked ROM at the mass production stage.b |
|
Strings for the product version, welcome messages at the start of the system, messages for system-status display, operational menus for selection (like in press 1 for measuring voltage, 2 for current, 3 for resistance and 4 for frequency in an MCU-based multimeter test equipment), name and contact addresses of the manufacturer. |
Internal EPROM or Flash at laboratory test stages or masked ROM at the mass production stage.b |
|
Modifiable and intermediate non-volatile data for the current values or results for the validity date of an account, password, and user ID and present balance in the account, data and time of last transaction, calibration constants of a sensor element or telephone numbers in a phone or contact numbers and addresses. |
Internal EEPROM or Flash.b |
a At common address space when architecture is Princeton and at separate address space(s) when it is the Harvard architecture.
b Off-chip values can also be at the data memory space at external EEPROM or Flash or EPROM.
ROM can be in the form of EPROM during a laboratory testing phase. For example, 8751 series member has the on-chip EPROM. The EPROM can be erased by exposing the chip to the UV light. EPROM chip has a quartz window, which is transparent to the UV All the bytes at all addresses can be erased in an erasing cycle of UV exposure.
Example 2.10
Philips P87C528 has EPROM version with 32 kB program memories (internal) 512 B internal RAM, no ADC, out-compare and capture circuits associated with the timer T2 and I2C Bus.
Flash Memory: Flash EEPROM (electrically erasable and electrically programmable ROM) is also referred to simply as flash. Flash can be erased by electrical signals.
Usually, an EEPROM erases 1 B at an instant. Flash EEPROM is when a sector consisting of many bytes (say, 1024 B or 2048 B or 4096 B) can be erased. All bits are made 1s by placing all floating gates of a sector together in place of each independently in EEPROM. However, sometimes flash is used for EEPROM that has the capacity to erase one or a few in a row byte in an instant.
Flash memory advantage is that it gives reprogramming feature in the MCU. Program codes can be repeatedly changed in flash memory when required and the changes are non-volatile. Another advantage is that a complete sector of memory addresses is erased and all bytes at that sector become 1111 1111b (FFH) in one cycle. A sector may be of the system 1 kB or 2 kB or 4 kB).
The contact details in a mobile phone are saved in the flash. These details can be changed when required.
A variant of flash is a boot mat flash. A sector (block) in boot mat flash is OTP (one time programmable). Boot-up program is one that runs on start up. Hence, the OTP sector of flash can be used in place of the ROM or EEPROM for the boot up of the system.
There is great technological advancement in flash designs like zero wait state 50 MHz. Nowadays, an 8 GB flash in a chip is available which can be inserted in a system. It is used in digital camera. A flash variant is a boot mat flash. 32 GB is going to be reality in near future.
Example 2.11
8951 series MCU has the flash. AT89xx is flesh memory based MCU. AT89C55WD has 32 kB flash internal program memory. AT89C51RC and 33AC have flash memory of 32K × 8, RAM 512×8 and 33MHz clock. 32K×8 means 32×1024 addresses and 8-bit at each address.
EEPROM: Figure 2.7 shows the types of EEPROMs. The read-cycle time of EEPROM or flash byte is the same as that in a RAM. An erase and write cycle time is high compared to read in 68HC11.
The 68HC11 has some interesting features. These are as follows:
EEPROM can be erased by electrical signals. EEPROM memory advantage is that the byte can erase and then be written again and the change is non-volatile. The changes can thus be made at the run time. Bytes can be repeatedly changed in EEPROM memory when required. Another advantage is that 1 or 2 or 4 or 16 or 64 memory addresses are erased in one cycle. Certain constants, for example, calibration constants of a sensor element can be in the EEPROM (electrically erasable and electrically programmable ROMs) (Table 2.2). These can be modified later. EEPROM bytes can be set online during execution of a program or by using the device programmer. The advantage of EEPROM is that it can be erased byte by byte before writing and can be used for non-volatile constants or intermediate status or result or the final result of a program.
EEPROMs are of the following types:
Example 2.12
MC68HC711L6 has 512 B RAM, 512 B EEPROM and 16kx8 EPROM as the on-chip memory. An erase and write cycle is 10 ms in 68HC11. The read cycle time of EEPROM or the flash byte is the same as that in a RAM. On-chip EEPROM can be used in three modes (each in one single cycle’s erase time) as per the mode bit in the configuration register.
Storing the Bytes for the Codes in the EPROM, EEPROM or Flash Memory
Device means the MCU (with on-chip memory) or EPROM chip or flash memory or CPLD. A laboratory device programming tool is used in case an MCU has the on-chip EPROM or flash, EPROM chip, flash, EEPROM or programming logic.
The programming tool consists of the hardware and software. The hardware has a socket for placing the erased EPROM or MCU on-chip PROM. The socket can also hold flash. The software takes a file for the codes as the input. When it runs, it burns the codes and constants into the MCU. Burning is the process to write and install the bytes at the predefined addresses as per the program(s) and its constants (Table 2.2).
Storing the Bytes for the Codes in the ROM
A ROM is in the form of masked ROM after the finally tested and approved phase. The 8351 series members have the ROM area in 8051 MCU. A ROM is factory programmed by first setting a mask. The mask sets 1s and 0s at the predefined addresses as per the program(s) and its constants. The ROM chip or ROM area in MCU has an unetched metal layer, which is etched as per the mask to get 1s and 0s as per the ROM image needed to be burned in the ROM in place of all 1s before the treatment at the manufacturer’s site. For mass production of the systems, ROM is the best alternative, and cost decreases with increase in the requirements. [ROM image means the bit pattern fixed for each ROM address.]
Data Memory: Data variables and stacks in an MCU are mostly in a volatile read and write memory (RAM) or registers. There is a separate address space for data memory starting from 0000H address when there is Harvard memory architecture in an MCU. Example 2.13 gives the exemplary contents in the data memory in a system.
Example 2.13
Table 2.3 gives the exemplary contents at the data memory. (Note that Table 2.2 referred to constants and strings not in internal on-chip program memory space that can also be at the data memory space.)
Table 2.3 Exemplary Contents at the Data Memory
Memory | Exemplary Contents | Preferred Type of Memory |
---|---|---|
Data memory |
Direct or indirect or both addressable bytes for the variables, pointers, look-up table, limited size array and individually addressable bits. |
On-chip RAM |
|
Stack of program counters and saved variables. |
|
|
Device (includes port) control parameters and status parameters and the device/port individually addressable bits. |
On-chip registers (special function registers in 8051 families) if available, else on-chip RAM |
|
Extended direct or indirectly addressable (or both; it depends on the MCU family) data for example, for the online large buffer, queues, pipes (for example printing and fax), file-data or network stream. |
External RAM |
Note:
MCUs mostly have on-chip program memory in the ROM or EPROM or flash and data memory in internal RAM and registers.
MCU has the internal RAM. The RAM is 64 B in 8048 and 128 B in 8049 and 8051. The RAM is 256 B in 8052.
Example 2.14
8051 family MCU has internal RAM between addresses 00H and 7FH. The internal RAM byte between these addresses can be directly addressed and can also be indirectly addressed.
8052 family MCU has internal RAM between addresses 00H and FFH. The internal RAM byte between the addresses 00H and 7FH can be directly addressed and can also be indirectly addressed. The internal RAM byte between the addresses 80H and FFH can only be indirectly addressed.
At a port in a shipyard, the ships are placed and sent. Similarly, at a port the bits are latched (placed) and sent to the processor or external device or circuit. When the bits are sent (placed) from an external circuit, the port is called the input port. When the bits are (placed) for an external circuit by the processor, the port is called the output port.
An input port has a set of pins using which the bits are placed by an external device or circuit and from where the bits are taken into a register or memory address using an instruction. An output port has a set of pins where bits are sent for the output using an instruction. An IO port is bidirectional input cum output and functions both ways.
There are two types of ports—parallel and serial. A parallel 8-bit port means all the 8 bits can be placed at all its pins simultaneously. A serial port means all the 8 bits of a byte or character can be placed at its pin in 8 time slots. The time interval AT for each slot is the same and depends on a preset bit-rate. For example, if the bit rate is 1 Mbps then each bit is sent or received in 1 μs time interval. If the rate is 9,600 then each bit is sent or received in (1/9,600) s. Sections 2.3.6 and 2.3.7 will describe the details of serial communication.
Figure 2.8 shows the different port-types. A microcontroller in a single-chip mode provides several ports at the chip itself. An MCU parallel port is of 8 bits. Sometimes the number of port bits becomes less. This is during the alternate use of certain pins. The number of port pins at the chip reduces when using the expanded mode (external chips) (Table 2.1).
Memory-mapped IO Operations
Instructions which operate using memory address are also used as the IO instruction and the control signals to I/O and memory devices are thus also the same. MCUs have memory-mapped I/O devices.
I/O devices on the chip share the same address space as the internal memory, and external I/O devices share the same address space as that with the external data memory. Hence, an MCU can interface with a large number of ports (theoretically as many as the address space permits). Telephone switching exchange is an example where there is need for a large number of ports.
Expansion to Several Number of Ports from a Few Ports in the MCUs
Multiplexing and de-multiplexing circuits also provide the expansion to more number of ports.
Port with a data direction register for programmability of each pin as in or out:
Usually, a port function either an I/O port or input port or output port and all the bits are used either as input or output at an instant. However, if an 8-bit port has a data direction register (DDR) of 8 bits, then each bit of the port can be programmed to function distinctly by specifying it as the input or output. The port pin direction is programmed by a reset or set of the corresponding bit at the DDR (Fig. 2.8.(c)). The 68HC11 family provides these features in a few ports. If DDR.0 and DDR.1 register bits are programmed as 0s and all other six bits of DDR are programmed as 1s using an instruction in 68HC11, then port pins 0 and 1 are programmed as input pins and the remaining port pins 2 to 7 are programmed as the output.
Example 2.15 gives the IO port pins in 8048/8051.
Figure 2.8 (a) An 8-bit IO Port; (b) An 8-bit Port with the Bus Buffer; (c) An 8-bit Port with Data Direction Register Bit for each Port Bit, which Sets to Either 1 or 0 (in 68HC11/12); (d) An 8-bit Port Analog as well as Digital Inputs for Either Multi-channel ADC or for Port Input Operations and (e) An 8-bit Port with Two Handshaking Signals—STAA for Strobe or Acknowledgement Signal between the External Device to Port and STAB from the Port to Device for Acknowledgement of Input or for Buffer Full Intimation
Example 2.15
Ports P0 and P2: There are two ports in 8048 and also in 8051—P0 and P2. P0 port has 8 pins—P0.7, P0.6, …, P0.1 and P0.0. P2 port has 8 pins—P2.7, P2.6, …, P2.1 and P2.0.
P0 pins P0.7 to P0.0 when accessing a program or a data external memory chip carries 8 signals at the pins as AD7, AD6, …, AD1 and AD0. It carries address signals—A7, A6, …, A1 and A0 when ALE (Address Latch Enable) pin signal = 1 (Active) else D7, D6, ., D1 and D0. ALE is given to a latch to latch the address bits for the memory.
P2 pins P2.7 to P2.0 when accessing a program or a data external memory chip carry the 8 address signals—A15, A14, …, A9 and A8.
Port P1: There is port P1 in 8048 and also in 8051. P1 port has 8 pins—P1.7, P1.6, …, P1.1 and P1.0.
Port P3: There is port P3 in 8051. P3 port has 8 pins—P1.7, P1.6, …, P1.1 and P1.0 in a single chip mode.
There are alternate uses of Port P3 pins. They are used for the following:
Example 2.16
Table 2.4 gives the examples of various types of the ports.
Table 2.4 Port Types in the MCU-based Systems
Port type | Example |
---|---|
8-bit port with latch for input or output or IO operations (Fig. 2.8(a)) |
Port P1 in 8048 and in 8051 classic family members |
8-bit port with latch as well as bus buffer for address, data, and control buses (Fig. 2.8(b)) |
(i) Port P0 and P2 in 8048 and in 8051 family members. The P0 is also usable as AD0-AD7 and P2 as A8-A15 bus. (ii) HC11 Port PB output port as well as A8-A15 bus. (iii) The HC11 Port PC for the I/O with handshaking mode also usable as AD0-AD7 in the expanded mode. |
8-bit port with data direction register (Fig. 2.8(c)) |
68HC11 Ports C and D |
8-bit input port with analog inputs capability (Fig 2.8(d)) |
68HC11 Port E (4-bits in certain versions) also function as analog inputs for multi-channel ADC; Port P0 in 8096 also functions as analog inputs. |
8-bit port with handshaking signals (Fig. 2.8(e)) |
68HC11 Port C is also usable in conjunction with the handshaking signals |
Open-drain port |
An open drain (OD) port needs external active (MOSFET or BJT transistor) or passive (resistive) pull up to output logic 1 |
Quasi bidirectional port |
An open drain (OD) port needs external pull up to output a logic 1, however, a quasi bidirectional port provides for 1 LSTTL gate-driving capability for few clock cycles so that in case of the use of the LSTTL latches, for example for interfacing the external memory chips, the external pull circuit is not needed |
General notes and instructions for using the parallel ports are as follows:
Important point to note is that an MCU has a few parallel ports usually, 8 bits each. Port bits are also put to the alternate uses. The external buses to the interfacing chips are also required. The port pins are also used for that.
An MCU has several on-chip registers. Registers are needed in the register addressing instructions and for the operands in the arithmetic and logic operations. Advantage of the registers is that a register can be addressed in an instruction by a few bits. For example, assume that there are 8-registers. Then bits 000 specify register R0, 001 specify R1, … and 111 R7. Therefore the add instruction code ADD R1, R2 needs only 6-bits for the operands R1 and R2. When 2 bits are required for add operation code, the instruction length is just 8-bit.
Example 2.17
8051 has 32 on-chip registers. These are partitioned into four sets of register banks. There are two bits called resister-set select bits in PSW called RS0 and RS1.
Assume RS1-RS0 = 10 and instruction MOV A, R4 executes. Then after executing this instruction the A gets the byte from bank 2’s register R4. Instruction will also have only 8 bits, 5 bits to specify opcode for MOV and operand A. A and 3 bits 100 to specify operand R4.
An MCU can have several registers, which are used for special functions. 8051 has registers for special functions. These registers are called SFRs (special function registers). The SFRs are used for following purposes in 8051:
A special function register can be used for other purposes also. This depends on the MCU:
Example 2.18
8051 has four special function registers (SFRs) called P0, P1, P2 and P3. These are used both as the output and input ports. Instruction MOVP1, R1 will output the byte at R1 to parallel port P1. Instruction MOVR1, P1 will receive the byte at P1 and place it at R1. The R1 will be of the register bank, which RS1-RS0 specifies.
Example 2.19
When a byte is transmitted as a serial data output, a transmit buffer is required. From the buffer, all the 8 bits of a byte or character can be placed at a pin in 8 or 10 or 11 time slots. It will depend on the serial communication mode for transmission. When a byte is received as serial data input, a receive buffer is required. At the buffer, all the 8-bits of a byte or character can be received at a pin in 8 or 10 or 11 timeslots. It will depend on the serial communication mode for reception.
8051 has a special function register (SFR) called SBUF. It is used both as a transmit-serial-buffer and receive-serial-buffer. Instruction MOV SBUF, A will transmit the byte at A serially using SBUF. Instruction MOV A, SBUF will receive the byte serially using SBUF and place it at A.
The serial-line device is present in most MCUs, because the serial port is needed to communicate with many external and remote devices. In serial communication, a stream of 1s and 0s is sent or received at successive time intervals of ΔT on a single line called the serial line. There is a transmit buffer, which is present with the byte for serial transmission. There is a receive buffer, which receives the byte during serial reception.
Example 2.20
8051 has a special function register (SFR) called SBUF. It is used both as a transmit-serial-buffer and receive-serial buffer.
An internal transmit clock is used during transmission, and internal receiver clock is used during the reception of the bits. The internal clock generates pulses of 1s and 0s. There is a fixed time interval, which is kept between successive logic 1s and 0s. The time interval ΔT between successive 1s or 0s depends on the decided bit rate for serial communication between the transmitter and receiver. The reciprocal of this time interval ΔT is the bit rate of the serial communication.
UART: (Universal Asynchronous Receiver and Transmission) is a very popular mode of serial communication. The transmission and reception in UART mode is asynchronous. The successive bytes are sent and received at the serial line such that there may be variable time gap between the bytes. Also the transmitter and receiver clocks must be of the same rate but they are independent (need not be in same phase or in synchronisation). Such transmission is also called asynchronous serial communication.
Example 2.21
Figure 2.9(a) shows the UART communication format for 8-bits 10010001.
This mode communication is as follows:
Figure 2.9 (a) UART Communication Formats for 8 Bits = 10010001 and (b) Synchronous Serial Communication for 10010001
The additional bit in 11T format is a bit next to the 8 data bits and before the stop bit. It is useful as follows:
8051 has a special function register (SFR) called SBUF. It is used both as a transmit-serial-buffer and receiver. 8051 and many MCUs have an UART device in two formats, 10T and 11T, with a programmable baud rate for the asynchronous serial communication. Modes 1, 2 and 3 of serial interface in 8051 are for asynchronous serial UART communication. Section 3.6.2 will describe it in detail. There may be two UART devices also in an MCU.
MCUs can possess a synchronous serial line. It also accompanies a synchronizing clock. This facilitates external and remote inter-processor transfer of bytes at a faster rate. Figure 2.9 (b) shows an exemplary format during synchronous serial communication.
Example 2.22
The mode 0 of communication is as follows in 8051:
Example 2.23
Mode 0 of serial interface in 8051 is synchronous serial. 8051 has a pair of pins for its serial interface (SI). These pins are used as Serial data out and serial clock at the master (transmitting) system. These pins are used as Serial data in and serial clock in at the slave (receiver) system. Section 3.6.1 will describe it in detail.
Timers are a must for real-time operations in any system (Chapter 6). Figure 2.10 shows the important - modes of functioning in timers.
Figure 2.10(a) shows a timer with internal clock and pre-scalar. The function of this timer mode can be understood by the following example.
Example 2.24
8051 family MCU has two programmable timers, T0 and T1. The 8052 variants of the family have an additional timer T2.
Example 2.25
Assume that a microcontroller timer has pulses from internal clock as input and the pulses time interval between successive 1 or 0s = ΔT. Assume ΔTclock = 1 μs. There is an 8-bit timer register TL0. When Timer TL0 runs then it can increment up to 1111 1111b and then on the next input pulse, the TL0 will become 0000 0000b0. It means that TL0 will overflow. An overflow indicates timeout. It generates an internal interrupt. It can be called the TL0 interrupt.
Assume TL0 is loaded with a value = 64d = 40H = 0100 0000b. When TL0 runs, it gets internal clock pulses after every ΔTclock = 1 μs (when the pre-scaling factor p=1). The TL0 when runs will reach the overflow state after (256 − 64) μs = 192 μs.
When the pre-scaling factor is 32, TL0 gets input after every 32 × ΔTclock = 32 μs (when the prescaling factor p = 1). The TL0 when runs will reach the overflow state after (256 − 64) × 32 μs = 192 × 32 μs = 6.144 ms.
If TL0 is preloaded with value = 0d, then it will overflow after every (256 − 0) × 32 μs = 256 × 32 = 8.192 ms.
Example 2.26
Assume that a microcontroller timer/counter in place of internal clock pulses is given input from a circuit sending pulses on every 2 degree rotation of a wheel. There is an 8-bit timer register TL0.
Assume it is reset to value = 00d = 00H = 0000 0000b before the beginning of the rotation. The TL0 is then set to run. It gets pulses after every 2 degree rotation. It counts up to a maximum of 256 counts and after 255 counts, when counts = 256, the counter overflows and causes an interrupt.
If TL0 is preloaded with value = 40d, then it will overflow after every (256 − 64) = 192 counts:
A timer can be used in different modes (Figure 2.10(b)).
Example 2.27
8096 family MCU has two programmable timers, T1 and T2. T1 facilitates the high-speed input unit. 8096 captures the time instances into a FIFO and records up to eight events in quick succession. 8096 also facilitates the high-speed outputs (HSO). The HSO unit is loaded with the preset instances of the timer. The unit compares the time instances with the preset time instances and initiates the HSO actions. The HSO unit compares up to 16 instances in quick succession.
Example 2.28
68HC11/12 family has main timer, which is a free-running counter (FRC). The FRC timer is used for the input captures, real-time clock and out compare modes described above. Motorola family MCUs has a powerful unit for real-time processing. It is called a timer processing unit (TPU). The 68HC16 TPU consists of a microprogrammed control unit, control memory and a library of more than 20 different timing functions. This facilitates the fast real-time controls. This is because of the separate instruction processing unit which is used in processing the capture operations and compare operations with the timers.
An MCU version may have one or more pulse width modulated outputs (PWMs). PWM output is one in which the width percentage is proportional to the value loaded in a special function register which loads the modulation parameter p. Assume T is time interval between two successive clock inputs used for generating the PWM output. Figure 2.11(a) shows the continuous pulses at the PWM output.
Figure 2.11 (a) PWM Output; (b) Analog Outputs in Two Cases as a Function of Pulse Width Percentage and Pulse Control Register Parameter p; and (c) Circuit for the Application of the MCU for Pulse Width Modulation Using Pulse Count and Control Register
The pulse width percentage is (100)(256–p)/256, where p is the modulation parameter in an 8-bit pulsecontrol register PCNT. When p = 0 the width = 100% and when p = 255, the width = 1%. If there are six PWM outputs provided in the MCU, then there will be six pulse control registers PCNT0, …, PCNT5.
Example 2.29
Assume that an 8-bit timer/counter is accumulating counts up to 28 (=256) using an internal clock of time-period T = 1 μs in an MCU continuously. There is continuous comparison of these counts with p. There is an internal circuit such that on overflow of counts the PWM pin becomes 0 and when counts becomes equal to p, then the output at PWM pin = 1.
The output is 0 for the duration p × 1 μs and 1 for the duration (256 − p) ×1 μs. Total pulse time-period of the pulses at PWM pin = 256 μs. Since the counts are being accumulated continuously, there will be continuous pulses of duration proportional to (256 – p).
On-Chip D/A (DAC) Using PWM
DAC stands for digital-to-analog conversion such that the analog current or voltage output relates linearly to the digital value (input). The PWM device with PWM control register, can be used as the DAC by installing an appropriate integrator that interfaces with the MCU.
Analog output is obtained when the PWM output is integrated by an integrator amplifier. The amplifier output has a linear relationship with the bits used for the modulation parameter p, which is programmed using an instruction of the MCU. An MCU stores p in the special register PCNT for the PWM function. When PWM output is input to an integrator amplifier, the p relates linearly to the analog voltage. Figure 2.11(b) shows analog outputs in two cases as a function of pulse width percentage and pulse controls register parameter.
PWM is used to obtain the digital-to-analog conversion (DAC) operation as follows. The DAC operation is needed in many control-related operations. For example, DC motor control and heater current controls.
Case 1: It is assumed that the integrator-1 design is such that the output v is maximum when p = 255 and is 0 when p = 0.
Case 2: It is assumed that the integrator-2 design is such that the output v is maximum when p = 255 and is − v when p = 0.
Circuit for PWM
(i) Continuously running timer with pre-load disable and stop disabled, (ii) PWM register and (iii) a comparator is present in the PWM circuit in the MCU. Figure 2.11(c) shows the circuit for the PWM application of the MCU. It uses a pulse count and control register for the pulse width modulation. This is assuming that there is an 8-bit internal PWM output control register, PWM_CONTROL. Software can write p at its address in the MCU. Let a counter run in a free-running mode and the count value be c at an instant. A PWM output will be obtained by an operation in which at the port bit or PWM output pin the output is 1 when c > = p, and 0 when c < p.
Many times, a microcontroller has an on-chip A/D (called ADC also) conversion feature. This is an important feature in the control applications. Figure 2.12 shows an MCU with an on-chip ADC. The ADC starts conversion on each negative going pulse.
The ADC does successive conversions on successive start of conversion pulses. An ADC may have programmable options for reference V
The ADC functioning can be explained by the following example.
Example 2.30
Assume a 10-bit ADC in an MCU. There are 1024 (= 210) values between 0000000000 and 111111111. Assume positive reference Voltage = 5 V and negative reference voltage = 0 V.
ADC Applications
The ADC operation is needed in many control-related operations. It is needed when are reading the analog voltage from a sensor or transducer or analog input in the instrument for measuring the following: ECG waveform or temperature or pressure or position of a moving shaft by an LVDT (linear voltage differential transducer) or relative humidity or weight using a load cell or DC motor speed control speed or heater temperature current control.
Sample/Hold Amplifier in the ADC Circuit
Consider a case in which a microcontroller has an ADC device. The ADC is fed a certain signal (input analog voltage) v through an amplifier. The amplifier is called S/ (sample and hold) amplifier. The amplifier first samples the signal for a certain period (~ 1 μs) and then holds it for the required time. Sampling the signal outputs the average v after a certain period. The S/ amplifier holds v unchanged during the conversion period. The amplifier has a control signal. S/ control input = 1 when sampling and 0 when holding.
S/ amplifier thus gives the value close to the true value. This is because the random noises in the sampling period get canceled during averaging. S/ amplifier analog output is converted on a start of conversion signal.
ADC Circuit Output
The digital bits after the conversion map to the signal ratio [v / (V+ref − V−ref)], the converted bits can be latched at a port in the MCU or used for control applications. Here, V+ref and V−ref are the reference analog inputs to the ADC, set such that when v = V+ref with all output bits equal to 1 and v = V+ref with all output bits equal to 0. Mapping means the output bits b0, b1, …, bn−1 are such that the decimal values of these are proportional to the signal ratio. These ADC device bits b0, b1, …, bn−1 are stored in a register. A program can make it available the port for use by the external circuit. The circuit generates at constant programmed intervals, these bits may be updated.
The watchdog timer is a timing device that resets the system after a pre-defined timeout. WDT resets and then the further processing is (i ) either from the same address as at the beginning on the power-up (for example, in 8051) or (ii) as per the bytes at a vector address in certain MCU timeouts of the WDT (for example, in 68HC11). Most microcontroller variants of an MCU family have on-chip watchdog timer.
WDT Application
WDT has many applications. It rescues the system if a fault develops in between. An example is when a program hangs due to an interfaced circuit fault. Another example is a loop not finishing in a control program due to an exceptional condition. WDT comes to the rescue in such situation by resetting the program. On restarting, the system is expected to function normally.
Watchdog Timer Circuit
Figure 2.13 shows the working of a non-stop timer/counter used as a watchdog timer. The watchdog timer is usually programmable for the timeout period. Program counter loads on WDT timeout a value equal to one that was on power-up or that which loads on reset of the processor.
Figure 2.14 shows the various bit transfer or manipulation instructions. The 8051 family MCU has a powerful bit manipulation capability and has a bit manipulation capability with the carry bit (flag) playing the role of an accumulator of one bit. The C flag can be set or reset. A port bit can be set, reset, complemented, transferred or logically operated. The bit can perform these operations in bit-address space of the 8051.
Figure 2.14 Bit Manipulation Operations by a Boolean Processing Unit in 8051 Family
An MCU-based system may be designed such that it need not be switched off at any time. In this case the processor runs in the power-down mode. The MCU initiates certain actions on execution of the WAIT and STOP instructions. The stop state can also occur when clock inputs to a processor stop ticking or the program has been designed such that it shuts down the processor automatically. During the stop state the MCU disconnects external devices, and the internal clock circuit is deactivated. The battery-backed RAM activates and protects the protected area. When there is an external interrupt or reset, the MCU reactivates and forgoes the stop state.
An execution of STOP instruction can be enabled or disabled by a bit in a configuration set register in certain MCUs.
Example 2.31
The 8051 MCU provides a power-down mode bit for serial communication. The bit-transfer rate can be slowed by half, so that power is saved during communication from the MCU.
An MCU is said to have a real-time clock device if it can make or have one of the timer non-stop and no reset and load-disabled state and the interrupts from this timer, once enabled, are not disabled later. The timer overflow interrupts now act like a clock that ticks at regular intervals. Timer overflow means transition from all its 1s to all 0s output state. If the timer does not stop, it repeatedly interrupts at constant intervals and it gets inputs from an internal clock continuously after appropriate scaling by a certain factor. Scaling here means division by a factor, say, 2, 4, 16 or 64. The word, real time is used because time never stops and cannot be reset. Figure 2.15 shows the actions of a real-time clock device.
Real-time clock is an important resource in a microcontroller because using this an OS sets the system clock, schedules the tasks and time-delay functions. It is an on-chip device made from the timer working in non-reset, non-loadable and non-stop mode. The interrupts from this timer are the realtime clock ticks, which also update the time information at certain memory address.
Example 2.32
Assume that there is a 16-bit time running non-stop and no reset and load-disabled state. Assume a clock input after every 1 μs. When pre-scaling factor = 32 the timer gets input every 32 μs. It will timeout after every 32 × 216 = 2.097152 s. Real-time clock interrupts (ticks) occur every 2.097152 s.
Certain processors start like 8051MCU processing from 0x0000 (0xFFFF0 in 80x86). The start address on reset is programmable in certain MCUs. Certain processors start from an address as per the bytes programmed earlier at a fixed memory location. A reset circuit or device resets the microcontroller so that a processor starts smoothly. This means that the processing of instructions from a starting address is prevented during the intermediate voltages to the MCU. All the processor registers and devices and interfaced devices get the default values. Reset circuit when activated forces a processor to start the processing of instructions from a starting address smoothly, which means without glitches—sharp variations between low voltage and needed voltage.
Figure 2.15 The Actions of a Real-time Clock Device
Reset input activates just for a few clock cycles. Value of V at reset pin becomes identical to one expected after a +5V powerup or after external reset circuit input after these cycles. The reset pin V connects to other peripheral devices. This enables their reset also.
Example 2.34
68HC11/12 starts processing from the address defined by the bytes programmed at 0xFFFE (called vector address for the reset). The MCUs 68HC11 and HC12 have two start-up addresses. One is as per power-up reset vector address 0xFFFE bytes and the other is as per reset vector at 0xFFFC bytes. The latter is for start after the Reset instruction executes or after a time-out from a watchdog timer occurs.
A push-button switch may also be interfaced with MCU through the reset circuit to start the processor from the beginning start-up address. When there is a power glitch, the processor reset circuit should let the processor start smoothly from the beginning and prevent the intermediate voltage levels. In addition, when a clock monitor detects the MCU slowdown below certain frequencies due to a fault, then also the reset must activate.
The reset circuit activates for a few clock cycles and then deactivates to let the MCU processor start executing the instructions.
There is a reset pin (Table 2.1) in the MCU. It becomes input on power-up and becomes output pin for a few clock cycles to enforce the reset state in other interfaced external devices with the system. The pin finally deactivates after the program execution begins.
The reset circuit (Figure. 2.16) can be made using an external IC circuit like MAX 6314 and Motorola MC 34064. Note that on reset, not only the program counter reloads but also the default processor values reload.
Oscillator is required for generating internal states and clock pulses. 8051 usually uses 11.052 MHz or 12 MHz. X-Tal. A circuit is shown in Figure 2.17(a). If an internal clock generator is used then an internal capacitor is used, Figure 2.17(b) shows circuit when internal clock generator is used.
Figure 2.16 Reset Circuit
Advanced MCUs have ALUs in their arithmetic logic unit (ALU) the multiplier and accumulate subunit, floating point processing subunit, assembly optimizer and C compiler.
An MCU can have the CAN module (CAN means a network with a bus called control area network bus). An MCU can have the USB module (USB means a network with a bus called Universal Serial Bus).
MCU can have 6 to 12 PWM Channels for multi-channel analog outputs.
There can be communication I/F, 8 or 16 HPI (host port interface), 6 or more external DMA channels support, two or more standard serial ports, time-division multiplexed serial ports, multi-channel and bidirectional serial ports.
There can be a special port that has analog input and output with the CODECs. CODEC is used in telecommunication. It is a unit for digital PCM coding by ADC and other operations and decoding of analog signals by DAC and other operations at the output and input, respectively.
Example 2.35
μPSD MCU has the following resources:
Next-generation MCUs (Chapter 16) based on ARM have the 32-bit RISC processor core with CISC instruction set and on-chip compilation unit. These have super scaling multi-stage integer pipeline (s). They have multi-entry write buffers. This avoids blocking (waiting) of the processor during the external memory writes. The 0.13 foundry processes deliver 350 MHz to 500+ MHz and over 1 GHz on next-generation 0.1 μm processors. ARM 11-based family MCUs have the instructions sets, which give reduced code densities. It has the ARM DSP extensions and SIMD media-processing extensions.
8048family: A microcontroller on which 8051 families of microcontrollers were introduced later.
ADC: An analog input converted to digital bits, whose decimal value maps the input with respect to a reference voltage input.
Address bus: A bus to carry the address for the memory and devices externally interfaced to an MCU or CPU.
Baud rate: Rate by which the bits are sent in an UART.
Bit transfer: A bit paced at one address from another address.
Bus width: Number of lines in the bus. An 8-bit bus carries 1 byte data in a single cycle.
CAN: Controller area network—a bus for the networked embedded systems; it is mostly used in the automobile and control systems.
Clock circuit: A circuit to generate the clock pulse to synchronize all the operations in the system.
CODEC: A unit for the coding for the analog input for the line output and decoding of the line input to retrieve the analog input for a voice or music or analog communication.
Counter: A digital circuit to count the input pulses.
DAC: A unit for obtaining analog output using the digital bit at an input or at a register.
Data bus: A bus to carry the data bits or code bits.
Data direction register: A register in which each bit can be programmed to set each bit at a parallel port as input or output after the programming.
Data memory: A separate memory with address space separate from the program memory.
EEPROM: Electrically erasable electrically programmable read-only memory.
Erase: A process that makes all bits as the 1s. Free-running counter: A counter in non-reset, nonstop and non-loadable state, which timeouts at regular intervals and interrupts on successive overflows.
Flash: A memory with an additional feature over EEPROM in which a sector(s) of byte can be erased simultaneously using the floating gates technology.
Handshaking: A mechanism by which firstly two signals communicate and then a port sends the latched byte or strobes the byte into it.
Input capture: A mechanism by which a time register captures from a running timer the instances ofthe events at an input pin or at another device and there is interrupt on each capture.
Instruction decoder: A decoding unit attached to the instruction register, which stores the code just before execution. The unit initiates the “controller and sequencer” actions to execute the code.
Integrator: A circuit based on OPAMP and resistor and capacitors to integrate the input up to a certain time. If its input is PWM output of an MCU, it implements the DAC operation.
Inter-processor communication: A communication (serial synchronous) between two systems.
Internal bus: A bus to carry data byte(s) or code(s) at an instance from one structural unit of MCU to another.
Internal RAM: A RAM internally available in the MCU for the registers and/or data variables and stack.
Interrupt mask: A register where a bit can be set or reset to enable or disable a maskable source of interrupt from the devices or external sources.
Interrupt source: A hardware or software related event, which interrupts the foreground program to enable execution of a service routine called the interrupt service routine.
Interrupt mechanism: A mechanism by which the interrupting sources are serviced in an MCU or CPU.
IO devices: The devices or ports to latch the bits for further processing by the MCU during input or to accept the latched bits from the bus for sending output.
kbps: Kilo bits per second—a unit to express the rates of bits transferred on a serial line.
Keyboard: A unit that provides interaction to a user when using a computing system. Laboratory device programmer: A unit to program the on-chip and off-chip CPLDs, EPROMs, EEPROMS and flashes.
Masked ROM : A ROM ready to finally install in the system after undergoing a process to fabricate a mask as per the program and then etch the unetched metal layers in the ROM memory unit.
Latch: A circuit to set the state of output according to the input state which was there during the period when the clock/control input was active.
LCD display: A liquid crystal-based one line or multiline display.
Open drain port: A port with each bit needing external passive or active pull up when interfacing it. It must also be written 1s before using the same as an input port.
Out compare: A mechanism by which a register called out-compare register compares the contents with a running timer and can generate interrupt(s) or output(s) at each successful comparison.
Parallel port: An addressable multibit unit, which can latch the bits after processing for the output and which can strobe the bits and latch before processing.
Power-down mode: A mode in which the processor deactivates the clocking unit and sleeps by a stop instruction or by an autoshutdown program and from which the processor can wake up again on interrupt; it saves power and only standby RAM is delivered power during the stop.
Pre-scaling: A process, for example, in a unit to divide and set the input pulse rates for a timer. Prescaling factor can be prefixed in the MCU or may be programmable in the MCU.
Priority assignment: A mechanism to program the priority of servicing among the multiple interrupt sources.
Program counter: A CPU register to hold the address of byte(s) for the instruction for fetch from memory.
Programmable timer: A timer whose functions can be programmed in an MCU.
Pulse width modulation (PWM): A unit to give pulse output with width percentage mapped to the available digital or analog input or to get a desired analog output from the bits in a register.
Real-time clock: A clock continously ticking and interrupting the system and used for the real-time control in the system.
Reset circuit: A ciruit that brings the CPU and associated units to the start-up state.
ROM image: A finalized program, constants and strings data, which is placed in the ROM of the system.
Sample-hold amplifier: An amplifier to sample the input for a fixed period so that the output is stable for the hold period. It is usually used with the ADC to let the analog input be noise free and stable during ADC operation of converting into the bits.
Serial asynchronous communication: A serial stream of bits in which the bytes or frames do not maintain the constant phase difference. The UART mode communication is also an asynchronous serial.
Serial synchronous communication: A serial stream of bits in which the bytes or frames maintain constant phase difference.
STOP instruction: An instruction which executes when it should enable execution in an MCU and which on execution brings the processor to a sleep state by deactivating application of the clock to the CPU units and which permits only standby power dissipation.
Timer: A device to increment when the input clock pulses are applied to it after suitable scaling. It interrupts on timeout(s), which occur on its overflow(s). It functions as counter when clock pulses are not used but external circuits give the input pulses for counting those pulses.
Timer processor unit: A unit to process the timing operation-related instructions.
UART: An asynchronous serial communication mode in which the start bit has 1 to 0 transition to begin with, then sends the data bits and then the stop bit. Before the stop bit there may be an additional bit for special use like checking the parity.
Watchdog timer: A timer, which once set, prevents the processor from hanging in a loop or waiting state and brings the processor to the restart state. [Hang up means not able to come to end due to endless wait.]
where n is the number of times it overflows after the first overflow.