BLE Embedded MCU's IoT STM32 MCU's STM32WB55 Tech

Introduction to STM32WB55

Table of Contents

About STMicroelectronics

STM32WB55STMicroelectronics is a leading provider of semiconductor solutions that are seamlessly integrated into billions of electronic devices used by people worldwide on a daily basis.

The semiconductor company builds products, solutions, and ecosystems that enable smarter mobility, more efficient power and energy management, and the wide-scale deployment of the Internet of Things and connectivity technologies. To know more about STMicroelectronics refer to its website: www.st.com.

Going back in history, ST was formed in 1987 by the merger of two government-owned semiconductor companies: Italian SGS Microelettronica (where SGS stands for Società Generale Semiconduttori, “Semiconductors’ General Company”), and French Thomson Semiconductors, the semiconductor arm of Thomson.

In this blog, we are going to start with ST IoT-based Nucleo Board STm32WB55.

What is STM32WB Series all about?

The STM32WB55xx and STM32WB35xx are advanced multiprotocol wireless devices that boast ultra-low-power consumption. These devices are equipped with a powerful and efficient radio that is compliant with the Bluetooth® Low Energy SIG specification 5 and IEEE 802.15.4-2011 (Zigbee). Additionally, they feature a dedicated Arm® Cortex®-M0+ processor that handles all real-time low-layer operations.STM32WB55

These cutting-edge devices are perfect for a wide range of applications that require reliable and efficient wireless communication. Whether you’re working on a smart home project, a wearable device, or an industrial automation system, the STM32WB55xx and STM32WB35xx are the ideal choices.

STM32WB55
Applications of STM32WB55

With their advanced features and capabilities, these devices are sure to revolutionize the way we think about wireless communication. So why wait? Start exploring the possibilities today and discover what the STM32WB55xx and STM32WB35xx can do for you!

STM32WB55
STM32WB Series

The devices have been meticulously crafted to operate on minimal power and are built around the high-performance Arm® Cortex®-M4 32-bit RISC core, which can operate at a frequency of up to 64 MHz. This core boasts a Floating-point unit (FPU) single precision that supports all Arm® single-precision data-processing instructions and data types. Additionally, it is equipped with a full set of DSP instructions and a memory protection unit (MPU) that enhances application security.STM32WB55

These devices have been designed with the utmost care and attention to detail, ensuring that they are not only efficient but also highly effective. The Arm® Cortex®-M4 32-bit RISC core is a powerful tool that enables these devices to perform at an exceptional level, while the FPU single precision and DSP instructions provide unparalleled accuracy and precision. Furthermore, the memory protection unit (MPU) ensures that your applications are secure and protected from any potential threats.

Enhanced inter-processor communication is provided by the IPCC with six bidirectional channels. The HSEM provides hardware semaphores used to share common resources between the two processors.

The devices embed high-speed memories (up to 1 Mbyte of flash memory for STM32WB55xx, up to 512 Kbytes for STM32WB35xx, up to 256 Kbytes of SRAM for STM32WB55xx, 96 Kbytes for STM32WB35xx), a Quad-SPI flash memory interface (available on all packages) and an extensive range of enhanced I/Os and peripherals. 

About STM32WB55

REFERENCES

What is Microcontroller Technology?

