0% found this document useful (0 votes)
7 views

Computing Element

Uploaded by

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

Computing Element

Uploaded by

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

COMPUTING ELEMENT

Microprocessor and its Architecture, Micro-controller,


Programming Logic Controllers, their basic structure, mnemonics
Embedded Board (EB) and its system details, classification and
types of embedded boards, Selection criteria of EB ,
understanding of Arduino UNO, Raspberry Pi
What is a Microprocessor?
It’s a combination of micro and processor
– Processor means a device /system that processes whatever.
• To process means to manipulate. It is a general term that describes all
manipulation. In this context, It means to perform certain operations on
the numbers.

– In the late 1960’s, processors were built using discrete


elements.
• These devices performed the required operation, but were too large
and too slow.
Microprocessor-Definition
• Micro in addition to Processor
– In 1970's the microchip was introduced. The majority of the parts
that made up the processor were currently set on a solitary bit of
silicon. The size turned into a few thousand times smaller and the
speed turned into a few hundred times quicker. The
"Micro"Processor was conceived.
– The microprocessor is a programmable device that takes in
numbers, performs on them arithmetic or logical operations
according to the program stored in memory and then produces
other numbers as a result.
– In this context ,its a device that reads binary instruction from
memory and accepts numbers from input device and processes
those numbers according to those instructions and provide the
results.
Basic Concepts of Microprocessors
Differences between:
– Microcomputer – a computer with a microprocessor
as its CPU. Includes memory, I/O etc.
– Microprocessor – silicon chip which includes
ALU, register circuits & control circuits
– Microcontroller – silicon chip which includes
microprocessor, memory & I/O in a single
package.
Micro Computer
INPUT

I/O Port CPU MEMORY

OUTPUT

CPU
General-
Purpose Serial
RAM ROM I/O Timer
Micro- COM
Port
processor Port
Micro Computer
Microprocessors
The microprocessor can perform different sets of operations on the data it
receives depending on the sequence of instructions supplied in the given
program.
Depending on its computation of clock frequency and data handling the
generation of microprocessor was evolved to 5th generation of processor
Architecture of 8085
Architecture of ARM Cortex M3
Microcontroller
A smaller computer

•On-chip RAM, ROM, I/O ports...

•Example : Motorola’s 6811, Intel’s 8051, Zilog’s Z8 and PIC 16X


What is an Arduino ?
• Open Source electronic prototyping platform
based on flexible easy to use hardware and
software.
Getting started with Programming
Template code
void setup() {
// put your setup code here, to run once:
}

void loop() {
// put your main code here, to run
repeatedly:
}
Template code
• setup : It is called only when the Arduino is
powered on or reset. It is used to initialize
variables and pin modes

• loop : The loop functions runs continuously till


the device is powered off. The main logic of
the code goes here. Similar to while (1) for
micro-controller programming.
PinMode
• A pin on arduino can be set as input or output
by using pinMode function.

• pinMode(13, OUTPUT); // sets pin 13 as


output pin

• pinMode(13, INPUT); // sets pin 13 as input


pin
Reading/writing digital values
• digitalWrite(13, LOW); // Makes the output
voltage on pin 13 , 0V

• digitalWrite(13, HIGH); // Makes the output


voltage on pin 13 , 5V

• int buttonState = digitalRead(2); // reads the


value of pin 2 in buttonState
Converting Analog Value to Digital
Analog to Digital Coversion
• What is analog ?
• It is continuous range of voltage values (not
just 0 or 5V)

• Why convert to digital ?


• Because our microcontroller only understands
digital.
ADC in Arduino
• The Arduino Uno board contains 6 pins for
ADC

• 10-bit analog to digital converter

• This means that it will map input voltages


between 0 and 5 volts into integer values
between 0 and 1023
Reading/Writing Analog Values
• analogRead(A0); // used to read the analog
value from the pin A0

