NFC/RFID Sensors and Modules

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.

MFRC522 Datasheet Explanation

Table of Contents

Next & Previous Blog

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 IC

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 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 Block Diagram

MFRC522 Block Diagram

Above is the simplified block diagram of MFRC522 module. MFRC522 has an internal memory, power supply, interrupt pins, FIFO buffer, Antenna and analog interface, digital module for communicating with Host MCU. 

Analog Interface handles the modulation and demodulation of the analog signals. FIFO Buffer ensures fast and convenient data transfer.

Register bank are the set of registers through which MFRC522 would be configured and initialized to use. Parameters like Clock, Interrupts, status of errors while communicating with RFID readers, CRC calculation, FIFO configuration and etc need to be configured before using the MFRC522.

How the MFRC522 Internal system works?

Host MCU will send PCD Commands to MFRC522, according to which it will perform some operations. MCU will send these commands by writing into one of the registers of PCD.( For MFRC522 CommandReg is register)

Operations like: 

  • Activation of CRC Coprocessor
  • Transmission of data from FIFO buffer of MFRC522 and activation of receiver circuits to get the response from PICC
  • transfer of data from FIFO to an internal buffer 
  • soft reset and authentication-based operations

Further MFRC522 will emit the commands for communicating with PICC, here referred to as PICC Commands, according to which operation with PICC takes place, like scanning of PICC, selecting the PICC, reading and writing the data on PICC. MFRC522 emits these commands via electromagnetic induction and electric coupling. ( That is the main working principle behind the RFID technology)

Host MCU to PCD

Host MCU will send the commands to PCD, according to which PCD will perform the operations like activation of FIFO buffer or CRC coprocessor, and transmission of data from FIFO. We will name these commands as MFRC522 Commands sets. Host MCU will send those commands to PCD (here MFRC522) by writing into the CommandReg Register using low level Host Interface write API.

  • Idle Command: Places the MFRC522 in Idle mode.
  • Mem Command: Transfers the 25 bytes from the FIFO Buffer to the internal buffer. This command is used when, we want to read the data from PICC( As described in ISO-14443-4 doc), as PICC response is always recorded in PCD FIFO.
  • Generate RandomID: generates a 10-byte random ID number.
  • CalcCRC: Activates the CRC coprocessor or performs a self test.
  • Transmit: transmit data from the FIFO buffer
  • NoCmdChange: no command change, can be used to modify the CommandRef register bits without affecting the command
  • Receive: activates the receiver circuits
  • Transceive: Transmit data from the FIFO buffer to antenna and automatically activates the receiver after transmission.
  • MFAuthent: performs the MIFARE standard authentication as a reader
  • SoftReset: This command performs a reset of the device. The configuration data of the internal buffer remains unchanged. All registers are set to the reset values. This command automatically terminates when finished.

PCD to PICC

Further there are also command set which PCD have to emit to communicate with PICC and enter the PICC into some state machine.

PICC States:

  1. Power-off State: In the POWER-OFF state, the PICC is not powered by a PCD operating field
  2. Idle State: In the IDLE state, the PICC is powered. It listens for commands and shall recognize REQA and WUPA commands. 
  3. Ready State: Cascade levels are handled inside this state to get the complete UID. PICC enters the ACTIVE state when it is selected with its complete UID.
  4. Active State: PICC complies with ISO-14443-4 to accept protocol activation commands (RATS)
  5. HALT State: In this state PICC only responds to WUPA command.
  6. Protocol State: PICC behaves according to 1s014443-4 specifications.

We will name these commands as PICC commands. Host MCU will write these PICC command into the PCD FIFO (refer the MFRC522 FIFO section on how to write the data on FIFO). PCD would transmit the FIFO data when it enters the Transceiver state machine (refer above topic).

PCD would transmit these commands via the electromagnetic induction and communicates with PICC via electronic coupling. PCD’s have RF transceivers through which it emits the electromagnetic waves with commands sets encoded in them. PICC have antenna and small circuitry, which gets energized via electromagnetic waves emitted by PCD and then further both PCD and PICC get coupled together to have 2 way wireless communication. How PCD would send commands to PICC and in return how PICC would respond, that is done according to IS014443 protocol. ISO14443 specifies all the frame formats,PICC command  and their format ,  modulation schemes for RFID technology. 

