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

Implementation of BLE on STM32WB55

Table of Contents About GPIO Peripheral The pins which can be configured by the software at runtime to perform various functions are called GENERAL-PURPOSE INPUT/OUTPUT (GPIO) pins. With the help of software one can program the GPIO pins mainly as: Digital Output It compares the external voltage signal with a predefined threshold. Digital Input It controls the Voltage of the pin  Analog Function  It performs ADC (Analog to Digital Conversion) or DAC (Digital to Analog Conversion) Other Functions or Alternate Functions It makes the pin to perform other functions like PWM output, timer-based captures, external interrupts, and various other interfaces like SPI, I2C, UART communications. Before coming to the Schmitt Trigger Understanding, have a quick recap of Pull Up, Pull Down and Open Drain Configurations from MPU6050 Implementation blog Implementation of MPU6050 with STM32 – gettobyte GPIO Input: Schmitt Trigger GPIO Output Speed Slew Rate GPIO Input: Schmitt Trigger A SCHMITT TRIGGER is a device which uses a voltage comparator to convert a noisy or slow signal edge into a clean and desirable edge instantaneously.  For a real time system, the external signals do not change instantly, due to slower slew rate which depends on inheritance parasitic capacitance, resistance or an inductor at the  input side.  As the processor chip has a Schmitt Trigger, it increases the slew rate and increases the noise immunity for the signals which are captured. Let us understand the implementation of the Schmitt Trigger. It consists of a voltage comparator with positive feedback. The output Vout depends between two input voltage V+ and V–. If V+ > V–, Vout is quickly saturated to VSAT, otherwise Vout  = 0 For an ideal op-amp, the current flowing through resistor R3 is zero and thus we have Vref = V– The op-amp output Vout has two saturation values, as shown below Vout = VSAT if V– <V+       0 if V– < V+ However, V+ depends on Vout and Vin· Therefore, Vout depends on both the input Vin and the recent history of Vout· Such an effect is called hysteresis. Using KCL, assuming that the current flow in the non inverting input terminal of op-amp is zero, Vin – V+ /R2 = V+ – Vout / R1 On solving the above equation we will get, Vin = R2Vout + R1Vin / R1 + R2 At the time instant when Vout transits from one saturation value to the other saturation value, we have V+ = Vref Thus, Vref = R2Vout + R1Vin / R1 + R2 Solving further we get, Vin = (1 + R2/ R1)Vref – (R2/R1)Vout As discussed earlier, Vout has only two possible values. If Vout = 0 initially and Vin increases, we can obtain the trigger high threshold VTH at which Vout transits to VSAT: VTH = (1 + R2/R1) Vref – (R2/R1)*0 = (1 + R2/R1)Vref On the other hand, if Vout = VSAT initially and Vin decreases, we can obtain the trigger low threshold VTL at which Vout transits to 0: VTL = (1 + R2/R1) Vref – (R2/R1)VSAT Vout can be determined by comparing it with two thresholds VTH and VTL. When Vin climbs through VTH , Vout is rapidly switched to the upper limit VSAT· Conversely, once Vin falls below VTL, Vout makes a transition to the lower limit.  Note that VTH > VTL , i.e., the threshold for switching to high is greater than the threshold of switching to low. A Schmitt trigger when compared, Provide a better boise rejection. Larger threshold for switching high and low for switching. Immune to undesired noise. GPIO Output Speed Slew Rate The SLEW RATE of a GPIO pin is the speed of change of output voltage with respect to unit time. Slew Rate = ΔV/ Δt  In simple words, If the GPIO pin changes from LOGIC LEVEL 0 to LOGIC LEVEL 1, the voltage changes from 0V to 5V in just 5µs, then the slew rate is simply 1V/µs. The higher the slew rate, the shorter time the output voltage takes to rise or fall to desired values. Therefore, a higher slew rate allows faster speed at which the processor can toggle the logic level of a GPIO pin. A shorter rise and fall time allows a GPIO pin to change its logic value more rapidly. A high slew rate can result in significant electromagnetic interference (EMI), also known as radio frequency interference (RFI), to nearby electronic circuits. This is due to the large-amplitude and high-frequency harmonics produced by a fast-rising and falling signal, which can cause malfunctions in a victim circuit through radiation, conduction, or induction. To reduce EMI disturbance, a slower slew rate is generally preferred. GPIO IN STM32WB Each GPIO port has 4 32-bit Configuration Registers (GPIOx_MODER, GPIOx_OTYPER, GPIOx_OSPEEDR and GPIOx_PUPDR) 2 32-bit Data Register (GPIOx_IDR and GPIOx_ODR) A 32-bit Set/Reset Register (GPIOx_BSRR) A 32-bit locking Register (GPIOx_LCKR0 and 2 32-bit Alternate Function Select Register (GPIOX_AFHR and GPIOX_AFLR)   Main feature sog GPIO are Output states: push-pull or open drain + pull-up/down  Speed selection for each I/O Input states: floating, pull-up/down, analog  Fast toggle capable of changing every two clock cycles Highly flexible pin multiplexing allows the use of I/O pins as GPIOs or as one of several peripheral functions  GPIO Functional Description The port bit of GPIO can be configured by the software depending upon the hardware characteristics in various modes such as: Input floating  Input pull-up  Input-pull-down  Analog  Output open-drain with pull-up or pull-down capability  Output push-pull with pull-up or pull-down capability  Alternate function push-pull with pull-up or pull-down capability  Alternate function open-drain with pull-up or pull-down capability  Each I/O port bit is freely programmable, however the I/O port registers have to be accessed as 32-bit words, half-words or bytes. The purpose of the GPIOx_BSRR register is to allow atomic read/modify access to any of the GPIOx_ODR registers. In this way, there is no risk of an IRQ occurring between the read and the modify access. The above diagram shows the basic structure of a

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

Introduction to STM32WB55

Table of Contents About STMicroelectronics STMicroelectronics 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. 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. 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! 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. 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 Architecture Memories Security and Safety True random number generator (RNG) RF Subsystem Low Power Modes Clocks and Startup General Purpose Input Output(GPIOs) Direct Memory Access (DMA) Interrupts and Events Analog to Digital Convertor (ADC) Comparators (COMP) Touch Sensing Controller Liquid crystal display controller (LCD) Timers and watchdogs Real-time clock (RTC) and backup registers Inter Integrated Circuit (I2C) Universal Synchronous/Asynchronous Receiver Transmitter (USART) Serial Peripheral Interface(SPI) Serial audio interfaces (SAI) Quad-SPI memory interface (QUADSPI) Architecture Architecture STM32WB55 Architecture The host application is housed on an Arm® Cortex®-M4 CPU (named CPU1) that connects with a generic microcontroller subsystem. The RF subsystem is made up of a specialized Arm® Cortex®-M0+ microprocessor (named CPU2), Bluetooth Low Energy and 802.15.4 digital MAC blocks, an RF analog front end, and proprietary peripherals. All Bluetooth Low Energy and 802.15.4 low-layer stack functions are handled by the RF subsystem, which limits communication with the CPU1 to high-level exchanges. Some functions are shared between the RF subsystem CPU (CPU2) and the Host CPU (CPU1): Flash memories  SRAM1, SRAM2a, and SRAM2b (SRAM2a can be retained in Standby mode)  Security peripherals (RNG, AES1, PKA)  Clock RCC Power control (PWR) Memories Memories STM32WB55 Memories 2.1.  Adaptive real-time memory accelerator (ART Accelerator) The ART Accelerator is a memory accelerator optimized for STM32 industry-standard Arm® Cortex®-M4 processors. It balances the inherent performance advantage of the Arm® Cortex®-M4 over flash memory technologies. To release the processor near 80 DMIPS performance at 64 MHz, the accelerator implements an instruction prefetch queue and branch cache, which increases program execution speed from the 64-bit flash memory. Based on CoreMark benchmark, the performance achieved thanks to the ART accelerator is equivalent to 0 wait state program execution from flash memory at a CPU frequency up to 64 MHz. 2.2.  Memory protection unit In order to prevent one task from unintentionally corrupting the memory or resources used by any other active task, the memory protection unit (MPU) is used to manage the CPU1’s accesses to memory. This memory area is organized into up to eight protected areas. The MPU is especially helpful for applications where some critical or certified code must be protected against the misbehavior of other tasks. It is usually managed by an RTOS (real-time operating system). 2.3.  Embedded flash memory The STM32WB55xx and STM32WB35xx devices feature, respectively, up to 1 Mbyte and 512 Kbytes of embedded flash memory available for storing programs and data, as well as some customer keys. 2.4.  Embedded SRAM The STM32WB55xx devices feature up to 256 Kbytes of embedded SRAM, split in three blocks: SRAM1: up to 192 Kbytes mapped at address 0x2000 0000  SRAM2a: 32 Kbytes located at address 0x2003 0000 also mirrored at 0x1000 0000, with hardware parity check (this SRAM can be retained in Standby mode)  SRAM2b: 32 Kbytes located at address 0x2003 8000 (contiguous with SRAM2a) and mirrored at 0x1000 8000 with hardware parity check. Security and Safety Security and Safety The STM32WB55xx  contain many security blocks both for the Bluetooth Low Energy or IEEE 802.15.4 and the Host application. It includes:  Customer storage of the Bluetooth Low Energy and

NFC/RFID Sensors and Modules

RFID reader module: MFRC522

So, hello to all viewers and welcome back to Gettobyte Platform. In This blog you are going to know about RFID Reader MFRC522, which is designed by NXP Semiconductors. Objective would be to interface this module with Host MCU’s like of NXP Semiconductors, STMicroelectronics or other vendors MCU’s. Will make the driver to interface the RFID Reader with any MCU, not unlike just with Arduino and Arduino IDE environment. To make the driver of RFID reader at first, we need to dig into its datasheet, to understand its various sub parts. And that’s all about this blog is gotten going to be, to make the datasheet understand in easy way-out. Table of Contents Next & Previous Blog Previous Blog: What Is RFID TEchnology RFID Reader MFRC522 Interfacing with Host MCU RFID Technology RFID modules is a wireless sensing technology which is used to track/identify/monitor the objects.  Viewers can refer to this blog to know about RFID technology in detail. or can watch this video which is in animated format to know about RFID technology. MFRC522 RFID Reader/PCD MFRC522 is a highly integrated reader/writer IC for contactless communication at 13.56 MHz. These reader supports the ISO 14443 A protocol for communicating with RFID Tags. They are used to detect the MIFRAME RFID tags. MFRC522 has internal RF transceiver, which provides a robust and efficient implementation for demodulating and decoding signals from MIFRAME compatible cards using ISO 14443 A protocol. The digital module of MFRC522 manages the complete ISO/IEC 14443 A framing and error detection (parity and CRC) functionality. MFRC522 supports 3 tags of MIFRAME family, that are MF1xxS20, MF1xxS70 and MF1S50 products. MFRC522 features MFRC522 though quite old RFID reader and in today’s time many new advance RFID readers have come up. But so as to get started with this technology as a hobbyist/student/DIY project, it is perfect module to lay your hands on this Technology. MFRC522 has highly integrated analog circuitry to demodulate and decode responses when RFID tags are brought in close proximity of these devices. RFID readers are connected with some host MCU, where the processing of data which is received via RFID tags happens according to the application. MFRC522 can connect with host MCU, using SPI, Serial UART and I2C -bus interface. It supports ISO 14443 A protocol and can be used with MIFRAME family of RFID tags. And in MIFRAME family it supports only MF1xxS20, MF1xxS70 and MF1xxS50 products. It has internal CRC-coprocessor. Internal FIFO buffer which can handle 64 bytes of sending and receiving. It uses the Crypto-1 cipher for authenticating. It supports Internal oscillator for connection to 27.12 MHz quartz crytsal. It is low power device, need 2.5 V to 3.3 V power supply. It also has flexible interrupt modes when some RFID tags are detected and trigering events too. In addition to flexible interrupt, it has programmabe I/O pins and timer. It can perform Internal self-test too. MFRC522 Functional description MFRC522 Functional Descriptions MFRC522 Host Interfaces MFRC522 Interrupts MFRC522 Time Unit MFRC522 FIFO MFRC522 CRC Host MCU to MFRC522 Command Set MFRC522 to PICC command set MFRC522 Host Interfaces MFRC522 Host Interfaces MFRC522 can be connected to Host MCU using 3 serial protocols: UART, I2C or SPI. MFRC522 checks the current host interface type. automatically after performing a power-on or hard reset. The MFRC522 IC identifies the hostinterface by sensing the logic levels on the below pins after the reset phase.  The MFRC522 is equipped with a series of registers that allow the Host MCU to access its functional description blocks. To ensure the proper functioning of the MFRC522, the Host MCU must initialize and configure these functional blocks by sending the corresponding register addresses. Each register is essentially an address byte that is transmitted from the Host MCU. Depending on the function described in the register section, read/write operations are performed on the corresponding address byte. It is crucial to properly initialize and configure these functional blocks to ensure the optimal performance of the MFRC522. By understanding the purpose of each register and its corresponding function, the Host MCU can effectively communicate with the MFRC522 and achieve the desired results. –> MFRC522_write_register() –> MFRC522_Read_register() MFRC522 Interrupts MFRC522 Interrupts MFRC522 can trigger the interrupts, when certain events occur. There are 8 events as shown in below table when interrupt can be triggered. When above event occurs, IRQ pin is used to interrupt the host. IRQ pin signal is asserted and host MCU can use its interrupt handling capabilities (basically NVIC if we are talking about ARM based MCU) on what to do when corresponding interrupt has occurred. Status1Reg Register IRq bit is used to indicate if any interrupt source has been triggerered. Status1Reg register IRq bit Which interrupt has been triggered is indicated by ComIrqReg and DivIrqReg Register.  ComIrqReg Register DivIrqReg Which interrupts to be configured and behavior of IRQ pin is configured by ComIEReg and DivIEReg Register. ComIEnReg DivIEnReg MFRC522 Time Unit MFRC522 Time Unit There is a Timer unit in MFRC522, that is used for multiple purposes. Timer unit is essential for maintaing the configuring the clock and analog interfaces. Also timer unit can be used for following features: Timeout counter Watchdog counter Stopwatch Programmable one shot Periodical trigger Timer has an input clock of 13.56 MHz derived from the 27.12 MHz quartz crystal oscillator. The timer consists of 2 stages: prescaler and counter. The prescaler(TPrescaler) is a 12-bit counter. That can be configured using TModeReg register’s TPrescaler_Hi[3:0] and TPrescalerReg register’s TPrescaler[7:0] bits. The Reload value for the counter is defined by 16 bits between 0 & 65535 in the TReloadReg register. The current value of the timer is indicated in the TCounterVAlReg Register.  MFRC522 FIFO MFRC522 FIFO FIFO overview The MFRC522 contains an internal FIFO buffer of 64 bytes, which is equivalent to 8 x 64 bits. This buffer is utilized for both input and output data streams. The host MCU has the capability to perform both Read and Write operations on this FIFO. The host MCU

Stay Updated With Us

Error: Contact form not found.