0% found this document useful (0 votes)
17 views27 pages

Revised Body

Ifi

Uploaded by

vamshibhai053
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views27 pages

Revised Body

Ifi

Uploaded by

vamshibhai053
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Roll No.

23KD5A0213

INTRODUCTION

A Microchip embedded system refers to a dedicated computer system built around a


microcontroller chip manufactured by Microchip Technology, which combines a processing unit
(CPU) with various peripherals like analog-to-digital converters, timers, and communication interfaces
on a single chip, allowing it to control specific functions within a larger device with minimal external
components, commonly used in applications like appliances, industrial machinery, and consumer
electronics; essentially, it's a small, specialized computer designed to perform a single task efficiently.

Embedded systems are categorized in various ways, including:

 Functional requirements
Embedded systems can be categorized based on their functional requirements, such as:

 Real-time: These systems are required to produce output within a specified timeinterval.
They are often used in medical, military, and industrial sectors.
 Standalone: These systems can perform tasks without a host system or externalprocessing
resources. Examples include digital watches, cameras, and MP3 players.

 Networked: These systems rely on a network connection to perform tasks. Examplesinclude


home security systems and point-of-sale systems.

 Mobile: These systems are small and portable, such as smartphones and laptops.
Microcontroller performance

Embedded systems can also be categorized based on the microcontroller's performance. These
include:
 Small-scale: These systems are designed with an 8-bit or 16-bit microcontroller andcan be
powered by a battery.
 Medium-scale: These systems are designed with a 16-bit or 32-bit microcontroller andare faster
than small-scale systems.
 Complex: These systems are designed with a 32-bit or 64-bit microcontroller and areused to
perform more complex functions

1
Roll No. 23KD5A0213

Key points about Microchip Embedded Systems:


 Microcontroller core:

The heart of a Microchip embedded system is a microcontroller, most commonly from their PIC
(Peripheral Interface Controller) or dsPIC (Digital Signal Processor PIC) families, offering different
levels of processing power and features depending on the application.
 Peripherals on-chip:

These microcontrollers integrate various peripherals like analog-to-digital converters (ADCs),


digital- to-analog converters (DACs), communication interfaces (UART, SPI, I2C), timers, and
memory directly on the chip, simplifying hardware design.
 Programming language:

Embedded systems are typically programmed in C or assembly language, with Microchip


providing development tools like MPLAB IDE to write, compile, and debug code.

Applications:

Microchip embedded systems are used in a wide range of applications including:

 Consumer electronics: Remote controls, smart appliances, toys


 Industrial automation: Motor control, sensor data acquisition

 Automotive industry: Engine management, dashboard displays


 Medical devices: Patient monitoring systems, implantable devices

Benefits of Microchip embedded systems:


 Cost-effective:
Microchip microcontrollers are generally considered to be cost-competitive, making them
suitable fora wide range of applications.
 Wide product range:

Microchip offers a diverse selection of microcontrollers with varying processing power, memory
size,and peripheral capabilities, allowing developers to choose the optimal chip for their needs.
 Ease of development:
The MPLAB IDE and supporting libraries provide a user-friendly development environment.

 Reliable performance:
Microchip microcontrollers are known for their stability and reliability in demanding environments.

2
Roll No. 23KD5A0213

8 Bit Microcontrollers

Microcontroller

Microcontrollers may be called computers on-chip. A combination of a controller, internal


ROM, RAM, parallel and serial ports is a Microcontroller. Microcontrollers are dedicated devices
embedded within an application. Ex:- as an engine controller in automobiles, as an exposure and
focus controller in cameras. On-chip peripheral is selected depending on the specifics of the target
application.
As we know that the Microcontrollers are powerful digital processors, the degree of control and
programmability in which they provide significantly enhances the effectiveness of the application.
Types of Microcontroller
(1) 8051 (2) PIC (3) AVR (4) ARM
8051 Microcontroller
Intel designed the first microcontroller and this is known as the 8051 microcontrollers.
Thismicrocontroller was introduced in the late 1970 and in 1981 it was developed by Intel.
8051 microcontroller is an 8-bit microcontroller. 8051 microcontroller has the ability to read,
write and process 8-bit data. It is widely used in embedded systems, consumer electronics, robotics,
etc. The peripherals of this microcontroller are integrated into a single chip, and the overall system
cost isvery low.
The size of the product is small as compared to the microcontroller-based system thus very
handy.All features are available in 40 pin IC of the 8051 microcontrollers.

