NFC/RFID Sensors and Modules

What is RFID technology? Applications, Working Principal, Types, Projects

Table of Contents What is RFID technology? RFID is a technology by which objects can be tracked and identified using electromagnetic fields. RFID stands for Radio Frequency Identification. An RFID system consists of an RFID reader known as a Proximity Coupling device (PCD) and RFID tags known as Proximity Integrated Circuit Cards (PICC). RFID Tags are attached to the objects which need to be tracked/identified and each tag has a unique value hard coded. RFID readers are attached to the main system/computer where all the processing takes place. Now, these tags are brought in close proximity to the RFID readers, RFID readers decode the value and send the information to the main system for tracking/identifying/monitoring purposes depending on the application. RFID technology is similar to a barcode or the magnetic stripe of a credit card, as the data encoded in the label or magnetic strip can be captured by a device and stored in a database. RFID belongs to a group of technologies referred to as automatic identification and data capture (AIDC). AIDC methods automatically identify objects, collect data about them and enter the data directly into systems with little or no human intervention. RFID methods use radio waves and automation technologies to accomplish all of this. This technology has grown a lot since its first application. It has not only been improved over the years but also the cost of implementing and utilizing it continues to minimize, making this technology more efficient and affordable. In its simplest form, an RFID system consists of 2 components: an RFID tag and an RFID reader. Refer to the section below to know more in-depth about RFID tags and Readers. RFID tags are used to track objects, by reading/writing information on them and are usually composed of an integrated circuit, antenna, and battery. The integrated circuit stores the data and powers the antenna, allowing it to be read by a reader. Tags contain digitally encoded information that is stored in the integrated circuit and is transmitted to the reader. Readers are devices that intercept, decode, and interpret the information stored in the tag. Typically, readers consist of RFID antennas, multiple operating modes (active and passive), frequency capabilities, and signal processing. The readers, antennas, and tags work together to collect data from RFID tags and transmit it to computer systems. RFID Reader (PCD) PCD(Proximity Coupling device): Also known as RFID readers. They decode the RFID Tags and communicate with them based on ISO14443 standard. PCD can perform read and write operation of data i.e bidirectional communication once PCD and PICC are coupled together. The coupling between PCD and PICC is based on inductive coupling (Refer to Working principle of RFID technology to know physics behind it).PCD energizes the PICC by coupling with them when PICC comes in close vicinity of PCD.And PICC gets energized, it starts transmitting its radio signals with UID of it. For energizing the PICC, they need to be brought in close proximity so that PCD magnetic fields get properly coupled with PICC. PCD’s have the memory(FIFO buffers, EEPROM), communication pins for Host Interface(I2C,SPI,UART), antenna for generating of radio signals, power supply, I/O pins(Interrupt and Timer pins), small CPU for processing of data(CRC,Interrupt controller, Timer unit), Analog interface for RF front head(oscillators, PLL, PGA and etc), Low power modes and support of multi protocols for decoding tags. PCD has the crypto features also implemented inside them, so that only authenticated RFID readers can communicate with PICC. And this also becomes the distinguishing feature in different PCD’s. Like NXP semiconductors, RFID readers follow the crypto-1 cipher for authenticating. Also some PCD’s have secure models and key handling capabilities for secure communication between PCD and PICC for banking and transaction related applications. There are many semiconductor companies who provide the RFID reader chips, with many enhanced features.NXP semiconductors and STMicroelectronics are world leaders in providing RFID reader chips. NXP semiconductors has a family of RFID/NFC chips with many enhanced features. For more indepth knowledge on PCD, viewers can refer to:Radio-frequency identification – Wikipedia. In the upcoming blog, we are going to interface NXP semiconductors MFRC522 and PN512 with host MCU. By making its device driver and to showcase the working of PCD’s RFID Tag(PICC) PICC (Proximity Integrated Circuit Card): These are the RFID Tags, which are known as Proximity Integrated Circuit cards, in technical terms. PICC are attached to the objects which need to be tracked. PICC consists of an antenna for generation of radio waves and memory for storing the UID and other information of PICC. Each PICC has a Unique value hardcoded inside them. This unique value is referred to as UID. The UID value is 7 bytes. PICC have memory divided in terms of blocks and sectors for storing the important information. There are mainly 2 types of PICC/RFID tags. Active tags and Passive tags. Active tags: They have on chip batteries; thus, they can operate at bigger distances and can operate at higher frequencies. Passive tags: They don’t have an on-chip battery, instead they get energized and get the power from the PCD’s.magnetic fields. Thus, Passive tags need to be brought in very close proximity to PCD of about 1-2 cm, for decoding its value. Also, tags are available in many different shapes, depending on the application. They come in credit card-based shapes, to small key ring-based shapes. Also, some tags have crypto features inside them for authentication purposes when PCD’s communicate with them. NXP semiconductor is a world leader in providing RFID Tag chips. Their MIFRAME family of RFID tags has been implemented in 1000’s of devices and use cases. PCD and PICC communicate with each other according to ISO14443 spec. There are certain commands specified in that protocol, which are at first transmitted by PCD’s and then corresponding PICC responds, and the communication session is initialized. For more in-depth knowledge on PICC, viewers can refer to:Radio-frequency identification – Wikipedia. NXP semiconductor is a world leader in providing RFID Tag chips. Their MIFRAME family of RFID tags