Brief history of Microcontroller Microcontroller is an innovative technology that has revolutionize the world and made the electronic items so much feasible for us. Though microcontrollers have been in world since 1960’s. Its been around 60 years since the invention of Microcontroller technology and their are more then x amount of microcontroller being deployed right now in world. Lets explore and go back to history of microcontroller’s: What are Microcontrollers is an electronic chip which is designed in a way to do general tasks till eternity The life cycle of Microcontroller’s Microcontroller is designed from transistors, millions and millions and even billions of transistors are minitirised into small size, to form building blocks of MCU, and these building blocks give them ability to control anything. The building blocks of MCU are: CPU, Memory and Peripherals. We will dive into these blocks after couple of minutes. The designing of these transistors is an art and science behind the chip designing. This art of technology is called as VLSI( Very Large Scale Integration). And Once the designing is done then these Chips are fabricated/manufactured to give us a final by product that is physical MCU chip. And This part is done by fabrication companies like TSMC. And after that fabrication, the packaging/assemble of integrated chip happens so that these millions and millions of transistors which are minitiasuered are enabled for practical usage in electronic devices. And after that programming on these MCU and extra circuietry around these MCU’s is developed to make the MCU do any specific task till eternity. These part are referred as Embedded Systems, in which software and hardware arounf the microcontroller is developed to make it use in final end product. Part of Software development for Microcontrolleris called Embedded Software Development and part of Hardware development for MCU is called Embedded Hardware Development. In this video and cahpter we will just get ourselves stick to microcontroller technology, and focus on what things are involved for learning and using microcontroller. Though their are many topics and technologies which can be deep dive, which we will do in separate videos. Building blocks of Microcontroller chip are Microcontroller chips have 3 building block, first is CPU, second is Memory and third is peripherals. For better understanding take the analogy of microcontroller with human body. Just like their is human body, same way their is microcontroller. In human body we have brain which does all the processing, calculations and thinking. In the case of microcontroller, CPU does all that. Then in human body we have body parts to interact with outside world, same way microcontroller have different peripherals to interact with outside world. We humans have memory/yadash based on which we do the work and do the tasks. How to sit, how to walk, how to use legs, how to use different body parents, and all these things are feed in our memory, same way microcontrollers have memory, into which instructions are written on how to use its different peripherals and how to control those peripherals and what to do when some data comes from those peripherals. Now lets just deep dive into these functional blocks in more technical understadning and learning. CPU CPU stands for Central Processing Unit, it is an integral part of microcontroller which does all the hardcore computing work. computing work in terms of electronic chip means: addition, subtraction, multiplication, division of electronic data. How fast this can be done and level of complex calculations it can do. CPU does the computing work, by a set of basic rules on how a CPU should work. These set of rules are called as Instruction Set Architecture(ISA). Their are 2 most popular types of ISA: RISC( Reduced Instruction Set Computer) CISC(Complex Instruction Set Computer) In Current modern world, RISC architecture based CPUs and microcontroller are what is widely used and adaptoped. Examples of RISC is ARM CPU that we see in Apple MAC book the M1 chip. another example is RISC-5 CPU, that we can see in Vega processor, which is Indias first indegenoious CPU designed by xyz organization Examples of CISC is Intel 4004, which is world’s first commercially avialable CPU launched in 1971. Another is x86 CPU, most desktops and laptops sold are based on x86 CPU. Ther terminology which we hear intel I5 processor and all they all are part os these CPU’s. Often CPU word/terminology is used interchanagible with processor or core. So whereever we mention, processor/core or CPU words they mean same thing. Another important factor on which CPU computing work matters is bit size of CPU. Meaning how much size of data CPU can execute at a time. We measure this thing in bits unit. So their are 8 bits, 16 bits and 32 bits CPU’s. In Which 8 bit CPU means it can at a time can execute data of 8 bit length. 16 and 32 bit CPU means they can execute data of 16 bit and 32 bit length. Now as the bit size of CPU increases, it means more pwoerfull and fast tehy are. For now we are not going too much in detail about CPU types, history and its world as that will deviate us from current topic of microcontroller. We will explore in detail about these terminologies in what is microprocessor technology. Peripherals: Peripherals are body parts of Microcontroller, it is peripherals through which micrcontroller interacts with outside world. Their can be more then 20 peripherals in some MCU’s and in some MCU’s their can be just 5 peripherals. Their are some general purpose peripheral which are their in all or most of the MCU’s: which are GPIO, ADC, TIMERS, I2C, SPI, UART. Using these peripherals one can process and control any sensor/module connected to MCU. I2C, SPI and UART are communication protocol via which we can connect almost any sensor/module to MCU. Be it LCD screen, ethernet module, audio devices, wifi modules or any other sensor. And via GPIO, TIMER and ADC peripherals we can sample and

Read More »

FlexTimer peripheral of NXP S32K1xx MCU( S32K144 MCU and ElecronicsV3 Board)