PICC Frame formats:

  1. Short Frame:
  2. Standard Frames

PICC Command Set:

  1. REQA/WUPA Command: This command is send by PCD to scan the valid and IS014443 compatible PICC’s.  This command is in short frame format. Host MCU will write this command into the PCD FIFO, from where this command is transmitted and emitted wirelessly. Response to this command is with ATQA. PICC are in Idle state when listening to this command and after successfully transmitting the ATQA response they enter into Ready State. These commands consist of 7 bits, as specified below:
  2. ANTICOLLISION/SELECT Command: PICC are in ready state when listening to this command and after this command they enter into ACTIVE STATE. This Command is used to get the UID of the scanned PICC and further select the corresponding PICC for Reading and writing data from it. For the MF1S503 PICC’s UID is of 4 bytes, for that only 1 cascade level is needed.

These commands need to be configured and then these bytes are written into The PCD FIFO for transmission and emission of signal to PICC wirelessly. This Command consists of:

  • Select code SEL(1byte): Specify the cascade level. 
  • No of valid bits NVB (1 byte): specify number of bytes that would be transmitted by PCD to PICC (including SEL, NVB and below point)
  • 0 to 40 data bits of UID according to value of NVB.

ANTICOLLISION Command consist of:

  1. Select Code: Cascade level 1= 0x93
  2. No of valid bits NVB = 0x20

Response to ANTICOLLISION Command is with the UID of the Scanned PICC(0xEA, 0x24, 0x77, 0x15) and its CRC(0xAC).

  1. SELECT Command consists of:
  • Select code: Cascade level 1 = 0x93
  • No of valid bits NVB – 0x70
  • 0 to 40 data bits of UID that has been received in ANTICOLLISION Command( 0xEA, 0x24, 0x77, 0x15)
  • CRCA(1 byte) : CRC of SELECT Command would be calculated by PCD and then it would be sent to PICC. And When PICC receives the SELECT Command it will check this CRCA and then will send the ACK.(0xAC)

Response to SELECT Command is with the Select Acknowledge:

MFRC522 Hardware and Pinout

MFRC522 IC has 32 pins in total and it comes in SOT617-1 package.

MFRC522 Pinout

Pin description can be found from the datasheet of MFRC522. To use the MFRC522 IC its module is widely available and quite inexpensive. Can be brought from Robu at cost of 150 rupees. With the module an RFID tag and a key fob tag of MIFRAME Classic 1KB comes in.

MFRC522 Module

In MFRC522 module, IC has 8 pins exposed out for connection and connecting to host MCU.

  • The module has 4 pins exposed out for connecting it to host MCU using either SPI, I2C or UART. By default, reader can communicate with a microcontroller over a 4-pin SPI with a maximum data rate of 10 Mbps. It also supports I2C and UART protocols. As told in MFRC522 functional description part, MFRC522 checks the host interface type automatically depending on the signals on it’s control pins.
  • MFRC522 module has 1 interrupt pin also exposed out, which can be used to trigger interrupts to alert the microcontroller when a RFID tag is in the vicinity.
  • And remaining 3 pins are power supply pins and a reset pin. Reset pin is used for power down mode and reset signal. Module requires the power supply of 3.3 V, that is provided via VCC and GND pins.

Other vendor RFID readers

STMicroelectronics

Texas Instruments

Infenion technologies

Sensor & Modules to explore

Technologies to Explore

Other Blog to Explore

Introduction of Nordiac NRF5xx SoC\’s