• analogWrite(2,128);
Digital Write- Blinking of LED
• void setup()
{ // initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever


• void loop()
{
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Digital Write- BUZZING
• const int buzz=9;
• void setup()
{ // initialize digital pin LED_BUILTIN as an output.
pinMode(buzz,OUTPUT);
}

// the loop function runs over and over again forever


• void loop()
{
tone(buzz,1000);
delay(1000);
noTone(buzz);
delay(1000);
}
Digital READ- Proximity

• void setup()
{ // initialize digital pin LED_BUILTIN as an output.
pinMode(9,INPUT);
Serial.begin(9600);
}

// the loop function runs over and over again forever


• void loop()
{
int a = digitalRead(9);
Serial.println(a);
delay(100);
}
Digital Read-UltraSonic
const int trigPin = 9;
const int echoPin = 10;
// defines variables
long duration;
int distance;

• void setup()
{
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600); // Starts the serial communication
}

// the loop function runs over and over again forever


• void loop()
{
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);

}
ADC Example
• // These constants won't change. They're used to give names to the pins used:
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
const int analogOutPin = 9; // Analog output pin that the LED is attached to

int sensorValue = 0; // value read from the pot


int outputValue = 0; // value output to the PWM (analog out)

void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}

void loop() {
// read the analog in value:
sensorValue = analogRead(analogInPin);
// map it to the range of the analog out:
outputValue = map(sensorValue, 0, 1023, 0, 255);
// change the analog out value:
analogWrite(analogOutPin, outputValue);

// print the results to the serial monitor:


Serial.print("sensor = " );
Serial.print(sensorValue);
Serial.print("\t output = ");
Serial.println(outputValue);

// wait 2 milliseconds before the next loop


// for the analog-to-digital converter to settle
// after the last reading:
delay(2);
}
Analog READ- Potentiometer
• void setup()
{ // initialize digital pin LED_BUILTIN as an output.
pinMode(buzz,OUTPUT);
Serial.begin(9600);
}

// the loop function runs over and over again forever


• void loop()
{
int a=analogRead(A0);
Serial.print(a);
int k = map(a,0,1023,0,1000);
Serial.print(" ");
Serial.print(k);
Serial.println();
tone(buzz,k);
}
Analog READ- LDR
• void setup()
{
Serial.begin(9600);
}

void loop()
{
int a = analogRead(A0);
Serial.println(a);
delay(100);
}
Analog READ- Accelerometer
• const int buzz=9;
• void setup()
{
Serial.begin(9600);
pinMode(12,OUTPUT);
pinMode(buzz,OUTPUT);
}

// the loop function runs over and over again forever


• void loop()
{
int a=analogRead(A0);
Serial.println(a);

if(a<=270 || a>=370)
{
digitalWrite(12,HIGH);
tone(buzz,1000);
}
else
{
digitalWrite(12,LOW);
noTone(buzz);
}
delay(100);
}
PROGRAMMABLE LOGIC
CONTROLLERS
PROGRAMMABLE LOGIC
CONTROLLERS (PLC)
PLC is a digital electronic device that
uses a programmable memory to store
instructions and to implement functions such
as logic, sequencing, timing, counting and
arithmetic in order to control machines and
processes and has been specifically designed
to make programming easy.
LOGIC – The term logic is used because the programming
is primarily concerned with implementing logic and
switching operations.

PLCs are similar to computers but have certain features


which are specific to their use as controllers. These are:
1. They are rugged and designed to withstand vibrations,
temperature, humidity and noise.
2. The interfacing for inputs and outputs is inside the
controller.
3. They are easily programmed.
PLC
Input channel
Relay type of output
Latching
Motor latching
Sequencing

A+ B+, A- B+
Cylinder sequencing
Mnemonics
 In ladder diagram each horizontal rung can be
programmed by the mnemonic code.
 For example the operation of adding data to an
accumulator might be represented by ADDA.
 Mnemonic code is also known as memory-
aiding code.
 Writing a program using mnemonics is easier
because they are an abbreviated version of the
operation performed by the instruction.
Mnemonics
Mnemonics
Timers
COUNTERS
 Counters are used when there is a need a count
a specified number of contact operations.
 For example where items pass along a
conveyor into boxes, and when the specified
number of items has passed into a box, the
next item is diverted into another box.
 Counter circuit are supplied as an internal
