This is an old revision of the document!


Introduction to the IoT Microcontrollers

[ktokarz][✓ ktokarz, 2023-08-23]Describe in general IoT MCUs: CPU, FPU, RAM, Storage (flash), GPIO, Interrupts system, DMA, built-in radio interfaces (if any).

IoT device is, in almost all cases, based on microcontroller. A microcontroller, often called a single-chip computer, is an integrated circuit that incorporates all units required to function as the computer. It includes a central processing unit (CPU), memory for programs, memory for data, inputs, outputs, timers, serial communication ports and other peripherals. Complex microcontrollers, called embedded processors, can include more processor cores, display controllers, advanced internal data transfer mechanisms (like DMA), programmable connections between modules, specialized coprocessors for ciphering and deciphering, compression and decompression, video and audio coding and decoding, and other modules. Microcontrollers are even more complex in the IoT world due to wireless networking capability. A complex microcontroller equipped with an internal radio communication module is also known as a System on Chip (SoC).

Although many microcontrollers or SoCs are called processors, historically, the processor is the name of the element of the CPU functionality only. It must be connected to memory and peripherals to form a fully functional computer. On the other hand, a microcontroller, embedded processor or System on Chip can work without any external elements; it just requires the power supply to operate.

The typical microcontroller includes general-purpose units like:

  • CPU core,
  • Program memory,
  • Data memory,
  • Timers, Counters,
  • Interrupt controller,
  • I/O ports,
  • Serial synchronous and asynchronous communication ports,
  • Analog to Digital converter,
  • PWM (Pulse width Modulation unit for Digital to Analog conversion),
  • DMA controller,
  • Supervisory units (Watchdog, Reset, Brownout).

Embedded Processor or System on Chip can contain also:

  • Network interface,
  • USB controller,
  • Memory interface module,
  • Floating point unit (FPU),
  • Cryptographic module,
  • Other application-specific extensions.

The CPU core is the unit that executes the main program. It controls program flow, executes general-purpose instructions, calculates addresses, and processes integer values. For fast floating point calculations, an FPU coprocessor is built-in. It executes instructions that perform calculations on real numbers and advanced mathematical functions. The program instructions are fetched from program memory, usually implemented as internal or external flash memory. Data is stored in internal data memory implemented as static RAM. If more memory is needed, some microcontrollers have a memory management unit that allows them to connect external DRAM memory. Flash memory is often used as a place for file storage. Timers and counters are units that help to generate pulses of specified length and square signals of specified frequency. They can also measure delays and synchronise the work of other modules like serial ports, converters, and displays. Timers can generate pulse width modulated signals to control the speed of motors and light brightness. Microcontrollers have digital input and output ports to connect other elements of the systems. Connecting external sensors to collect information from the surroundings and output devices to manipulate environmental parameters is possible. Analogue inputs can read the voltage value generated by simple sensors. Serial communication ports are used to connect more complex sensors and displays to communicate with the user or another computer system. An interrupt controller is a unit that automatically executes subroutines responsible for handling tasks specific to the hardware that signalled the situation that needs the processor's attention. The processor doesn’t have to waste execution time by periodically checking if there is a need to take care of the device. It helps to make the code more efficient and reliable. Supervisory units help to recover from some abnormal situations. Watchdog resets the processor in case the software hangs up. Brownout detector constantly monitors the power supply voltage. It stops the processor if the voltage is too low for proper operation to avoid execution errors, flash write errors, and other malfunctions. Supervisory interfaces like JTAG allow writing the programs into flash memory and debugging the code. Direct Memory Access (DMA) module performs memory operations without processor intervention. It is usually used for copying data blocks between memory and other peripheral units. For example, data from the network unit is stored automatically in the buffer, and the CPU is informed while the data transfer is complete.

Details of the internal construction and operation of many internal modules of popular microcontrollers are described in further chapters of this book.

en/iot-open/iotmicrocontrollers2.1693216462.txt.gz · Last modified: 2023/08/28 09:54 by 127.0.0.1
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0