Table of Contents Overview on Nordic IoT Chips Nordic Semiconductor is a semiconductor MNC, which designs & develops a wide range of SoCs supporting IoT protocols. These SoC’s have all functionalities of Microcontroller(MCU) based on ARM cortex Processors, plus they embed 2.4ghz RF transceivers into the chips using RF-CMOS technology for making IoT chips. NRF52 and NRF51 series of SoC’s are widely accepted across the industries where there is a need for Low Power/Ultra Low Power consumption IoT solutions. Nordic Semiconductor NRF5xxx SoC is ideal for Ultralow power and cost-effective short-range wireless solutions. Typical applications for NRF5xxx SoC are: IoT(Internet of Things) devices Wearables Smart Home Wireless Mobile Phone Accessories PC Peripherals Beacons Bluetooth-enabled consumers NRF51 & NRF52 Series have all hardware support of MCU peripherals like ADC, SPI, I2C, UART, GPIO, TIMERS, etc, and 2.4ghz RF transceivers for hardware support of IoT protocols into the chip. Thus NRF5xxx series of SoC can be used for Embedded devices applications(Using MCU peripherals like UART, SPI, I2C, TIMERS, ADC, RTC, USB, etc.)and IoT applications( using protocols like BLE, ZigBee,  Thread, ANT, etc.) simultaneously. NRF5x Series supports the following short-range IoT protocols: BLE THREAD ZigBee ANT Near Field Communication  NRF Proprietary IoT protocols: ESBP & Gazell. Nordic Semiconductor also provides a full suite of IoT stacks to support of above IoT protocols. Nordic Semiconductor has named them Softdevices. To get to know about IoT protocols supported by Nordic chips you can refer to this. Nordic Semiconductor provides a wide range of development hardware from development kits to USB dongles for fast prototyping and hobbyists to play with NRF5x IoT Soc.  How to get started??  We will be using Nordic NRF52840 – DK, which is the official development board for the NRF52840 SoC. Now when I first got the NF52840 DK, it is very different from Arduino, STM, ESP boards. It has lots and lots of chips on it and quite fascinating to explore what all hardware is on it for what purposes. nRF52840-Development Kit At the same time, it is very confusing for me also on how to start with these IoT chips as they have so many features and functionalities on them. From MCU peripherals to IoT stacks, Crypto engines, Power management, analog features, and many more. nRF52 and nRF51 Chips So what I decided at first will start from exploring MCU peripherals, understanding peripheral driver header, and source files: HAL & LL. Subsequently will get to know about the Development environment and SDK of NRF chips. Starting from basics at first and then will move to IoT protocols, in that also we will first start from BLE and then to other IoT protocols. Those who don’t want to explore NRF52840 MCU peripherals can directly start from the BLE part of NRF5x chips. At first, we will make some application code using NRF5x MCU peripherals like GPIO, UART, SPI, I2C, TIMERS and etc. Will understand the HAL APIs provided by Nordic SDK for these peripherals. Will then interface different sensors and modules for making embedded devices. Then will understand the supported IoT protocols architecture and stacks. Now to get started with any MCU or SoC the first couple of things we have to understand are: Its Development Software: Software Development KIT(SDK), Integrated Development Environment (IDE), Debuggers, Environment setup for cross-compilation from our laptop/desktop to the designated MCU processor. Then we have to gather & understand the development board of the corresponding semiconductor chip. As development boards are the fastest and easiest way to get started with semiconductor chips. We will be using NRF52840- Development Board in this series and all the blogs and videos will be on it only.  Development Software for Nordic SoC’s Toolchain setup for Nordic SoC’s At first, we need an IDE. IDE provides a complete solution and one-stop environment for firmware development on microcontrollers. So Nordic Semiconductor provides 2 IDE for the development: Seger Embedded Studio and Arm® Keil µVision. The one which is recommended and preferred to use is Seger Embedded Studio (SES). So, in this tutorial series, we are going to use Seger Embedded Studio (SES). SES is a professional IDE that is highly recommended and used in the industry. SES is free to use for Nordic chips and its installation is pretty easy, can be downloaded from this link. Seger Embedded Studio Nordic chips are programmed and debugged using J-Links. Nordic NRF52840-DK has an onboard Jlink debugger and programmer. So we don’t have to care much about the hardware side of the debugger, but we have to install some software packs for using the Onboard J-Link debugger. We will install the Segger J-link Software and save it along with the same directory as that of SES. So that all that we have to set up for the toolchain of Nordic Chips, successfully installed the IDE and Debugger pack for Developing for Firmware on Nordic chips. At first, when we open the Segger Embedded Studio, it will open with a Hello world example as shown below. Segger Embedded Studio first time open page. How to get started with Seger Embedded Studio for NRF52840 nRF5 Series: Developing with SEGGER Embedded Studio (nordicsemi.com) Software Development Kit for Nordic SoC’s Once we have set up the toolchain, we will now explore and understand the SDK provided by Nordic. SDK includes the building blocks for developing applications. This includes the framework, peripheral libraries, Source & Header files of drivers, RF stacks, example codes for various applications, bootloaders and etc. Every MCU vendor provides the SDK, which is written in C/C++ languages to get started. One will write the source code in SES IDE using SDK provided by Nordic. Now as we navigate to the Nordic Semiconductor website under the Development Software Section, we will see there are a number of SDK packs which are listed: nRF 5 SDK nRF SDK for Mesh/Zigbee/Thread nRF Connect SDK nRF MDK Softdevices Overview of Nordiac SDK’s At first, it is very confusing for me & can’t figure out which SDK is for what