3
Roll No. 23KD5A0213

Applications of 8051 microcontrollers:


(1) Home appliances like Microwave Oven, Washing machines, etc.

(2) Light sensing and controlling devices like audio systems.

(3) Temperature sensing and control devices.

(4) Fire detection and safety devices such as home security systems.

(5) Other devices like calculator, ATM machine, etc.

PIC Microcontroller

PIC stands for Programmable Interface Controllers. It was developed by a Microchip average.
It is fast and simple to implement program when we compare with other microcontrollers like 8051.
Theease of programming and simple to interfacing with other peripherals PIC become successful
microcontroller.

AVR Microcontroller

AVR microcontroller was developed in the year of 1996 by Atmel Corporation. The structural
designof AVR was developed by the Alf-Egil Bogen and Vegard Wollan. It is commonly accepted that
AVRstands for Alf and Vegard’s RISC microcontroller, which is also known as Advanced Virtual
RISC.

The AT90S8515 was the initial microcontroller which was based on the AVR architecture, though the
first microcontroller to hit the commercial market was AT90S1200 in the year 1997.

ARM Processor

Advanced RISC Machine (ARM) this microcontroller was introduced by Acron Computer
Organization. It is manufactured by Apple, Qualcomm, Motorola, etc. The Processor of the ARM
microcontroller belongs to the family of CPUs which are based on Reduced Instruction Set
Computer (RISC) and also ARM Microprocessor. An ARM makes at 32-bit and 64-bit RISC multi-
core processors. The speed of the ARM microcontroller is 1 clock cycle per machine cycle and the
power consumption is low.

4
Roll No. 23KD5A0213

. Introduction of MPLAB X IDE

What is MPLAB IDE?


MPLAB X Integrated Development Environment (IDE) is a software tool that helps users
develop embedded applications for Microchip's microcontrollers and digital signal controllers.
It can be installed on Windows, Linux, and Mac operating systems.

Here are some of the features of MPLAB X IDE:


 Text editor: A full-featured text editor with code completion, context menus, and a task
navigator
 Project manager: Integrates and communicates with language tools
 Debugger: Includes breakpoints, watch windows, and I/O views
 Data visualizer: Views real-time streaming data
 Design resources: Links to datasheets, user guides, and software libraries
 Cross-platform: Supports multiple tools on multiple projects with multiple
configurations and simultaneous debugging
 Open-source platform: Supports free software components and plug-ins from the
NetBeans community.

MPLAB X IDE supports a wide range of Microchip's 8-bit, 16-bit, and 32-bit
microcontrollers. It also supports third-party software and hardware development tools.

MPLAB is a proprietary freeware integrated development environment for the development


of embedded applications on PIC and dsPIC microcontrollers, and is developed by Microchip
5
Roll No. 23KD5A0213

Technology.[1][2][3][4][5][6][7][8]

MPLAB Extensions for Visual Studio Code and MPLAB X for NetBeans platform are
the latesteditions of MPLAB.[9][10][11] MPLAB and MPLAB X support project management,
code editing,debugging and programming of Microchip 8-bit PIC and AVR (including
ATMEGA) microcontrollers, 16-bit PIC24 and dsPIC microcontrollers, as well as 32-bit SAM
(ARM) and PIC32 (MIPS) microcontrollers.

MPLAB is designed to work with MPLAB-certified devices such as the MPLAB ICD
3 and MPLAB REAL ICE, for programming and debugging PIC microcontrollers using a personal
computer. PICKit programmers are also supported by MPLAB.

