Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 24

EMBEDDED SYSTEM AND IOT

Introduction of Embedded system & IOT


8-bit microcontroller (8051)
Minor project based on (8051)
ARM 7/cortex m-3 (32-bit microcontrollers)
ARM Protocols
IPC In Linux
•An embedded system is some combination of computer
hardware and software, either fixed in capability
or programmable, that is specifically
designed for a particular function

What makes Embedded systems


different?
•Real time operation
• Size
• Cost
• Time
• Reliability
• Safety
• Energy
Microcontroller is a VLSI chip which consist of a
CPU
CPU is a device Which executes instruction
AUTOMATED TOLL PLAZA USING RFID AND GSM
(BASED ON 8051)

Hardware used:-
• 8051 Microcontroller
• RFID Reader
• GSM Module
• LCD interface

Software used:-
•Kiel μVision IDE
• Uart protocol( flash-
magic)

Block diagram
•A RFID tags used to indentified the unique ID
number
•The controller then matches the unique
code to the Central Database. Stipulated
price of the toll will be deducted from his
account..
•Then an SMS will be sent to the owner
using the GSM module about how much
money has been debited from his account. General assembly

APPLICATIONS
•Thus it can be installed inside the car from where it is not visible.

•As the cars need to be at a specified position for the system to scan the number plate

which is not required in RFID based system.


•Security is an added advantage
Block diagram of ARM based microcontroller
Important Protocols of ARM

•I2C

•Features of I2C
Only two bus lines are required; a serial data line (SDA) and a serial clock line (SCL)
•Each device connected to the bus is software addressable by a unique address and simple
master/slave relationships exist at all times;
•masters can operate as master-transmitters or as master-receivers
•It’s a true multi-master bus including collision detection and arbitration to prevent data
corruption if two or more masters simultaneously initiate data transfer
•Serial, 8-bit oriented, bi-directional data transfers can be made at up to 100 kbit/s in the
Standard-mode, up to 400 kbit/s in the Fast-mode, or up to 3.4 Mbit/s in the High-speed
mode.
•On-chip filtering rejects spikes on the bus data line to preserve data integrity
•The number of ICs that can be connected to the same bus is limited only by a maximum
bus capacitance of 400 pF
Control area network (CAN)

•The CAN Bus is an automotive bus developed by Robert Bosch

•CAN is a serial bus protocol to connect individual systems and


sensors as an alternative to conventional multi-wire looms.

•The Controller Area Network (CAN) is a serial communication way,


which efficiently supports distributed real-time control with a very
high level of security.
•It allows automotive components to
communicate on a dual-wire
networked data bus up to 1Mbps

•CAN is based on the “broadcast


communication mechanism”, which
is based on a message-oriented
transmission protocol.
SPI---Serial Peripheral Interface
•The Serial Peripheral Interface (SPI) bus was
developed by Motorola to provide full-duplex
synchronous serial communication between
master and slave devices.

•SPI can be clocked up to 10 MHz.

•The SPI busis commonly used


for communication with Flash memory,
•sensors, real-time clocks
(RTCs), analog-to-digital converters,
and more
•SPI
Modes in SPI

•The frame of the data exchange is described by two


parameters, the clock polarity (CPOL) and the clock
phase (CPHA).
•This diagram shows the four possible states for
these parameters and the corresponding mode in SPI
Introducation of Embedded Linux

•Linux is a 100% free operating system

•Linus Torvalds. who was then a student at the


University of Helsinki in Finland, developed
Linux in 1991

•Implementation of IPC using Pipes, FIFO,


Message Queue for IPC, System calls related to
pipes, FIFO’s & Message Queues, Using ipcs,
ipcrm, Sample program
Inter Process Communication

•Files
•Pipes
• Message Queue
• Shared Memory
• Semaphores
• Signals
• Sockets
Files System Call
Create File =int creat (const char * pathname, int flags)

int open (const char * pathname, int flags)

Flags : O_RDONLY, O_WRONLY, O_RDWRO_CREAT , O_APPEND,


O_NONBLOCK,

ssize_t write = int (fd, void *buf, size_t count)

lseek System Call = off_t lseek ( int fd, off_t offset,


int where)
Where : SEEK_SET, SEEK_CUR,
SEEK_END
Pipes
•We use the term pipe when we connected a data flow from one process
•to another.
•In linux we familiar with a pipe “ | ” which is used to linking shell

system call used to create pipes


int open( const char *path, O_RDONLY |O_NONBLOCK);

int read( pid, buffer , size);

int write(pid, buffer , size);

pid ----- Descriptor returned by open()


buffer ----- Character buffer
size ----- Size of buffer
Message Queue
Features of Message Queue
•Easy and efficient .
•Used between related and unrelated process.
•Provide sending block of data.
•Blocking & Synchronization problems
are
..avoid.
System Calls (key_t
int msgget relatedkey,int
to Message Queue key ------- An arbitrary number
msgflag);
Msgflag--------- IPC_PRIVATE
IPC_CREAT

int msgsnd (int msqid,const void*msg_ptr,size_t msg_szint msgflag);

int msgrcv (int msqid,void *msg_ptr,size_t msg_sz,long int mtype,int


msgflag) ;
Sockets

Why do we need sockets?


• Provides an abstraction for
interprocess communication
Function:-
Initiate and accept a connection
Define an “end- point” for communication
Send and receive data
Terminate a connection gracefully
Types of sockets
Stream socket :(connection- oriented socket)
– It provides reliable, connected networking service
– Error free; no out- of- order packets (uses TCP)
– applications: telnet/ ssh, http, …

Continue…
• Datagram socket :( connectionless socket)
– It provides unreliable, best- effort
networking service
– Packets may be lost; may arrive out
of order (uses UDP)
– applications: streaming
audio/
video (real-player), …

Client Server
System call
Make socket sock = socket( AF_ INET, SOCK_ STREAM, 0);

Setup structure
(
memset(& sin, 0, sizeof( sin));
sin. sin_ family = AF_ INET;
sin. sin_ addr. s_ addr = htonl( INADDR_ ANY);
sin. sin_ port = htons( port);
);

Bind if (bind( sock, (struct sockaddr *) &sin, sizeof( sin)) < 0)


return -1;
return sock;
sock = accept ( listen_ socket, (struct sockaddr *) &sin, &sin_ len);
return sock;
Functionallty
socket() TCP Server

bind() Well-known port

TCP Client listen()

Socket() accept()

connect() Connection establishment blocks until connection from client

write()
read()

process request

write()
read()

close()
read()

close()

You might also like