About FlexTimer Peripheral of S32K144 MCU: What is FlexTIMER Peripheral? FlexTimer is a peripheral present in NXP S32K1xx MCU’s, which is used for input capture, output capture, generation of PWM signals and time delays. We are going to focus on PWM signals part and usecase of FTM Peripheral for generating PWM signals. As FTM is a peripheral of MCU, so it has intances and with each instance certain number of MCU pins which are referred as channels. In S32K144 their are 4 instances of FTM and each instance has 8 channels. Instances are abrievted as FTM0, FTM1, FTM2 and FTM3. Each Instance has its own Peripheral registers where the configuration of those instances is done.  Their are number of registers, in FTM peripheral through which its configuration for different features is done and we also get status. We are not going to dive into every register, will mention important registers, as in industry register level coding is not implemented but understanding of registers is what is important. Each Instance has 8 channels, which are reffered as CH0-CH7. So naming convection goes like this: Table showing FTM Instance and Then FTM Channels of that sinstance and all MCU pins which can be used for that channel. For PWM,  FTM Peripheral has following functnalities and features PWM Signal Type: Center Aligned and Edge Aligned PWM Signals: Combine Mode PWM signals in inverted/duplicate PWM Interrupts: Every channel has interrupt source. Interrupt can be generated on counter match or counter overflow. Detection of rising and failing edges of PWM signals: We can configure interrupt generation when counter matches or overflows based on the polaruty of PWM signal. Hardware-Software Trigger: Generation of PWM signals and variation of PWM parameters at the detection of some hardware specific events. Lets say we want to generate PWM pulse only when some ADC readings are taken. So we can configure PWM signal to generate when ADC hardware conversion si done. Fault control and synchronization points.  How FTM peripheral works is, For understanding the ftm peripheral features and functionalities we will understand them via storytelling!!! Story telling in terms of what steps have to be followed to use ftm peripheral and correspondingly covering its different features. We configure the clock values for ftm peripheral, that is whether the ftm peripheral is going to get clock from system clock, fixed clock or external clock and  also configures the prescaler values, to divide the ftm clock if needed. FTM CLOCK CONFIGURATION IS IMPORTANT step as based on this only, parameters of pwm signals are calculated. Their are 3 inputs of clocks for FTM peripheral: either system clock, or crystal oscillator clock( that is fixed clock) or some external clock ( connected to some pin of MCU). After that we configure in which mode FTM peripheral has to be used, whether input capture mode, output capture mode. Output capture mode is what we are going to use. Output capture mode means outputings some digital signals. And Input capture mode means inputting some digital signals. After output capture mode,  which type of pwm signal. These settings are done by setting the values of highlighted bits according to following table. These bits are part of these registers. Based on the mode of ftm peripheral, ftm peripheral will work. As in this module we are learning and focusing on pwm signals, so we highlighted sections of table is what is going to be of our concern.    Edge Aligned Mode Center Aligned Mode Combine Mode(Complementary) Each Instance has 8 channels, so every channel has its own peripheral registers by the name of CnSC. In CnSC register this pwm mode of configuration is done.  After that, we configure the values into counters of FTM. As stated Timer peripheral has 3 counters in it. MAX counter, Variable counter and Threshold counter. In FTM peripheral MAX counter is MOD peripheral register. Value put on this register determines the frequency /period of pwm signal. Variable register is COUNT peripheral register. This counter starts incrementing from 0 once ftm peripheral is enabled or triggered. Threshol Counter we will touch in couple of mins after. For each channel their is register CnV. This register act as Threshold counter for pwm signal coming from corresponding channel or we can say pin of mcu. Value put on this register will determine the duty cycle of the signal as when COUNT counter matches the value of this register, pwm signal state changes according to configured polarity. Now polarity of pwm channel will determine, whether pwm signal would have high to low transition or low to high transition on counter match. The polarity configuration is important as this will determine the duty cycle parameter. So there are 2 things in polarity, state of pwm signal before counter match and state of pwm signal after counter match. Based on polarity configuration, rising or failing edges would be generated on counter match and counter overflows. 6) Another important thing is updates of counter registers and pwm polarity. You see, counter registers like MOD, CnV and COUNT very much control the PWM signal parameters and PWM polarity register bits control the logic levels of pwm signal. Ftm peripheral has feature to configure when these register values should be updated, that is either on software trigger means software will write the Data on the registers and it would be loaded into them. Or hardware trigger that on detection of sone external signal, the values of these registers would be changed. This updation of register is also called as Reload point of counter registers and values in FTM peripheral. If we are using interrupts then interrupt configuration is also done for each indiviual channel for different events. By events we mean counter match or counter overfflow. For every channels of FTM Instance their are bits in x register, If we set these bits then interrupt functionaly would be on for those Channels. When Counter match happens then channel interrupt handlers are fired and when counter oveflow happens then overflow interrupt handler is fired. Overflow interrupt handler is comman