6
Roll No. 23KD5A0213

MPLAB X supports automatic code generation with the MPLAB Code Configurator and the
MPLAB Harmony Configurator plugins.

Implementing an Embedded System Design with MPLAB X IDE

A development system for embedded controllers is a system of programs running on a


computer that help to write, edit, debug and program code – which is the intelligence of embedded
systems applications – into a microcontroller. MPLAB X IDE is such a system, it contains all the
componentsneeded to design and deploy embedded systems applications.

The typical tasks for developing an embedded controller application are:


1. Create the high level design. From the features and performance desired, decide which MCU is
best suited to the application, then design the associated hardware circuitry. After determining which
peripherals and pins control the hardware, write the firmware – the software that will control the
hardware aspects of the embedded application. A language tool such as an assembler, which is
directly translatable into machine code, or a compiler that allows a more natural language for
creating programs, should be used to write and edit code. Assemblers and compilers help make the
code understandable, allowing function labels to identify code routines with variables that have
names associated with their use, and with constructs that help organize the code in a maintainable
structure

2. Compile, assemble and link the software using the assembler and/or compiler and linker to
convert your code into “ones and zeros” – machine code for the MCUs. This machine code will
eventually become the firmware (the code programmed into the microcontroller).

3. Test your code. Usually a complex program does not work exactly the way imagined, and “bugs”
need to be removed from the design to get proper results. The debugger allows you to see the “ones
and zeros” execute, related to the source code you wrote, with the symbols and function names from
your program. Debugging allows you to experiment with your code to see the value of variables at
various points in the program, and to do “what if” checks, changing variable values and stepping
through routines.

4. “Burn” the code into a microcontroller and verify that it executes correctly in the finished
application. Of course, each of these steps can be quite complex. The important thing is to
concentrate on the details of your own design, while relying upon MPLAB X IDE and its
components to get through each step without continuously encountering new learning curves.

7
Roll No. 23KD5A0213

Generating Started with PIC MICROCONTROLLER

In 1980, Intel developed the first Microcontroller (8051) with Harvard Architecture 8051
andsince then Microcontrollers brought a revolution in Electronics and embedded industry.
And with the technological advancement over the time, now we have many more efficient and
lowpower microcontrollers like AVR, PIC, ARM. These Microcontrollers are more capable
andeasy to use, having the latest communication protocols like USB, I2C, SPI, CAN
etc. Even Arduino and Raspberry Pi have completely changed the perspective towards
Microcontrollers, and Raspberry Pi is not just a microcontroller but it has whole computer
inside

Writing Your First Program with PIC Microcontroller and Setting up Configuration Bit
Creating a New Project using MPLAB-X:

Step 1: Launch the MPLAB-X IDE that we installed in the previous class, once loaded it
should look something like this.

Step 2: Click on Files -> New Project, or use the hotkey Ctrl+Shift+N. You will get the
following POP-UP, from which you have to select Standalone Project and click Next.

Step 3: Now we have to select our Device for the project. So type as PIC16F877A over
the Select Device dropdown section. Once done it should be like this and then Click on Next.

8
Roll No. 23KD5A0213

Step 4: The next page will allow us to select the tool for our project. This would be PicKit 3
for our project. Select PicKit 3 and click on next

Step 5: Next page will ask to select the compiler, select the XC8 Compiler and click next.

Step 6: In this page we have to name our project and select the location where the project has
to be saved. I have named this Project as Blink and saved it on my desktop. You can name and
save it in your preferable way. Our project will be saved as a folder with the Extension .X,
which can be directly launched by MAPLB-X. Click Finish once done.

9
Roll No. 23KD5A0213

Step 7: That's it!!! Our project has been created. The left most window will show the project
name (Here Blink), click on it so that we can view all the directories inside it.
In order to start programming we need to add a C Main file, inside our Source file directory.
To do this simply right click on the source file and select New -> C Main File, as shown in the
image below.