Embedded MCU's Kinetic Sensor/Modules Sensor/Module Interfacing Sensors and Modules SPI Modules STM32 MCU's STM32F1

Implementation of MPU6050 with STM32

In the last blog I talked about the basics of MPU6050, this time let’s see how to interface it with the STM32 based controller and get the values of accelerometer and Gyro sensor. But before  starting first, let’s see the I2C block and the STM32 I2C block to get some idea of the basic structure of the I2C protocol. Figure 1: I2C Hardware Circuit The above circuit diagram shows the hardware connection of the I2C protocol in open drain configuration. The external pull up resistors are being used to make the circuit work efficiently. These days the controllers come with the internal pull up resistors so while writing the code for the same these resistors can be pulled up in the configuration. Before proceeding further lets understand certain terms like pull up, pull down, open drain etc. While using an I/O pin, in the digital domain it has values as LOGIC 1 (HIGH), LOGIC 0 (LOW) and Z-STATE (HIGH IMPEDANCE or FLOATING or TRI-STATE). The purpose of pull up and pull down is to maintain these states of the pin while working. PULL-UP means that the pin is internally connected to the power supply via a resistor and is read as LOGIC 1. PULL-DOWN means that the pin is internally connected to the ground via a resistor and is read as LOGIC 0. In between the two in the configuration, when the pin is neither pull-up nor pull-down and the analog value cannot be represented in the logic value, this state is termed as Z-STATE where there is a floating value.    Figure 2: Pull-up and Pull-Down Configuration Now let’s understand the Push-Pull and Open Drain configurations. PUSH-PULL Configuration: This configuration consist of a pair of complementary transistors which works as: For LOGIC 0, the transistor connected to the ground is turned on to sink an electric current from the external circuit. For LOGIC 1, the transistor connected to the power supply is turned on, and it provides an  electric current to the external circuit connected to the output pin. The slave address of the MPU-6050 id 0b110100x, a 7-bit long. Here the LSB bit i.e.x in the 7-bit long address is determined by the logic level at AD0 pin.If x=0 i.e., pin AD0 is Logic LOW otherwise Logic HIGH. Figure 3: Push-Pull Configuration   Figure 4: The Logic 0 and 1 for Push-Pull Configuration   OPEN-DRAIN Configuration: This configuration consist of a single transistors which works as: For LOGIC 0, the transistor connected to the ground is turned on to sink an electric current from the external circuit. For LOGIC 1, it cannot supply any electric current to the external load because the output pin is floating, connected to neither the power supply nor the ground. Hence the Open-Drain has two states LOGIC 0 (LOW) and LOGIC 1 (Z-STATE). This configuration use external pull up resistor. Figure 5: Open-Drain Configuration   Figure 6: The Logic 0 and 1 for Open-Drain Configuration I2C Let’s analyze the functional block diagram of the STM32. As shown in the figure, the I2C protocol consists of SDA and SCL lines along with an additional pin SMBA used in SMB protocol known as System Management Bus. The figure shows that there is a single Data Register along with the single Shift Register as the protocol is half -duplex. The address block is also there and a comparator to compare the addresses. The control logic consists of Control Register (CR 1 and CR2) and Status Registers (SR1 and SR2)  along with the Clock Control Register for generating the clock for the communication. Figure 7: I2C Block Diagram I2C Implementation Of Figure 9: Pin Connections Above is the pin connection of the MPU6050 with the STM32F411CE. Now set up the stm32 environment as follows: Step 1 Step 2 Step 1 Set up the RCC ad the SYS in the STM32Cube IDE as shown: Step 2 Now enable the I2C1 in the standard mode. Now starting with the code create a mpu6050.h file in the Inc folder and mpu6050.c file in Scr folder. We are all done. Let’s start with the code. In total there are around 80 registers in the IC but during the code all the registers are not required there are certain sets of registers which we are going to use which we will be defining in the header file mpu6050.h. These registers are: Name of the Register Address of the Register (Hex) Function REG_MPU6050_ADDR 0xD0 It is the device address for the MPU6050 module REG_SMPLRT_DIV 0x19 This register specifies the divider from the gyroscope output rate used to generate the Sample Rate for the MPU-6050. REG_GYRO_CONFIG 0x1B This register is used to trigger gyroscope self-test and configure the gyroscopes’ full scale range. REG_ACCEL_CONFIG 0x1C This register is used to trigger the accelerometer self test and configure the accelerometer full scale range. This register also configures the Digital High Pass Filter (DHPF). REG_ACCEL_XOUT_H 0x3B These registers store the most recent accelerometer measurements. REG_TEMP_OUT_H 0x41 These registers store the most recent temperature sensor measurement. REG_GYRO_XOUT_H 0x43 These registers store the most recent gyroscope measurements. REG_PWR_MGMT_1 0x6B This register allows the user to configure the power mode and clock source. It also provides a bit for resetting the entire device, and a bit for disabling the temperature sensor. REG_WHO_AM_I 0x75 This register is used to verify the identity of the device. The contents of WHO_AM_I are the upper 6 bits of the MPU-60X0’s 7-bit I2C address. The least significant bit of the MPU-60X0’s I2C address is determined by the value of the AD0 pin. The value of the AD0 pin is not reflected in this register. Apart from these registers we have two structures and the function definitions that we are using in the main file. Lets now jump directly towards the mpu6050.c file and see how things are working. In this phase, keep in mind the 3 things. Initializing the mpu6050. Read the RAW values of accelerometer and gyroscope Convert the RAR values to ‘g’ and ‘dps’ for Accelerometer

