During Embedded Programming Week, we delved into various aspects crucial for understanding microcontrollers, analyzing their datasheets, and comparing performance and development workflows across different architectures. This documentation encapsulates our learnings from this intensive learning period.
- Understanding the data sheets of microcontrollers.
- Compare the performance and development workflows for other architectures.
The Von Neumann architecture was first proposed by a computer scientist John von Neumann. In this architecture, one data path or bus exists for both instruction and data. As a result, the CPU does one operation at a time. It either fetches an instruction from memory, or performs read/write operation on data. So an instruction fetch and a data operation cannot occur simultaneously, sharing a common bus.
Von-Neumann architecture supports simple hardware. It allows the use of a single, sequential memory. Today's processing speeds vastly outpace memory access times, and we employ a very fast but small amount of memory (cache) local to the processor.
The Harvard architecture offers separate storage and signal buses for instructions and data. This architecture has data storage entirely contained within the CPU, and there is no access to the instruction storage as data. Computers have separate memory areas for program instructions and data using internal data buses, allowing simultaneous access to both instructions and data.
Programs needed to be loaded by an operator; the processor could not boot itself. In a Harvard architecture, there is no need to make the two memories share properties.
RISC and CISC are two different types of computer architectures that are used to design the microprocessors that are found in computers. The fundamental difference between RISC and CISC is that RISC (Reduced Instruction Set Computer) includes simple instructions and takes one cycle, while the CISC (Complex Instruction Set Computer) includes complex instructions and takes multiple cycles.
What is RISC?
In the RISC architecture, the instruction set of the computer system is simplified to reduce the execution time. RISC architecture has a small set of instructions that generally includes register-to-register operations.
The RISC architecture uses comparatively a simple instruction format that is easy to decode. The instruction length can be fixed and aligned to word boundaries. RISC processors can execute only one instruction per clock cycle.
What is CISC?
The CISC architecture comprises a complex instruction set. A CISC processor has a variable-length instruction format. In this processor architecture, the instructions that require register operands can take only two bytes.
In a CISC processor architecture, the instructions which require two memory addresses can take five bytes to comprise the complete instruction code. Therefore, in a CISC processor, the execution of instructions may take a varying number of clock cycles. The CISC processor also provides direct manipulation of operands that are stored in the memory.
The primary objective of the CISC processor architecture is to support a single machine instruction for each statement that is written in a high-level programming language.
CISC architectures have a large, complex instruction set and a less efficient execution pipeline. This allows CISC processors to perform a wider range of tasks, but they are not as fast as RISC processors when executing instructions.
As its name implies, it is a processing device that converts data into information based on some sets of instructions. It is a very compact electronic chip due to which it is referred to as the microprocessor.
In other words, a processing device implemented on a single chip is called a microprocessor. A microprocessor is the most crucial component of a computer or any other computing device. Because, it is entirely responsible for processing data based on instructions to produce information.
In microcomputers, the microprocessor is used as the CPU (Central Processing Unit). A typical microprocessor consists of two major parts namely ALU (Arithmetic Logic Unit) and CU (Control Unit). Intel 8085 or 8086 processing chips are the examples of microprocessors.
Modern microprocessors consist of a small memory unit (cache memory) in addition to the ALU and CU. Now−a−days, microprocessors are being widely used in several applications such as desktop publishing, power plant control, multimeters, medical instruments, etc.
A microcontroller is an electronic system which consists of a processing element, a small memory (RAM, ROM, EPROM), I/O ports, etc. on a single chip. Therefore, a microcontroller is a tiny resemblance of a microcomputer. It is a quite small and low−cost electronic device which is used in several electronic appliances as the main functioning device.
In electronic systems such washing machines, air conditioners, refrigerators, etc., microcontrollers are used to automate the operation of the device based on user’s instructions. Hence, a microcontroller is the backbone of all embedded systems like microwave oven, washing machine, smart refrigerators, etc.
Microprocessors find their application in light sensing and controlling devices, temperature sensing and controlling devices, fire detection and other safety devices, smart measuring instruments, etc.
Arduino is a microcontroller-based platform that consists of open-source hardware, software, and programming tools. The concept of the Arduino ecosystem revolves around simplicity, making microcontrollers more accessible to the general public and great educational aids.
Arduino was created in 2003 by a group of academics at the Interaction Design Institute Ivrea in Italy. The platform was named after a bar in the same town where the academics met to discuss the project. One of the project's goals was to remove the barrier of entry for students who wanted to realize automation ideas but did not have enough resources to purchase expensive controllers or knowledge to build their printed circuit boards.
Microcontroller : ATmega328
Operating Voltage : 5V
Input Voltage (recommended) : 7-12V
Input Voltage (limits) : 6-20V
Digital I/O Pins : 14 (of which 6 provide PWM output)
Analog Input Pins : 6
DC Current per I/O Pin : 40 mA
DC Current for 3.3V Pin : 50 mA
Flash Memory : 32 KB of which 0.5 KB used by bootloader
SRAM : 2 KB
EEPROM : 1 KB
Clock Speed : 16 MHz
Length : 68.6 mm
Width : 53.4 mm
Weight : 25 g
Arduino Uno is open‐source hardware! You can build your own board using the
following files:
EAGLE FILES IN .ZIP
SCHEMATICS IN .PDF
BOARD SIZE IN .DXF
The Arduino Mega 2560 is a microcontroller board based on the ATmega2560 (datasheet). It has 54 digital input/output pins (of which 14 can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. The Mega is compatible with most shields designed for the Arduino Duemilanove or Diecimila. The Mega 2560 is an update to the Arduino Mega, which it replaces.
Microcontroller : ATmega2560
Operating Voltage : 5V
Input Voltage (recommended) : 7-12V
Input Voltage (limits) : 6-20V
Digital I/O Pins : 54 (of which 14 provide PWM output)
Analog Input Pins : 16
DC Current per I/O Pin : 40 mA
DC Current for 3.3V Pin : 50 mA
Flash Memory : 256 KB of which 8 KB used by bootloader
SRAM : 8 KB
EEPROM : 4 KB
Clock Speed : 16 MHz
EAGLE FILES IN .ZIP
SCHEMATICS IN .PDF
ESP32 is a series of low-cost, low-power system on a chip microcontrollers with integrated Wi-Fi and dual-mode Bluetooth. The ESP32 series employs either a Tensilica Xtensa LX6 microprocessor in both dual-core and single-core variations, Xtensa LX7 dual-core microprocessor or a single-core RISC-V microprocessor and includes built-in antenna switches, RF balun, power amplifier, low-noise receive amplifier, filters, and power-management modules. ESP32 is created and developed by Espressif Systems, a Chinese company based in Shanghai, and is manufactured by TSMC using their 40 nm process. It is a successor to the ESP8266 microcontroller.
Microcontroller : ESP32-WROOM-32
Clock Speed (MHz) : Up to 240
Operating Voltage (V) : 3.3 (2.2-3.6)
Analog Input Pins : 12
Digital I/O Pins : 32
DC Current per Pin (mA) : Varies (up to 6)
Flash Memory (KB) : 4096
SRAM Memory (KB) : 320
Wireless Connectivity : Wi-Fi & Bluetooth
USB Interface : Yes
Development Environment : Arduino IDE/ESP-IDF
Community Support : Moderate
Price (USD) : 10-15
The ESP32-C3 is a relatively new addition to the Espressif Systems product line, with its development and initial launch happening in 2022. It's still evolving with new variants, suggesting continued efforts to establish its position in the microcontroller market.
Wi-Fi
• IEEE 802.11b/g/n-compliant
• Supports 20 MHz, 40 MHz bandwidth in 2.4 GHz band
• 1T1R mode with data rate up to 150 Mbps
• Wi-Fi Multimedia (WMM)
• TX/RX A-MPDU, TX/RX A-MSDU
• Immediate Block ACK
• Fragmentation and defragmentation
• Transmit opportunity (TXOP)
• Automatic Beacon monitoring (hardware TSF)
• 4 × virtual Wi-Fi interfaces
• Simultaneous support for Infrastructure BSS in Station mode, SoftAP mode, Station + SoftAP mode, and
promiscuous mode
Note that when ESP32-C3 scans in Station mode, the SoftAP channel will change along with the Station
channel
• Antenna diversity
• 802.11mc FTM
Bluetooth®
• Bluetooth LE: Bluetooth 5, Bluetooth mesh
• High power mode (20 dBm)
• Speed: 125 Kbps, 500 Kbps, 1 Mbps, 2 Mbps
• Advertising extensions
• Multiple advertisement sets
• Channel selection algorithm #2
• Internal co-existence mechanism between Wi-Fi and Bluetooth to share the same antenna
CPU and Memory
• 32-bit RISC-V single-core processor, up to 160 MHz
• CoreMark® score:
– 1 core at 160 MHz: 407.22 CoreMark; 2.55 CoreMark/MHz
• 384 KB ROM
• 400 KB SRAM (16 KB for cache)
• 8 KB SRAM in RTC
• In-package flash
• SPI, Dual SPI, Quad SPI, and QPI interfaces that allow connection to multiple off-package flash
• Access to flash accelerated by cache
• Supports flash in-Circuit Programming (ICP)
Advanced Peripheral Interfaces
• 22 or 16 programmable GPIOs
• Digital interfaces:
– 3 × SPI
– 2 × UART
– 1 × I2C
– 1 × I2S
– Remote control peripheral, with 2 transmit channels and 2 receive channels
– LED PWM controller, with up to 6 channels
– Full-speed USB Serial/JTAG controller
– General DMA controller (GDMA), with 3 transmit channels and 3 receive channels
– 1 × TWAI® controller compatible with ISO 11898-1 (CAN Specification 2.0)
• Analog interfaces:
– 2 × 12-bit SAR ADCs, up to 6 channels
– 1 × temperature sensor
• Timers:
– 2 × 54-bit general-purpose timers
– 3 × digital watchdog timers
– 1 × analog watchdog timer
– 1 × 52-bit system timer
Power Management
• Fine-resolution power control through a selection of clock frequency, duty cycle, Wi-Fi operating modes,
and individual power control of internal components
• Four power modes designed for typical scenarios: Active, Modem-sleep, Light-sleep, Deep-sleep
• Power consumption in Deep-sleep mode is 5 µA
• RTC memory remains powered on in Deep-sleep mode
Security
• Secure boot - permission control on accessing internal and external memory
• Flash encryption - memory encryption and decryption
• 4096-bit OTP, up to 1792 bits for users
• Cryptographic hardware acceleration:
– AES-128/256 (FIPS PUB 197)
– SHA Accelerator (FIPS PUB 180-4)
– RSA Accelerator
– Random Number Generator (RNG)
– HMAC
– Digital signature
RF Module
• Antenna switches, RF balun, power amplifier, low-noise receive amplifier
• Up to +21 dBm of power for an 802.11b transmission
• Up to +20 dBm of power for an 802.11n transmission
• Up to -105 dBm of sensitivity for Bluetooth LE receiver (125 Kbps)
The Xiao RP2040 is a small and versatile microcontroller board that is well-suited for a variety of projects, from simple experiments to more complex applications.
Processor: Dual-core ARM Cortex M0+ processor, running up to 133 MHz
Memory: 264KB of SRAM, 2MB of flash memory
I/O:
- 11 digital pins (with 11 PWM pins)
- 4 analog pins
- 1 I2C interface
- 1 UART interface
- 1 SPI interface
Other features:
- USB Type-C for power and programming
- User-programmable RGB LED
- Onboard LEDs for power and status
- Breadboard-friendly design
- Supports Arduino, MicroPython, and CircuitPython
1. Arduino Uno and Mega are classic boards known for their ease of use and large user base.
2. ESP Wroom 32 offers built-in Wi-Fi and Bluetooth connectivity, making it ideal for IoT projects.
3. ESP C3 is a newer, low-power option from Espressif Systems with lower cost.
4. Xiao RP2040 is a compact and affordable board based on the powerful RP2040 dual-core microcontroller.
5. The choice between these boards depends on your specific project requirements, such as processing power, connectivity needs, budget, and familiarity with the development environment.