Read More »

PWM Driver of Autosar MCAL Layer

What is PWM Driver? PWM Driver is the library for generating PWM signals via Automotive MCU’s. This Driver is part of Autosar MCAL layer and it is global level RTD standard that is followed by all semiconductor companies to generate the PWM signals using their microcontrollers for automotive applications. This specification describes the API for generating and handling different PWM signals via automotive MCU’s. This software module includes GUI interface for initialization, configuration of PWM channels and peripheral instances. It supports the framework for using advance to basic features which are their with PWM peripherals of different MCU’s through which PWM signals are generated.. Also PWM Driver handles the variation of PWM parameters like  Frequency, Duty Cycle, Timer Period and etc. PWM Driver can handles all the advance features like fault control, synchronization points, hardware trigger, softare control values, complementary PWM signals, DMA/Interrupts for PWM signals. . PWM Driver is built over the peripheral IP layer of the Microcontroller and driving functionalities. Main objectives of this monolithic SPI Handler/Driver are to take the best of each microcontroller features and to allow implementation optimization depending on static configuration to fit as much as possible to ECU needs. Hence, this specification defines selectable levels of functionalities and configurable features to allow the design of a high scalable module that exploits the peculiarities of the microcontroller. What are PWM Signals and how are they generated? Types of PWM Signals: Parameters of PWM Signals: To generate the PWM signals via Automotive MCU’s using Autosar MCAL Layer API’s: At first to configure the MCU pins in PWM peripheral mode via PORT Driver: We can generate the PWM Signals from Microcontroller through different peripherals like Timer Peripheral of the MCU or FlexIO peripheral. So at first selection of MCU pin has to be done from which PWM signal has to be genarted and then configuring that MCU pin in corresponding peripheral mode. After that comes the clock selection and configuration via MCU Driver: MCU Driver is responsible for clock configurations and clock settings of Microcontroller. Setting of systems clock, peripehral clocks all these settings are done by MCU Driver. And for generating the PWM Signals, what clock frequency has been input to it is very crucuial so as to calculate its parameters. After this MCL Driver selection is also important: We can generate PWM signals from Microcontroller via different peripherals. Either Timer based peripheral or FlexIO peripheral. By tradation Timer peripheral is recommended and widely used. But as PWM Driver has been designed with global level coverage, it is also dependent on FlexIO peripheral, so FlexIO peripheral concentric files are generated via MCL Driver. So we will just select the MCL Driver, so that dependent files are included in project. In this course, we will focus on PWM signal generation via Timer peripheral. In our case we will be using NXP S32K144 MCU which has FlexTIMER Peripheral. After all above three will be coming our PWM Driver configuration and selection. That is what is the main moto of the course module. We will understand what all configurations are their in PWM Driver. How PWM Driver works and important API;s of it for generating the PWM Signals. Their would also be use of Platform Module, that is responsible for interrupt settings and configuration. We are going to use Interrupts with PWM Signals to detect the rising and failing edges of PWM signals and do some application specific tasks on those edges. Functional concepts of PWM Driver: Now PWM Driver has general/global functional concepts which are applicable to all automotive MCU’s, which are important to understand and know so as to configure the PWM Driver. Selection of PWM hardware channel: Selection of PWM Channel polarity Selection of PWM IDLE Mode Selection of PWM feature enablement: PWM Signal modes: Apart from the above general functional concepts, the PWM peripheral level concepts of the corresponding Micrcocontroller is also important to understand. These peripheral level functional concepts are different from one MCU to another. As their are different peripherals for generating PWM signals in different MCU’s. But the usage of these concepts is used only at the time of PWM GUI configuration. At the time of writing the embedded application, same set of API’s, chronology and parameters is used. In our case we have ElecronicsV3 Board, which has S32K144 MCU and we are using FlexTIMER peripheral of this MCU. Concepts description with respect to Author: Kunal Gupta