Kinetic Sensor/Modules Sensors and Modules

INTRODUCTION TO MPU6050IC

Most of us are fans of Video Games. We played a lot of games on our mobiles like PUBG, Call Of Duty and my personal favorite Asphalt. In all these games one thing we all notice is that as we rotate or bend our phone, the car also rotates in the same direction.  Have you ever imagined how this would happen? Well their are electronic sensors:  accelerometer and Gyroscope Lets dive into this blog, to know the Ans for this!!! What is an ACCELEROMETER WORKING Let us assume a small ball being placed in a box filled with vacuum and no external force is applied to it (i.e., consider the situation of outer space). Now initially the ball will be at the center of the box. Consider each side of the box as an axis. Suddenly we start moving the box to the left side  with the acceleration of ‘g’ (i.e., 9.8m/s2), the ball will hit the +X side of the box. Since no external force is acting on it, and the entire thing is weightless (vacuum state), hence the force comes out to be ‘g’. Consider another scenario when the box is moved upwards with the same acceleration ‘g’. Now again the ball will hit the downward side of the box i.e. +Z axis with the force equal to ‘g’. This is just a simple explanation on how an accelerometer works but in practical scenario accelerometers are based on MEMS technology built on a silicon wafer with companion CMOS electronics through wafer-level bonding. Taking the above situation in mind, there consists of a silicon wafer having polysilicon springs connected with a suspended plate covered with fixed mass around it on the wafer where in between the space, this fixed plate moves. This entire structure reflects the changes whenever acceleration is applied across the X,Y and Z axis. This reflection is reflected by the capacitance change placed in between the fixed masses as the suspended plate moves thus the sensor records this change in capacitance as the final reading. GYROSCOPE WORKING Since the accelerometer measures the linear acceleration, the gyroscope on the other hand measures the angular rotation which is accomplished by Coriolis Effect. Coriolis Effect The Coriolis Effect states that when a mass (m) moves in a specific direction with a velocity (v) and an external angular rate (Ω) is applied, the Coriolis Effect generates a force (F) that causes the mass to move perpendicularly. The value of this displacement is directly related to the angular rate applied. Consider two masses oscillating in opposite directions at a constant frequency. When an angular rate is applied, the Coriolis effect produced by each mass is in opposite directions, resulting in a proportional change in capacitance between the masses. By measuring this change in capacitance, the angular rate can be calculated. The MEMS sensor consists of a proof mass (i.e., it consists of 4 parts M1, M2, M3. M4) that continuously oscillates inward and outwards in the plane, thus causing a coriolis effect. When the structure is being rotated, the Coriolis Force acts on the moving mass causing oscillations in the plane. There are three modes depending upon the axis along which the angular rotation is applied: Roll Mode: When the angular rate is applied at the X-axis Pitch Mode: When the angular rate is applied at the Y-axis Yaw Mode: When the angular rate is applied at the Z-axis What is A MUST HAVE Motion Interfacing one finds in almost every smartphone and tablet. It is a 3-axis gyroscope and 3-axis accelerometer, in total an integrated 6-axis MotionTracking device all in a single small 4x4x0.9mm package. This package size has been achieved by the MEMS (MicroElectroMechanical System) innovation. Coming to some technical aspect of the IC, It comes with a dedicated I2C sensor bus at 400KHz Features 3 16-bit analog-to-digital converters (ADC) each for digitizing gyroscope and accelerometer outputs. Gyroscope full-scale range of 250,500,1000 and 2000 degree/sec (DPS). Accelerometer full-scale range of 2g,4g,8g,16g and On-chip 1024 Byte FIFO buffer which enables the system to read the sensor data in burst and then enter the low-power mode. Lastly, it operates at a power supply voltage range of 2.375V – 3.46V. Features of ACCELEROMETER in MPU6050IC Features of GYROSCOPE in MPU6050IC Features of ACCELEROMETER in MPU6050IC Features of Accelerometer in MPU6050IC The triple-axis MEMS accelerometer in MPU-60X0 includes a wide range of features:  Digital-output triple-axis accelerometer with a programmable full scale range of ±2g, ±4g, ±8g and ±16g Integrated 16-bit ADCs enable simultaneous sampling of accelerometers while requiring no external multiplexer Accelerometer normal operating current: 500µA  Low power accelerometer mode current: 10µA at 1.25Hz, 20µA at 5Hz, 60µA at 20Hz, 110µA at 40Hz Orientation detection and signaling  Tap detection User-programmable interrupts. Features of GYROSCOPE in MPU6050IC GYROSCOPE FEATURES The triple-axis MEMS gyroscope in the MPU-60X0 includes a wide range of features: Digital-output X-, Y-, and Z-Axis angular rate sensors (gyroscopes) with a user-programmable fullscale range of ±250, ±500, ±1000, and ±2000°/sec  External sync signal connected to the FSYNC pin supports image, video and GPS synchronization Integrated 16-bit ADCs enable simultaneous sampling of gyros Enhanced bias and sensitivity temperature stability reduces the need for user calibration Improved low-frequency noise performance Digitally programmable low-pass filter Gyroscope operating current: 3.6mA Standby current: 5µA  Factory calibrated sensitivity scale factor MPU6050 of MPU6050 Block Diagram of MPU6050 IC Gyroscope sensor Accelerometer sensor Digital Motion Processor (DMP) engine Primary I2C Auxiliary I2C Clock Generation Sensor Data Register FIFO Buffer Interrupts Digital Output Temperature Sensor Bias and LDO Charge Pump Gyroscope sensor Three-axis MEMS rate gyroscope sensor with 16-bit ADCs and signal conditioning It consists of three independent vibratory MEMS gyroscopes, which detect the rotation about the X, Y, Z axis. The capacitive change due to Coriolis Effect is observed whenever a rotation is caused about any of the axes. The corresponding signal is then amplified, demodulated and filtered to the corresponding voltage levels that relate to the angular rate. The sensor has an on chip 16 bit ADC to