feature of PLCs.
up - counter
down - counter
Jump Control
Selection of a PLC
Embedded Boards
Embedded System
Embedded system is a system that has embedded software and
hardware, which makes it a system dedicated for an
application or product or a part of a larger system.

Embedded system are electronic systems contain a


microprocessor and microcontroller.

3 main components :
1. Hardware
2. Application Software
3. RTOS
Embedded Board
• For an embedded development, we need two major things
that are development board and an IDE (Integrated
Development Environment).
• A microcontroller development board also known as single
board computer is a printed circuit board (PCB) with circuitry
and hardware designed to facilitate experimentation with a
certain microcontroller boards features.
• The Development boards are combined with a processor,
memory, chipset and on-board peripherals like LCD, Keypad,
USB, serial port, ADC, RTC, Motor Driver ICs, SD card slot,
Ethernet, etc. with debugging features.
• This will save us from messing with the connections with
jumper wires and the board.
General Structure of Embedded Boards

Development boards combine a processor, chipset, memory and


onboard peripherals with debugging features.
General Structure of Embedded Boards

The Specifications of Microcontroller Boards are bus type, processor


type, memory, number of ports, port type, and operating system.
Classification of Embedded board
Classification of Embedded board

Proprietary
SBC

Open source
Classification of Embedded board
• Proprietary SBCs are generally designed for use in end
applications or as a reference to be evaluated. These are
often industrialized designs that have gone through the
same type of testing that an end product requires and are
often integrated into end product designs.

• Open source SBCs, offer users access to both the hardware


design and layout as well as access to the source code used
on the board. This is ideal for all users as they can easily
understand how the software and hardware operates and
adopt the design to meet their end designs requirements
or simply learn how a piece of hardware or software works.
Factors to keep in mind
• These include capabilities of the target
controller (speed, power consumption and on-
chip peripherals)
• available features (memory being the major
consideration along with supported
communication protocols), onboard
peripherals
• technical support (compiler tool chain and
sample applications) from the vendor.
Selection Criteria
• Voltaile • Clock
• RAM • I/O
• eMC • Processor Type

Memory Processor

Cost Power

• Operating Cost • Operating


• Software cost Power
• Reliability • Heat Sink
Selection Criteria
Arduino Platform
• Arduino is the most popular open-source electronics
prototyping platform to create interactive electronic
applications.
• The Arduino UNO board contains everything needed to
support the microcontroller. The Arduino UNO
microcontroller board is very familiar to absolute
beginners and experts. It should consider to be one of
the first microcontroller based development boards.
The Arduino UNO R3 is simplest and the most powerful
prototyping environment based on the ATmega328P
microcontroller.
Features
• Microcontroller: ATmega328P
• 32 KB of Flash memory
• Operating Voltage: 5V
• Input Voltage (recommended): 7-12V
• Input Voltage (limits): 6-20V
• Digital I/O Pins: 14 (6 pins provide PWM output)
• Analog Input Pins: 6
• DC Current per I/O Pin: 40 mA
• DC Current for 3.3V Pin: 50 mA.
Raspberry Pi Development Board
• Raspberry Pi is a credit card sized single computer board.

• It can be used for many of the things that your desktop PC


does, like spreadsheets, word-processing, games and it can
also play high definition video.

• The raspberry pi is created to be something to encourage


learning, innovation and experimentation. The raspberry pi
computer is portable and less expensive.

• The 98 percent mobile phones were using ARM technology.


The ARM technology would later end up being featured on the
raspberry pi with ARM processor core being used.
Features:
• 256 MB SDRAM memory
• Broadcom BCM2835 SoC full HD multimedia processor
• Dual Core Video Core IV Multimedia coprocessor
• Single 2.0 USB connector
• HDMI (rev 1.3 & 1.4) Composite RCA (PAL and NTSC)
Video Out
• 3.5 MM Jack, HDMI Audio Out
• SD, MMC, SDIO Card slot on board storage
• Linux Operating system
• 8.6cm*5.4cm*1.5cm dimensions
Raspberry Pi Development Board

The raspberry pi has a small size of a credit card and it works as normal
computer at low price.
It is possible to work as a low cost server to handle web traffic.

You might also like