Read More »
ARM processors
Kunal Gupta

ARM Coresight: Debug and Trace in Embedded System

Table of Contents Definition of ARM CoreSight \”CoreSight is the Debug Architecture from ARM for Debugging and Trace Solutions in Complex SoC designs (Single core and Multi core)\” CoreSight Provides all the Infrastructure that is required to Debug, Trace, Monitor, and optimize the performance of a Complete System on Chip (SoC)Design. The Debug and Trace Features of the ARM Cortex M processors (M3/M4/M33/M7/M0, etc.) are designed based on the CoreSight Debug Architecture. This Architecture Covers a Wide Area Including Debug Interface protocols, on chip bus for debug access, Control of debug components, security features, trace data interface and more. Debug and Trace in Embedded Systems By now one obvious question to beginners or newbies that must have come in their mind is what is Debug and Trace. What are these features for which we have a whole complete Architecture called CoreSight? Why do we need Debug and Trace solutions in our Processors/Embedded Controllers? Is it not? For those readers They can check out this blog, providing you clarity and understanding of all such questions. One can Understand Debug and Trace Feature/Functionality as one of the Block/Unit of the Processor. Just like We have UART, SPI, I2C, etc. peripherals for our Microcontrollers for which we have separate Block, Architecture, Peripheral Memory Registers for accessing them and Communication Protocol pins in our Microcontroller. Same Way-out Debug/Trace is one of the peripherals which is present in our Processor for which it has its whole architecture and above Marked things. ARM Processor has CoreSight Architecture. MIPS Processor has EJTAG Architecture. IBM PowerPC processor has COP. (Units/Block of the Processor are not called peripherals, I have used the above term just to make u understand the analogy) What are Debug Features?? Features are used to observe or modify the state of parts of the design. This is also Called Invasive Debugging Execute instructions line by line function i.e., halting the processor after execution of each line of code(single stepping). Execute Instructions Function by function i.e., halting the processor after execution of each functions (Step Over) Return from the Function (Step Return/Step Out) Stop the processor (halting) Stop the Processor at a particular à line of code (called Breakpoint) àmemory address (Called Watchpoint) à coded condition of a variable or memory address is achieved (Conditional Breakpoint/Watchpoint) On can control the program execution (By points 1-5)so as to examine(Both read or Write) the change in value of bits of the MCU Peripheral registers and Core Processor Registers (like examining the contents of UART peripheral Registers to mark at which line of code data is received or transmitted by seeing the UART Status registers which has corresponding bits to indicate the event of receiving and transmit data). Debug frequently involves halting execution once a failure has been observed and collecting state information retrospectively to investigate the problem. There are 2 Communication Protocols For using Debug Features: SWD & JTAG JTAG is an industry Standard protocol (IEEE 1149.1) which is used for debugging and boundary scan testing. It is the de facto Serial Protocol which is present in almost every Processor Family other than ARM also like AVR 8 core, MIPS, PowerPC, etc. To be noted down: JTAG Requires 4 pins: TCK, TDI, TMS, TDO; the recent signal TRST is optional. ARM CoreSight Technology introduced the 2 wire Protocol SWD (Serial Wire Debug): SWCK and SWDIO which is used for Debugging all the ARM based Processors. The Serial Wire debug(SWD) protocol provides the same debug access features and supports parity error detection, which enables better reliability in systems with higher electrical noise. Therefore, the Serial Wire debug protocol is more favorable then JTAG Interface. Also, SWD and JTAG debug protocols share the same Connections: TCK and SWCL use the same pin, TMS and STDIO use the same pin.  The SWD port alone does not allow real-time tracing. What are Trace Features?? Trace refers to the process of capturing data that shows information about how the components in a design of a firmware are operating, executing, and performing. This is also Called Non-invasive Debugging. It is real-time (with a small timing delay) and can provide a lot of useful information without stopping the processor. Information like: Amount of execution time for each function(Statistical Profiling) Call hierarchy and execution time sequence of functions Event Execution timing(Timestamp) Clock cycles taken for execution of a particular Instruction. Examine or change the contents of the memory or peripherals at any time, even when the processor is running. This feature is often called on-the-fly memory access. Data Trace(Monitoring the Variable or Memory address in Real Time execution of Code  and Plotting their graph). Instruction Trace(information about Instruction execution of a Core)ETM & PTM). Instrumentation Trace (Printf () Statement via ITM). System trace Trace is an advanced version of Debugging as it analyzes the performance of our firmware code and how efficient it is in terms of memory and efficiency by capturing the various kinds of data when the CPU is running. For Trace features there are 2 Modes: 1 Serial-Pin model called Serial Wire Viewer à Using Serial Wire Output (SWO) with Serial Wire Debug (SWD) interface. The Serial Wire Output (SWO) pin can be used in combination with SWD. It is used by the processor to emit real-time trace data, thus extending the two SWD pins with a third pin. The combination of the two SWD pins and SWO pin enables Serial Wire Viewer (SWV) real-time tracing in compatible Arm® processors.  The Serial Wire Viewer (SWV) is a real-time trace technology that uses the Serial Wire Debug (SWD) port and the Serial Wire Output (SWO) pin. The Serial Wire Viewer provides advanced system analysis and real-time tracing without the need to halt the processor to extract the debug information. 2 Multi-pin Trace Port interface (4 data pins + 1 clock pin). For Capturing the Data There must be à  Source for generating the Trace data àSinks are the endpoints of trace data à Links provide Connection, triggering and flow of traced data between