Read More »

FTM PWM Driver API’s of NXP S32K144 MCU

API Name: Ftm_Pwm_Ip_Init() void Ftm_Pwm_Ip_Init(uint8 Instance,const Ftm_Pwm_Ip_UserCfgType * UserCfg) Role: This API initializes the FTM peripheral according to PWM feature.  Author: Kunal Gupta

Read More »

SAR ADC Explained!

Why to learn about SAR ADC? SAR ADC is a standard AUTOSAR opts for. That’s why you see most of the automotive microcontrollers can be observed having SAR ADC and SAR stands for Successive Approximation Register. You can see the below picture which I extracted for verification of this fact. Microcontrollers which are verified: NXP S32K1xx Series NXP MPC5xxx Series STMicroelectronics SPC5 Series Renesas RH850 Series Infineon AURIX TC3xx Series Microchip PIC32 Series Why AUTOSAR likes SAR ADC over others? SAR ADC working is most suitable due to three major factors mentioned below: High Conversion Speed with Accuracy: SAR ADCs are fast to handle conversion like real-time sensor data conversion while holding its precision as it is. This conversion can be like throttle control, battery management, and other critical functions. Power Efficiency: Power consumption is one of the most important factors in any automotive application especially electric vehicles. SAR ADC consumes comparatively less power rather than ADC like FLASH ADC.  Scalability: SAR ADCs offer a trade-off between speed, resolution, and area, which is crucial in automotive designs where space and performance both matter. Comparing SAR ADC with Flash and Sigma-Delta ADC Flash ADC: The fastest type of ADC, converting signals in just one clock cycle. This speed comes at the cost of power consumption and size, as it requires one comparator per bit of resolution. Given the complex needs of automotive systems, this increased power draw and large footprint make Flash ADCs impractical for most real-time automotive control systems. Sigma-Delta ADC: Offers exceptional accuracy by oversampling the input signal and using noise-shaping techniques. However, its conversion speed is much slower compared to SAR ADCs. This makes it unsuitable for fast, real-time sensor data processing, though it shines in applications where high precision is needed, such as audio or pressure measurement. SAR ADC stands between these two, offering sufficient speed, accuracy, and power efficiency. This balance makes it the top choice for most automotive microcontroller designs, especially in safety-critical applications like engine control, where both speed and accuracy matter. How SAR ADC Works Sample & Hold (S/H) Block: This block holds the analog input signal steady while the ADC performs the conversion. The process begins by capturing the input voltage and freezing it momentarily to allow precise comparisons during the conversion. Comparator: The comparator checks the DAC’s output against the input signal at every stage of the conversion. It decides whether the next bit in the SAR register should be a ‘1’ or a ‘0’ based on whether the input signal is greater or lesser than the DAC output. SAR Register: This is a shift register that stores the output bit by bit as the conversion proceeds. The SAR register’s value evolves with each step of the approximation process, eventually containing the final digital equivalent of the input analog signal. DAC (Digital-to-Analog Converter): The DAC generates a voltage based on the digital bits already stored in the SAR register. The comparator then compares this DAC output with the input signal. The DAC’s resolution is crucial since it must match the resolution of the SAR ADC. Step-by-Step Example: How SAR ADC Calculates an Input Signal Example Setup: Reference Voltage (Vref): 5V Resolution: 4 bits (for simplicity) Input Voltage (Vin): 2.6V Author: Rohan Singhal

Read More »
Kunal Gupta
Author: Kunal Gupta

Author

Kunal Gupta

Leave a comment

Stay Updated With Us

Error: Contact form not found.

      Blog