Embedded MCU's Getting Started and Peripheral Coding STM32 MCU's STM32F1

PWM on STM32F103

What is PWM? PWM or Pulse Width Modulation, is a type of digital electrical signal which is periodic in nature, with a rectangular waveform. There are certain terms associated with PWM which we need to understand before we move ahead. Here’s a graphical representation of a PWM signal- ·       ‘Period’ = Tp , is the time it takes to repeat the same waveform ·       ‘Duty cycle’ is the time for which the signal is a logic 1 by the total time period. Ton is the time for which the pulse is high Hence, Duty cycle % = (Ton/ Tp) X 100 ·       ‘Frequency’ = F is the number of times the waveform repeats in a second. So, F = 1/Tp. Applications of PWM signals PWM signals have an extremely wide range of applications, here are a few of them- ·       Variable voltage generator– if you vary the duty cycle of a PWM signal and apply it to certain electrical components, the components act as if they are receiving analog signals. This is because the response time of the components is finite. So, components like LEDs, buzzers, brushed DC motors etc. can be controlled by PWM signals. Meaning, you could control speed of a motor, brightness of an LED or amplitude of a buzzer and so on. The voltage that they receive has a linear relationship with the duty cycle. So, if logic 1 is 5 Volts 0% duty cycle – 0V 25% duty cycle – 1.25 V 50% duty cycle – 2.5 V 75% duty cycle – 3.75V 100% duty cycle – 5V ·       As a control signal – Some electrical devices/components analyze PWM signals that they are receiving to give a corresponding output. So, changes in the duty cycle are reflected in the output. These include Servo motors, electronic speed controllers (ESCs) and many more. Here, the devices respond only to specific PWM duty cycles and frequencies If you take the example of servo motors, they can only be operated at 50Hz signal with a duty cycle of 2.5 % to 12% . Anything beyond that doesn’t result in the movement of the servo. (The frequency and duty cycles vary from among different servos, this is a very common value which most 180-degree servos respond to) Similarly, ESCs respond to a PWM signal with ON time of 1ms for minimum throttle and 2ms for maximum throttle with PWM frequency of 50 Hz. Some devices such as HCSR04 ultrasonic sensors give an output as a PWM signal in which the pulse width corresponds to the time it took for the ultrasonic wave to be received. How is PWM signal Generated on STM32?? Timer peripheral STM32 blue pill has 15 pins which can generate a PWM signal, with other models having even more pins for PWM generation. In this section, we will try to understand how PWM signals are generated by STM32 Every microcontroller has a built-in circuit which can measure the passing of time. These are called Timers. What timers essentially do is count up to a certain number and upon reaching that number, they change the value of a certain register to indicate that the timer has counted up to that number. Now, the time it takes to increment this count by 1 is determined by the timer’s clock frequency. So, if the frequency of a timer is 1KHz, its time period will be 1 Millisecond. Hence, if we count up to 10, we have measured the passing of 10 Milliseconds. This is how, by simply incrementing a number, timers can measure the time that has passed since the timer began counting. (This is how the HAL_Delay() function generates delays) The maximum count a timer can make is determined by its register size. So, an 8 bit timer can count up to 28 = 256, 10-bit timer –210 = 1024 16-bit timer –216 = 65536 32-bit timer –232 = 4294967296 So, a 1 bit increase in timer size equals to double the count Timers are extremely necessary for the functioning of a microcontroller as a lot of events in programs are time based, which you may not even realize. Timer Peripheral modes and features Coming to STM32 Blue pill, it has 4 timers of 16-bit size. To perform these functions, they need to be in specific modes. Here are all the modes in which timers can operate in STM32- 1.    Input capture mode– In this mode, a pin on the board is set as input on which a PWM signal is sent by some device and we measure the frequency and duty cycle of that signal. This can be used to interface with devices such as HCSR04 ultrasonic sensors, which send a PWM signal as input to the microcontroller, where different parameters of PWM signals can be used to determine the distance which the sensor is trying to measure. 2.    Output compare mode– In this mode, the timer is used as a counter and the count is compared to a register which contains a pre-programmed value, when they are equal, a software interrupt is generated and using this, a given pin is switched high or low. This mode comes in very handy when you are making a project which requires you to use multiple peripherals and at the same time generate a rectangular waveform of a given frequency and duty cycle, as it is interrupt based. 3.    One pulse mode– In this mode, a pulse can be generated based upon a trigger from an input pin on the board , the pulse generation takes place after a certain delay from when the input trigger pulse was detected. This can be considered as a combination of mode 1&2 (IC &OC) 4.    PWM generation mode– In this mode, we can generate a PWM signal on a given pin by fixing a frequency and a duty cycle. This is the mode we will be using to generate PWM signals through the main loop. The difference of this mode to mode 2 (Output compare

Embedded MCU's Getting Started and Peripheral Coding STM32 MCU's STM32F1

STM32 Overview

What is STM32 ? STM32 is a family of 32-bit Microcontrollers and development boards manufactured by ST Microelectronics which offer very high performance for a relatively low price. All STM32 microcontrollers are based on ARM Cortex-M processor which make them much better in terms of computing power than most of the common microcontrollers/microcontroller development boards which are available in the market. These microcontrollers also have been provided with software support by ST for developers for free. If you have experience with microcontrollers like Arduino, this is a great step forward in understanding microcontrollers in depth. The STM32 framework allows you to control all peripherals and allows you to tweak them as per your wish, whereas in Arduino IDE, when you program in C++, it comes with in-built functions and libraries which don’t allow you to understand the backend working behind everything. This is very crucial, as it allows you to use the microcontroller to its full potential. STM32 FAMILY The STM32 family of microcontrollers is vast and expansive, offering a variety of options for the consumer to choose from. The family of microcontrollers is broadly classified into 4 categories- High performance ST offers a series of microcontrollers which have the fastest code execution time, high speed data transfer and relatively higher flash memory. Along with this, the feature the most advance peripherals that ST offers. This makes these controllers very useful for real-time applications such as running an RTOS. STM32H7x The H7 series controllers are based on the ARM Cortex M7 offering very high speeds of upto 550Mhz. The microcontroller series comes in two variants, single core and dual core. Dual core H7 series controllers come with an ARM Cortex M4 core as well as an ARM Cortex M7 core which allows for processing work distribution, very useful for applications requiring many peripherals where response time is critical. The dual Core variants also come with an inbuilt SMPS as well. The single core series comes with an ARM Cortex M7 core with clock speed between 220-550Mhz, depending upon the variant. STM32F7x The F7 series controllers are based on the ARM Cortex M7, Thanks to an L1 (level 1) cache, the series delivers the maximum possible theoretical performance of the Cortex-M7 core. Cache memory temporarily stores instructions frequently accessed by the processor STM32F4x – The F4 series is based on the ARM Cortex M4. These controllers have less processing power then H7 and F7 series but still come with advanced peripherals and high flash memory. A very useful line of microcontrollers which offer a wide variety of features and come at a relatively lower cost than that of an F7/H7 controllers. The F4 series is broadly divided into 3 segments- 1.F4 Advance line- Offers up to 180Mhz of clock speed and a maximum of 2 Mb of dual bank flash memory, with advanced peripherals, consisting of communication buses such as QSPI. 2.F4 foundation line- Offer lower flash memory (between 512Kb-1Mb) , with few controllers offering advance peripherals and features such as camera interface and Ethernet MAC. 3.F4 Access line- This line of F4 controllers consists of entry level controller which can be termed ‘High Performance’. These controllers come with lower clock speeds, lower RAM but feature very good power efficiency, while also not compromising on peripherals. Wireless The main focus of the STM32Wx microcontroller family is wireless connectivity. They cover sub-GHz as well as 2.4Ghz frequency range operation The STM32 wireless MCUs are further divided into 2 categories– STM32WB These MCUs have a dual core processor unit, Cortex M4 & Cortex M0+, which allows for processing distribution, making it a great candidate for real-time processing and execution. The MCU series is based on STM32L4 architecture, which offers dynamic voltage scaling, reducing the power consumption of the device. They also support BLE 5.3, Open Thread and Zigbee protocols, making them a great choice for IOT applications, providing a lot of functionality onboard the chip itself. STM32WL These MCUs also come with a dual core processor unit like the STM32WB series, and some variants also come with a single ARM Cortex M4 as their processing unit. The key highlight of this series of microcontrollers is that not only do they work as a general purpose microcontroller, but also come with an integrated sub GHz radio supporting LoRa WAN which makes it a great choice for smart home applications, utilities, logistics, Industrial IOT etc.   Ultra-Low Power – STM32 ultra-low-power microcontrollers offer designers of energy-efficient embedded systems and applications a balance between performance, power, security and cost effectiveness. The portfolio includes the STM8L (8-bit proprietary core), the STM32L4 (Arm® Cortex®-M4), the STM32L0 (Arm® Cortex®-M0+) and the STM32L1 (Arm® Cortex®-M3). The STM32L5 MCU (Arm® Cortex®-M33) with its enhancedsecurity features is the latest addition to this rich portfolio. The new STM32U5 series combines the latest and most efficient Arm Cortex-M33 core with an innovative 40 nm platform that reduces energy consumption to the bone, while increasing performance. The series also adds the state-of-the-art features which are required in today’s applications,including advanced cyber security with hardware-based protection, and graphics accelerators for rich graphical user interfaces. The STM32L5 series enhanced security features leverage Arm® Cortex®-M33 and its TrustZone® for Armv8-M. Thanks to this new core and a new ST ART Accelerator™ (also supporting external memory), the STM32L5 reaches an 443 CoreMark. The STM32L4 series offers the excellence of ST’s ultra-low power platform with an additional performance dimension by providing 100 DMIPS with DSP instructions and Floating-Point Unit (FPU), more memory (up to 1 Mbyte of Flash memory) and innovative features. The STM32L4+ series extends STM32L4 technology by offering higher performance (120 MHz/409 CoreMark executing from internal Flash memory), larger embedded memories (up to 2 Mbytes of Flash memory and 640 Kbytes of SRAM), and rendering advanced graphics without compromising ultra-low-power consumption. The STM32L0 series offers a genuine energy-saving solution for entry-level applications. Available in tiny packages down to 14 pins and with a wide range of Flash memory densities from 8 to 192 Kbytes, the STM32L0 features ultra-low power consumption in a competitive portfolio. Mainstream– The mainstream microcontrollers are more general-purpose boards

DIY Projects Embedded MCU's STM32 MCU's STM32F1

STM32_IoT_Metering_Eval_Board

Hola Amigos!! Welcome you all to Gettobyte platform. I am firmware developer and when I am learning firmware development by interfacing number of sensors and modules that has to be connected with MCU. It becomes headache when it comes to making connections of all sensors, using jumper wires on breadboard to interface all modules which are required. Thus, development this board which has almost all peripherals of STM32 MCU connected to one or other sensor to make different kind of Firmware’s (via interrupts, DMA or pooling, RTOSes frameworks, Bare-metal or HAL Based and etc.). In short, this board is best for people who wants to learn firmware development and understand all peripherals of the MCU. What is GB_STM32_EVAL_BOARDV_1? GB_STM32_EVAL_BOARDV_1 is a Custom Eval Board which is designed based on the SMART Energy Metering application, which has several on-board sensors and modules concentric to metering applications. GB_STM32_EVAL_BOARDV_1 is also a Custom Eval Board based on STM32F103 MCU, which is designed to get hands on all the basic peripherals of STM32 MCU and learn different frameworks of Firmware Development like RTOS, STM32HAL and Bare Metal Codes. Features of GB_STM32_EVAL_BOARDV_1? The board is based on SMART Energy Metering application, which has a number of on-board sensors and modules concentric to metering applications. The board has following onboard external components directly connected to STM32MCU via its peripherals. AC energy metering IC: HLW8012(Timer Input Capture peripheral): AC energy metering IC with 2.5kV galvanic isolation of signal and power fascinated by onboard isolated switch mode DC-DC converter and optocouplers for isolation of signal Temperature sensor module: DHT11(Timer peripheral) DC energy metering IC: INA219(I2C peripheral) OLED graphical Screen: SSD1306(I2C peripheral) Wifi Transceiver module: ESP8266(UART peripheral) Industrial Communication Protocol Transceiver: RS485( UART peripheral) RF transceiver module: NRF24L01(SPI peripheral) External Flash Memory IC: W25Q32(SPI peripheral) In addition to the above peripherals the board  has LEDS & Pushbuttons, to play with GPIO peripheral.  10k Ohm potentiometer to get hands on ADC peripheral of STM32 MCU’s. The board has breakout pins headed out of all the pins of MCU, for connecting another sensor. This board has 0 ohm resistors which act as jumpers. These can be useful while debugging the PCB and also to utilize the pins of the MCU that have been occupied by onboard peripherals. The board also has Female-header pins exposed out with each Onboard sensor/module, for connecting the Logic Analyzer to test and debug the working of sensor. Module connected to those pins. The board can measure AC Ratings upto, The board can measure DC Ratings upto It has an on-board data logging feature for 128MB of data, that is approximately 60 days of readings. Debugger The board can be programmed and debugged via STLINKV2 debugger externally. The board has SWD and SWO debugger pins both headed out via on board Header pins, P1 which can be connected to external debugger STLINKV2, as shown below.  Power Supply The board has number of On-board power supply options. It can be powered by DC adaptor of 6V-40V DC. It can be powered directly via STLINKV2 also. It can be programmed via UART-FTDO connector too How to get started with the Board? To get started with the board is quite simple, simply connect the STLINKV2 debugger via its Debugger pins. You can now open the STM32CubeIDE and simply create a new project by selecting MCU as STM32F103C8.   That’s all, just configure the project according to your wish. Now you can program the board according to your wish using different frameworks of Firmware as follows: Using Bare Metal Coding, by making device drivers of the peripherals  in register level and then using that for Application development. This way is recommended for beginners who want to learn Embedded Firmware Development from scratch. Using STM32 HAL, by configuring the firmware of the board via STM32CubeMX. And directly focusing on the Smart Metering Application project development. This way, is recommended for those who wants to do R&D and prototyping for Smart Metering Application, by building different kind of Applications on the board Using RTOS, for building of complex applications. The board houses a number of Input/Output sensors and modules. So it is idle to learn RTOSes like FreeRTOS,Mbed RTOS and etc.  You can program it via STM32CubeMX, configure the project according Use Cases of Board Custom Evaluation board on STM32 MCU For accelerating prototyping and development time.Board has on board Metering sensors, Display Screen, Wi-Fi module, RF module, external flash memory, Temperature Sensor, ADC module and RS485 port. So that Development team and engineers can test their Firmware’s directly on EVAL boards for different scenarios and cases, without going on to hustle to mimic the hardware on breadboard and Jumper Wires during POC. Board can also be used as DIY KIT, by hobbyists, students and makers to learn STM32 MCU.Eval board has different sensors and modules interfaced to STM32 MCU touching all peripherals of the MCU. Don’t need to involve in the hustle of interfacing every sensor and module via jumper wires and breadboard. Use of jumper wires and breadboard, makes the circuit too messy and ugly to work on. Thus developed this EVAL board which has quite famous sensors and modules interfaced to STM32 MCU on PCB, to make the different application firmware on different No RTOS or RTOS frameworks. Board is concentric to Metering Industry. In Depth Overview AC Energy metering IC HLW8012: Connected to MCU via TIMER INPUT CAPTURE. HLW8012 has 3 pins: SEL, CF1 and CF. Which are connected as shown below. It has to be powered externally via 5V DC supply. Also, it is isolated from power supply of the board, as this part of circuit will be having high Electrical voltage. Also, there are test point P16, for debugging and testing the signals of HLW8012 via logic Analyzer or Oscilloscope. CF1: PB5(T2C2) CF: PB6(T4C1) SEL: PB7(GPIO) DC Energy metering IC INA219: Connected to MCU via I2C1 of MCU. SCL: PB8 SDA: PB9 W25Q128JV SPI flash memory: Connected to MCU via SPI1. CS:PA4 MISO(DO):PA6 MOSI(DI):PA7 SCK: PA5 NRF24L01 RF Transceiver

FreeRTOS RTOS

Creating tasks in FreeRTOS (using CMSIS)

This video is in continuation to series of FreeRTOS tutorial blogs, checkout previous blog if you wanna know how to get started with RTOS using FreeRTOS. Now in RTOS one of the very first things that we do, is TASK creation and then schedule it via the concept of priority wise. After which tasks are executed according to the scheduling algorithm chosen. If we were to understand in simple terms, TASKS are something that needs to be done. There are multiple tasks running parallel in RTOS but at a time only one task is getting executed(if MCU is single core). It is characteristic of the RTOS kernel which makes us visible that all tasks are running simultaneously. Each task has its own memory, requires the system resources, has its own variables and etc. So we are going to first implement this thing only, we will see how to create multiple tasks, and how to write Software for each task which will perform some kind of Input/Output action. Then make them run simultaneously by starting the FreeRTOS kernel. Each task is a small program on its own. Each has an entry point & will normally run forever with an infinite loop.  The task function is the entry point where we write the program for corresponding tasks. There is TCB( Task Control Block) which will be having all the information about TASKS. This will be used to debug  & understand the tasks creation and working. Sensor & modules Drivers to run them as tasks in FreeRTOS: ESP8266 as Client With HOST MCU. W25QSPI Flash memory for logging with HOST MCU. INA219 DC Current sensor with HOST MCU. HLW8012 AC metering IC with HOST MCU. OLED Screen Display with HOST MCU. DHT11 temperature sensor with HOST MCU. Making FreeRTOS project in STM32CubeIDE At first, we created the project with the FreeRTOS as middleware in STM32CubeIDE. We would be using STM32F103 bluepill as our controller. I hope you guys know how to create a project in STM32CubeIDE, if viewers don’t they can refer to this video (in the video I have chosen different MCU, you can choose whatever MCU you are using) for that and then come back here. After STM32CubeIDE Project is created, open the .ioc file in your STM32 project directory from the project explorer.  (I am skipping the basic configuration of RCC and SYS, assuming that viewers already know how to do that. if they don’t, they can have a look from this video.) Now go to the last section Middleware in the categories of the .ioc file. Select the FreeRTOS. Select Interface as CMSIS_V1.   Now you can see in the configuration there are many heading with the name of RTOS components. So, from here, we can configure our FreeRTOS directly in a GUI-based way, thus I started with STM32CubeIDE as it becomes easy for beginners to start with FreeRTOS. Now seeing the headings for beginners, it might be confusing which components are used when and for what purpose. If you have read the PDF on RTOS which i have mentioned in my previous blog: Starting with RTOS: FreeRTOS | gettobyte, you would be having a rough idea of these headings.But for now, we would only be focusing on the Tasks and Queues heading, which is used for the creation/management of tasks and queues. As in this blog, we are only creating tasks, so we would be creating tasks for now and understanding how to configure their different parameters. Don’t worry!!, we don’t need to learn all things at one time.

Stay Updated With Us

Error: Contact form not found.