Step 8: The following dialog box will appear in which the name of the C-file has to be
mentioned. I have named in Blink again, but the choice is left to you. Name it in the File name
column and click on finish.

Step 9: Once the C main File is created, the IDE will open it for us with some default codes
in it, as shown below.

Step 10: That's it now we can start programming our code in the C-main File. The default
code will not be used in our tutorials. So let's delete them completely.

10
Roll No. 23KD5A0213

Syntax and Structure of C


The embedded C programming language uses the same syntax and semantics as the C
programming language. The only extension in the Embedded C language from normal C
Programming Language is the I/O Hardware Addressing, fixed- point arithmetic
operations, accessing address spaces.

Basic Structure of Embedded C Program:


The embedded C program has a structure similar to C programming.

The five layers are:


1. Comments
2. Pre-processor directives
3. Global declaration
4. Local declaration
5. Main function ()
Main Function Section:
All C programs need to have the main function. So does an embedded C program. Each
main function contains 2 parts. A declaration part and an Execution part. The declaration
part is the part where all the variables are declared. The execution part begins with the curly
brackets and ends with the curly close bracket. Both the declaration and execution part are
inside the curly braces.
Variables: variable is a symbolic name used to address a certain memory location. The
compiler will replace all variable names with their corresponding memory addresses.
Functions:
Objectives:
In this chapter you will learn to write more complex programs using functions. Both,
thebuilt-in standard functions as well as programmer defined functions, will be discussed.
As a special case, the generation of random numbers will be treated. You will learn
howto pass information to and retrieve information from a function. Attention will also
be given to the scope of variables used in the different functions of your program.
Data type examples:
• Read bits from GPIOA (16 bits, non-numeric)
– uint16_t n; n = GPIOA->IDR; //or: unsigned short n;
• Write TIM2 presale value (16-bit unsigned)
– uint16_t t; TIM2->PSC = t; //or: unsigned short t;
• Read 32-bit value from ADC (unsigned)
– uint32_t a; a = ADC; //or: unsigned int a

• System control value range [-1000…+1000]


– int32_t ctrl; ctrl = (x + y) *z; //or: int ctrl;

• Loop counter for 100 program loops (unsigned)


11
Roll No. 23KD5A0213

– uint8_t cnt; //or: unsigned char cnt;