Read More »

CONFIGURING THE OLED WITH STM32 MCU

In previous blog we covered a brief overview of how the OLED display works in microscopic level and also understood various types of OLED displays available in the market . In this blog we’ll be discussing  how to configure the SSD1306  display with the microcontroller and we’ll be  making the embedded driver as well.128×64 display is a dot matrix display , hence 128×64 =8192 total pixels . It is by turning on/off these pixels we display graphical image of any shape . It is the current provided to each pixel that varies the brightness. HARDWARE DESCRIPTION OLED Display chosen is driven by SSD1306 Driver IC although they are other ICs such as SSD1331 which can be used to drive the display . These ICs  are CMOS OLED Driver controller for dot-matrix system . OLED has 256 brightness steps .Besides 128×64 , 128×32 display resolution is also available. Specification of ssd1306 128×64 OLED Display Type: OLED (Organic Light Emitting Diode) Display Size: 128×64 pixels Display Driver: ssd1306 Display Colors: Monochrome (White), Yellow, and Blue Operating Voltage: 3.3V to 5V Interface: I2C Operating Current: ~20mA Display Structure OLED DISPLAY is mapped using GDDRAM page structure  OF SSD1306 GDDRAM or graphic display ram is a bit mapped static RAM . It holds the bit pattern to be displayed. The GDDRAM having size 128×64 is divided into 8 pages from PAGE 0 TO PAGE 7 which is used for monochrome matrix display . When data bit D0 – D7 is sent the row0 gets filled with D0 and D7 is written into the bottom row.  Display has 64 rows , 128 columns divided into 8 pages . Each page has 128 columns and 8 rows. Display 128 columns known as segments For displaying the graphical data in the first location , page address and column address both are set to 0 with the end address of page and column also being selected End of column and End of the page is 7FH and 07H respectively SSD1306 BLOCK DIAGRAM PIN ARANGEMENT SSD1306 FUNCTIONAL BLOCK DIAGRAM SSD1306 BLOCK DIAGRAM PIN ARANGEMENT SSD1306 FUNCTIONAL BLOCK DIAGRAM ADDRESSING MODE 1. PAGE ADDRESSING MODE 2.Horizontal Addressing Mode 3.Vertical Addressing Mode 1. PAGE ADDRESSING MODE In page addressing mode, after the display RAM is read/written, the column address pointer is increased automatically by 1.                                                                If the column address pointer reaches column end address, the column address pointer is reset to column start address but page address pointer not points to next page. Hence, we need to set the new page and column addresses in order to access the next page RAM content. We need to set lower two bits to ‘1’ and ‘0’ for Page Addressing Mode. In page addressing mode, the following steps are required to define the starting RAM access pointer location: Set the page start address of the target display location by command B0h to B7h. Set the lower start column address of pointer by command 00h~0Fh. Set the upper start column address of pointer by command 10h~1Fh 2.Horizontal Addressing Mode In horizontal addressing mode, after the display RAM is read/written, the column address pointer is increased automatically by 1. If the column address pointer reaches column end address, the column address pointer is reset to column start address and page address pointer is increased by 1. When both column and page address pointers reach the end address, the pointers are reset to column start address and page start address We need to set last two digits to ‘0’ and ’0’ for horizontal addressing mode. 3.Vertical Addressing Mode In vertical addressing mode, after the display RAM is read/written, the page address pointer is increased automatically by 1. If the page address pointer reaches the page end address, the page address pointer is reset to page start address and column address pointer is increased by 1. When both column and page address pointers reach the end address, the pointers are reset to column start address and page start address. We need to set last two digits to ‘0’ and ’1’ for vertical addressing mode. In normal display data RAM read or write and horizontal/vertical addressing mode, the following steps are required to define the RAM access pointer location: Set the column start and end address of the target display location by command 21h. Set the page start and end address of the target display location by command 22h. Hardware Pinout SDAThis pin is used to send data between master and slave with the acknowledgement of the master SCLThis is a clock signal that helps keeps the process in synchronization VCCA power supply of 3.3 V is required . More than 3.3V may damage the module GNDThis ground pin is connected to the ground supply ALGORITHM Select the I2C slave address and specify the operation that will be performed i.e Read 0x79 or Write 0x78. #define SSD1306_I2C_ADDR 0x78 Set the clock divide ratio and oscillator frequency . Bit 3-0 sets the clock divide ratio , Bit 7-4 sets the oscillator frequency SSD1306_WRITECOMMAND(0xD5); //–set display clock divide ratio/oscillator frequency SSD1306_WRITECOMMAND(0xF0); //–set divide ratio Set the multiplex ratio switching to any value ranging from 16-63 SSD1306_WRITECOMMAND(0xA8); //–set multiplex ratio(1 to 64) Display start line addressing in which the starting address of the display ram is determined . In our case this is set to zero and RAM row 0 is mapped to col 0 SSD1306_WRITECOMMAND(0x40); //–set start line address Set memory addressing mode using page addressing mode, horizontal addressing mode, vertical addressing mode. SSD1306_WRITECOMMAND(0x10); //00,Horizontal Addressing Mode;01,Vertical Addressing Mode;10,Page Addressing Mode (RESET);11,Invalid SSD1306_WRITECOMMAND(0xB0); //Set Page Start Address for Page Addressing Mode,0-7 Set column address using a triple byte first specifies the column setting , second column start and third column  end . Do the same for the page SSD1306_WRITECOMMAND(0x00); //—set low column address SSD1306_WRITECOMMAND(0x10); //—set high column address Set pre-charge period and VCOMH deselect level SSD1306_WRITECOMMAND(0xDB); //–set vcomh Entire display is on using A4H and A5H command SSD1306_WRITECOMMAND(0xA4); //0xa4,Output follows RAM content;0xa5,Output ignores RAM content The normal functionality of the

Read More »
Automotive
Kunal Gupta

What is E/E Architecture in Automotive

Ever Though how electronics is implemented and arranged in a vehicle???? Explore this blog to get the Answer| ||| What is E/E Architectute || Domain Architecture || Zonal Architecture

Read More »

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

Read More »
Kunal Gupta
Author: Kunal Gupta

Author

Kunal Gupta

Leave a comment

Stay Updated With Us

Error: Contact form not found.

      Blog