– for (cnt = 0; cnt < 20; cnt++) {

Variable arrays:
• An array is a set of data, stored in consecutive memory locations, beginning at a named
address–
Declare array name and number of data elements, N– Elements are “indexed”, with indices
[0 ... N-1]

C control structures:
• Control order in which instructions are executed (program flow)
• Conditional execution
– Execute a set of statements if some condition is met – Select one set of statements to be
executed from several options, depending on one or more conditions
• Iterative execution
– Repeated execution of a set of statements
• A specified number of times, or
• Until some condition is met, or
• While some condition is true

C functions:
• A function is “called” by another program to perform a task
– The function may return a result to the caller
– One or more arguments may be passed to the function/procedure

Pointers:
• Objectives:
In this chapter the basic concepts of pointers are explained.
At the end of this chapter, one should be able to:
- declare and initialize a pointer
- use pointers and pointer operators
- understand the close relationship between pointers and arrays
- use pointers to pass arguments by reference to a function - use pointers to functions

12
Roll No. 23KD5A0213

Declaration

Like every variable in C, a pointer variable must be declared before it can be used. In
itsmost general form, a pointer declaration can be written as:
<target datatype> * <name>;
The * in the declaration indicates that the variable is a pointer. For instance, int *ptr;
declares the pointer variable with name ptr that can point to a variable of the type int.

13
Roll No. 23KD5A0213

Advanced C Programming

Structures and unions:


The implementation of Structure in C occurs internally- because it contains separate
memory locations allotted to every input member. In the case of a Union, the memory
allocation occurs for only one member with the largest size among all the input variables.
It shares the same location among all these members/objects.

Union in C:
Union is a user defined datatype that allows storage of heterogeneous elements in
the same memory location. Size of the union is the size of the largest element in the
union.Below is the picturesque representation of a union.

Pointer review:
Pointers are symbolic representation of addresses. They enable programs to simulate
call-by- reference as well as to create and manipulate dynamic data structures. It’s general
declaration in C/C++ has the format:

Syntax:

datatype *var_name; int *ptr; //ptr can point to an

address which holds int data

14
Roll No. 23KD5A0213

Array of Pointers in C:
In C, a pointer array is a homogeneous collection of indexed pointer variables that are
references to a memory location. It is generally used in C Programming when we want to
point at multiple memory locations of a similar data type in our C program. We can access
the data by dereferencing the pointer pointing to it.

Syntax: pointer type *array name [array size]; Here, pointer type: Type of data the
pointer is pointing to. array name: Name of the array of pointers.
array size: Size of the array of pointers.

Function Pointer in C:
In C, like normal data pointers (int *, char *, etc.), we can have pointers to functions.
Following is a simple example that shows declaration and function call using function
pointer.

#include <stdio.h>
// A normal function with an int parameter
// and void return type void fun (int a)
{ printf ("Value of a is %d\n", a); }
int main ()
{
// fun_ptr is a pointer to function fun() void (*fun_ptr)(int) = &fun;
/* The above line is equivalent of following two void (*fun_ptr) (int); fun_ptr =
&fun; */
// Invoking fun() using fun_ptr (*fun_ptr)
(10); return 0;
}

Output:
Value of a is 10

15
Roll No. 23KD5A0213

C Programming: Linked list data structure,


Callbacks
Linked List
o Linked List can be defined as collection of objects called nodes that are randomly stored in
the memory.
o A node contains two fields i.e. data stored at that particular address and the pointer which
contains the address of the next node in the memory.
o The last node of the list contains pointer to the null.

Uses of Linked List


o The list is not required to be contiguously present in the memory. The node can reside any
where in the memory and linked together to make a list. This achieves optimized utilization
of space.
o list size is limited to the memory size and doesn't need to be declared in advance.
o Empty node can not be present in the linked list.
o We can store values of primitive types or objects in the singly linked list.
Why use linked list over array?
Till now, we were using array data structure to organize the group of elements that are to be
storedindividually in the memory. However, Array has several advantages and disadvantages which
mustbe known in order to decide the data structure which will be used throughout the program.
Array contains following limitations:
1. The size of array must be known in advance before using it in the program.
2. Increasing size of the array is a time taking process. It is almost impossible to expand the size
of the array at run time.
3. All the elements in the array need to be contiguously stored in the memory. Inserting any
element in the array needs shifting of all its predecessors.
Linked list is the data structure which can overcome all the limitations of an array. Using linked
listis useful because:

16
Roll No. 23KD5A0213

1. It allocates the memory dynamically. All the nodes of linked list are non-contiguously stored
in the memory and linked together with the help of pointers.
2. Sizing is no longer a problem since we do not need to define its size at the time of
declaration. List grows as per the program's demand and limited to the available memory
space.
Singly linked list or One way chain
Singly linked list can be defined as the collection of ordered set of elements. The number of
elementsmay vary according to need of the program. A node in the singly linked list consist of two
parts: datapart and link part. Data part of the node stores actual information that is to be represented
by the node while the link part of the node stores the address of its immediate successor.
One way chain or singly linked list can be traversed only in one direction. In other words, we
can saythat each node contains only next pointer, therefore we can not traverse the list in the reverse
direction.
Consider an example where the marks obtained by the student in three subjects are stored in a
linkedlist as shown in the figure.

In the above figure, the arrow represents the links. The data part of every node contains the marks
obtained by the student in the different subject. The last node in the list is identified by the null
pointer which is present in the address part of the last node. We can have as many elements we
require, in the data part of the list.

Callback in C:

A callback is any executable code that is passed as an argument to another code, which
is expected to call back (execute) the argument at a given time. In simple language, If a reference
of a function is passed to another function as an argument to call it, then it will be called a
Callback function.

17
Roll No. 23KD5A0213

Advanced Embedded C tips, tricks and cautions


Tips:
Efficient Memory Usage:
In embedded systems, memory is often limited. Optimize your code for memory usage
byminimizing global variables, using data types that match your needs precisely (e.g., using
uint8_t instead of int if you only need 8 bits), and consider using flash memory efficiently
for constants.

Interrupt Handling:
Understand how to handle interrupts effectively. Keep interrupt service routines (ISRs)
as short and fast as possible, avoiding complex operations and lengthy code execution
withinthem.

Static Analysis Tools:


Utilize static code analysis tools like MISRA-C or lint to catch potential issues
in your code before they become problems. These tools can help enforce coding
standards and identify potential bugs.

Low-Power Modes:
Learn how to use low-power modes and sleep modes effectively to conserve energy in
battery- powered embedded systems. This is crucial for extending the battery life of
devices.

RTOS (Real-Time Operating System):


Consider using an RTOS if your project requires multitasking and complex scheduling.
Familiarize yourself with the principles of task scheduling, synchronization mechanisms,
and memory management in an RTOS environment.

Tricks:
Bit Manipulation: Master bitwise operations for tasks like setting, clearing, or toggling
specific bits in registers. This is often necessary for configuring hardware peripherals
and optimizing memory usage.
Inline Assembly: In some cases, inline assembly code can be used to optimize critical
sections of your code, especially when dealing with hardware-specific operations.

Memory-Mapped Registers: Understand memory-mapped registers and how to


manipulate hardware peripherals directly by writing to and reading from these
registers. This can lead to efficient and precise control of hardware.

18
Roll No. 23KD5A0213

Optimized Algorithms: Explore algorithms that are tailored for embedded systems, such
as fixed-point arithmetic for platforms without a floating-point unit or optimized data
structures for specific use cases.

Cautions:

Resource Constraints: Always keep in mind the limitations of your hardware,


including CPU speed, memory, and I/O capabilities. Attempting to run code that
exceeds these constraints can lead to unpredictable behavior.
Timing and Synchronization: Be cautious when dealing with timing-critical operations,
as embedded systems are highly dependent on precise timing. Avoid long, non-
deterministic code execution within critical sections.

Peripheral Configuration: Improperly configuring hardware peripherals can lead to


system failures or erratic behavior. Always refer to the datasheet and reference manual
of your microcontroller for accurate configuration details.
Code Maintainability: While optimizing for performance is essential, maintainability is
equally important. Be cautious not to over-optimize to the point where your code becomes
unreadable and difficult to maintain.

Testing and Validation: Rigorously test your code, especially in real-world conditions that
mimic the actual environment in which your embedded system will operate. Consider edge
cases, fault tolerance, and error handling in your testing procedures.

Remember that embedded programming often involves a delicate balance between


performance, resource constraints, and reliability. Continuously improving your skills and
staying up-to-date with the latest developments in embedded systems can help you navigate
these challenges effectively

19
Roll No. 23KD5A0213

Internet of things
Internet of things (IoT)

It describes devices with sensors, processing ability, software and other technologies that connect
and exchange data with other devices and systems over the Internet or other communication
networks.[1][2][3][4][5] The Internet of things encompasses electronics, communication, and computer
science engineering. "Internet of things" has been considered a misnomer because devices do not need
to be connected to the public internet; they only need to be connected to a network[6] and beindividually
addressable.[7][8]

The field has evolved due to the convergence of multiple technologies, including ubiquitous
computing, commodity sensors, and increasingly powerful embedded systems, as well as machine
learning.[9] Older fields of embedded systems, wireless sensor networks, control systems,
automation (including home and building automation), independently and collectively enable the
Internet of things.[10] In the consumer market, IoT technology is most synonymous with "smart home"
products, including devices and appliances (lighting fixtures, thermostats, home security systems,
cameras, and other home appliances) that support one or more common ecosystems and can be
controlled via devices associated with that ecosystem, suchas smartphones and smart
speakers. IoT is also used in healthcare systems.[11]

There are a number of concerns about the risks in the growth of IoT technologies and products,
especially in the areas of privacy and security, and consequently there have been industry and
government moves to address these concerns, including the development of international and local
standards, guidelines, and regulatory frameworks.[12] Because of their interconnected nature, IoT
devices are vulnerable to security breaches and privacy concerns. At the same time, the way these
devices communicate wirelessly creates regulatory ambiguities, complicating jurisdictional
boundaries of the data transfer.[13]

20
Roll No. 23KD5A0213

What technologies have made IoT possible?

While the idea of IoT has been in existence for a long time, a collection of recent
advancesin a number of different technologies has made it practical.
Access to low-cost, low-power sensor technology. Affordable and reliable sensors
aremaking IoT technology possible for more manufacturers.
Connectivity: A host of network protocols for the internet has made it easy to connect
sensors to the cloud and to other “things” for efficient data transfer.

Cloud computing platforms. The increase in the availability of cloud platforms


enables both businesses and consumers to access the infrastructure they need to scale
up without actually having to manage it all.

Machine learning and analytics. With advances in machine learning and analytics, along
with access to varied and vast amounts of data stored in the cloud, businesses can gather
insights faster and more easily. The emergence of these allied technologies continues to
push the boundaries of IoT and the data produced by IoT also feeds these technologies.

Conversational artificial intelligence (AI). Advances in neural networks have brought


natural- language processing (NLP) to IoT devices (such as digital personal assistants
Alexa, Cortana, and Siri) and made them appealing, affordable, and viable for home use.

21
Roll No. 23KD5A0213

Exploring Bluetooth Low Energy from


First Steps to Final App

BLE only transmits data in one direction. Let’s take a look at a BLE beacon attempting
to communicate with a nearby smartphone. A Bluetooth beacon device periodically
broadcasts data packets. Nearby smartphones using specific apps or pre-installed services
can detect these data packets.

BLE data transfer is one-way communication. Let’s use a nearby smartphone as an


exampleof a BLE beacon trying to interact with it. A Bluetooth beacon device transmits data
packets at regular intervals. Nearby smartphones using specific apps or pre-installed
services can detect these data packets. This BLE communication can trigger actions such
as message push or app marketing. To conserve energy and provide quicker data transfer,
the whole Bluetooth BLE communication structure consists of 40 frequency channels, each
separatedby 2MHz. Among these, three channels are classified as data channels and serve
as the primary channels for commercials. The Bluetooth communication starts with these
three principal advertisement channels, followed by the secondary channels.

Compared to other low-power wireless technologies like ZigBee, Z-wave, and


Wavenis, BLE has achieved the highest level of popularity. It is more energy- efficient than
its competitors, such as the ZigBee and ANT protocols. BLE stands out from other wireless
technologies like Bluetooth and Wi-Fi due to its minimal power consumption and low
energy requirements. However, many of its privacy and security flaws stem from its
flattened protocol stack.

22
Roll No. 23KD5A0213

Given that BLE is currently used by billions of devices, it is crucial to examine its
securityflaws. While these personal and commercial gadgets enhance our lives and boost
productivity, they also make systems more vulnerable to attacks. The prevalence of BLE in
healthcare applications raises concerns about serious security and privacy issues. Once a
BLE connection is established, it is considered practically unbreakable.

23
Roll No. 23KD5A0213

However, BLE devices are still susceptible to eavesdropping, pin cracking, Man- In-
The- Middle (MITM) attacks, and other threats, particularly due to improper pairing,
unsuitable authentication, and poor protocol implementation (e.g., lack of adequate
encryption). Consequently, security flaws can lead to stolen personal data, unlocked smart
locks, misinterpreted messages, IoT devices running out of battery unexpectedly, and more.

Bluetooth LE security modes The Generic Access Protocol (GAP) for a BLE
connection specifies two security modes and several security levels for each mode.

There are four levels of security in Security Mode 1, which uses encryption to establish
security.
Security Level 1 – No Security (No Encryption and No Authentication)
Security Level 2 – Unauthenticated pairing with encryption

Security Level 3 – Authenticated pairing with AES-CCM encryption


Security Level 4 – Authenticated LE Secure Connections pairing with encryption.
Elliptic Curve Diffie-Hellman P-256 (ECDH) and AES-CCM encryption are

A communication network enables shared computing, where many users or terminals can
access the same computer system. In specific scenarios, shared computing can enable one
central system to handle the brunt of the work and distribute its results among multiple users
who lack that capability.
Communication networks are also used in decentralized computing, where many
computers can work together as peers. These networks help make it possible to transfer data
from one point to another. For instance, whatever device you use to read this webpage is
wirelessly connected to the All About Circuits server in some other part of the world. From
there, information is moved from the server to your device, allowing you to read this article.
An important point to note is that, for the different devices in the network to communicate or
share data effectively, they must speak a common language. This is where communication
protocols come into play.

24
Roll No. 23KD5A0213

Creating Sensor Node for Azure IOT Central

An IoT Central application lets you monitor and manage millions of devices throughout
their life cycle. This guide is for device developers who implement the code to run on
devices that connect to IoT Central.
Devices interact with an IoT Central application by using the following primitives:

Telemetry is data that a device sends to IoT Central. For example, a stream of
temperaturevalues from an onboard sensor.
Properties are state values that a device reports to IoT Central. For example, the current
firmware version of the device. You can also have writable properties that IoT Central can
update on the device such as a target temperature. Commands are called from IoT Central
to control the behavior a device. For example, your IoT Central application might call a
command to reboot a device.

Types of devices:

The following sections describe the main types of devices you can connect to an IoT
Centralapplication:
• IoT device

An IoT device is a standalone device that connects directly to IoT Central. An IoT
device typically sends telemetry from its onboard or connected sensors to your IoT Central
application. Standalone devices can also report property values, receive writable property
values, and respond to commands.
• IoT Edge device

An IoT Edge device connects directly to IoT Central. An IoT Edge device can send its
own telemetry, report its properties, and respond to writable property updates and
commands. IoT Edge modules process data locally on the IoT Edge device. An IoT Edge
device can also act as an intermediary for other devices known as downstream devices.
Scenarios thatuse IoT Edge devices include:

25
Roll No. 23KD5A0213

Aggregate or filter telemetry before it's sent to IoT Central. This approach can help
reducethe costs of sending data to IoT Central.
Enable devices that can't connect directly to IoT Central to connect through the IoT
Edge device. For example, a downstream device might use Bluetooth to connect to the IoT
Edgedevice, which then connects over the internet to IoT Central.
Control downstream devices locally to avoid the latency associated with connecting to
IoTCentral over the internet.
IoT Central only sees the IoT Edge device, not the downstream devices connected to
the IoT Edge device.

Azure IoT Central is a ready-made UX and API surface for connecting and managing
devices at scale, delivering reliable data for business insights. It preassembles platform as a
service (PaaS) offering, bringing together each service beneath it for an easy-to-configure,
comprehensive, andsecure IoT offering.

26
Roll No. 23KD5A0213

CONCLUSION

In conclusion, microchip-based embedded systems provide a powerful and


versatile solution for a wide range of applications by integrating a compact
microcontroller withnecessary peripherals onto a single chip, enabling efficient, low-
power design with highreliability, making them ideal for applications demanding precise
control and real-time processing across various industries like automotive, medical
devices, and industrial automation; further enhanced by readily available development
tools and robust software frameworks from Microchip, facilitating rapid prototyping
and streamlined development processes.

This Internship titled “MICROCHIP EMBEDDED SYSTEM DEVELOPER


VIRTUAL INTERNSHIP” attained the following PO’s and PSO’s:

Program Outcomes:

PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12

Program Specific Outcomes:

PSO1 PSO2

27

You might also like