Embedded systems and programming (including my work at Eyantra (IIT Bombay))
-
Upload
akashdeep-singh -
Category
Education
-
view
1.531 -
download
0
Transcript of Embedded systems and programming (including my work at Eyantra (IIT Bombay))
A Seminar
onEmbedded Systems
inRobotics
(An initiative of Electronics Hobby Club)
byAkash Deep Singh
B.E 7th Semester (Power Electronics & Instrumentation)Jorhat Institute of Science & Technology
Forward biased
What is a System?
“A system is an arrangement in which all its units assemble and work together according to the plan or program.”
Examples…
It is a time display SYSTEMParts: Hardware, Needles, Battery, Dial, Chassis and Strap
Rules1.All needles move clockwise only2.A thin needle rotates every second3.A long needle rotates every minute 4.A short needle rotates every hour5.All needles return to the original position after 12 hours
WATCH
It is an automatic clothes washing SYSTEMParts: Status display panel, Switches & Dials, Motor, Power supply & control unit, Inner water level sensor and solenoid valve.
Rules1.Wash by spinning 2.Rinse3.Drying 4.Wash over by blinking 5.Each step display the process stage6.In case interruption, execute only the remaining
Washing Machine
Embedded System
It is a computing based system.Or
“A computer inside a product”
Parts: Input Unit, Microcontroller(or Microprocessors), Application Software, Additional Mechanical Parts, Output Unit
Rule:1. Runs on the specified application software2.Has specific requirements and perform predefined task.
An Embedded System is one that has computer hardware with software embedded in it as one of its important components.
SOFTWARE PROGRAM#include <16f876a.h>#use delay (clock=20000000)#byte PORTB=6main(){set_tris_b(0);portb=255; //decimaldelay_ms(1000);portb=0x55; //hexadecimaldelay_ms(1000);portb=0b10101010; //binarydelay_ms(500);}
Where do we find such systems???
And many more………….
Why do we require such systems???
Real-time operationsizecosttimereliabilitysafetyenergysecurity
CENTRE OF STUDY???
Robotics
Definition of Embedded SystemsComputer inside a Robot
PRODUCT : ROBOT
1. Sensors: In order to sense the environment
2. Actuators : For movement of robots and its parts
3. Control: Controller/Processor as a brain of the robot
4. Intelligence: User written command to perform desired set of action
5. Power: A necessity for making a system work
6. Communication: Robot can talk to another robot/PC
SensorsIn human analogy: “SENSE ORGANS”
What is a sensor?In common parlance,
“Anything that can sense a change”
In electronics,
A sensor is a device that measures a physical quantity and converts it into a signal which can be read by an observer or by an instrument.
Sensors Employed in Robotics:1. IR Sensors
2. Position encoders
3. Ultrasonic Sensors
4. Accelerometers
5. Gyroscope
6. Infrared TSOP Receiver
7. Motion Sensor
8. GPS
IR sensor works on the principle of emitting IR rays and receiving the reflected ray by a receiver (Photo Diode).IR source (LED) is used in forward bias.IR Receiver (Photodiode) is used in reverse bias.
Sharp IR SensorIR Proximity Sensor White Line Sensor
ActuatorsIn human analogy: “Response”
Actuators are the final control elements (F.C.E) used in all kinds of control systems.
D.C MotorD.C Geared MotorServo MotorStepper Motor
Control of a Robot The actual manifestation of an embedded
system…
Microprocessor Vs Micro Controller
Microcontrollers manufacturers:
INTEL 8031,8032,8051,8052,8751,8752
PIC 8-bit PIC16, PIC18, 16-bit DSPIC33 / PIC24, PIC16C7x
MotorolaMC68HC11
AtmelAtMEGA 8,16,32,64,128,256 etcAT90S2333
American based industry est.. In the year 1984
Focus on embedded systems build around microcontrollers
ATMEL stands for “Advanced Technology for Memory & Logic
AVR Architecture
Architecture developed by Brogen & Wollan AVR stands for Alf & Vegard’s RISC processor Later developed by ATMEL in the year 1996
Intelligence of the Robot
Embedded C: user code
For the robot:Convert the user code to machine
language called hex file
PROGRAMMING THE MICROCONTROLLER FOR SPECIFIED TASK
1. What is AVR Atmega 8 microcontroller
2. Basic idea of C programming
3. Use of embedded C to create a small program
4. Run the program on the bot.
1. What are ports?
Junctions where peripherals are connected.This peripherals can be
a. Input unitsb. Output units
2. Ports in Atmega8
Atmega8 is a 28 pin micro.
23 pins can be used as both input and output pins.
PINS are grouped together as PORTS
Atmega8 has Two 8-bit Input/Output Ports
PORTx; ‘x’ is subscript and could be either of B,D Atmega8 has One 6-bit Input/Output port
PORTC All ports can be configured individually as input/ouput
How to access the port?
Each port has three registers associated with it1. DDRx2. PORTx3. PINx
DDRx Register
1. DDR stands for “Data Direction Register”2. Purpose: To set PORT Pins as input or output
DDRx=0; // PORTx is defined as INPUTDDRx=1; // PORTx is defined as OUTPUT
Example: Let us make PORTB upper nibble as output and lower nibble as input
Hex conversion of first nibble: FHex conversion of second nibble: 0
PINx Register:
The purpose of this register is to read the value from the input device connected to the PORT.
Or To read data present on PORTx
Example: Read data from PortC (PLEASE NOTE: PORTC HAS BEEN DEFINED AS INPUT PORT)
PINC=0xF0;
Or we can also create a variable such that x=PINCx=0xF0
PORTx Register This register works in two different ways depending on the way in which the port is defined
Case1: When portx is defined OutputThe purpose will be to output data present on the Portx pin to the output device
Example: Here we define PortB as output by assigning
DDRB=0xFF
Let the data present on the PortB be 0xFF
Therefore we write
Case2: When portx is defined as input , it is used to activate or deactivate the pull-up resistor
PLEASE NOTE THAT THERE IS NO PORT CALLED A IN ATMEGA8 MICROCONTROLLER
AVR Programming Tools Software Required
ATMEL STUDIO 61. Integrated Development Environment (IDE)2. Supports Developing and Debugging of AVR and ARM based
microcontroller applicationWE WILL WRITE THE C PROGRAM AND COMPILE IT IN ATMEL STUDIO TO GENERATE HEX FILE (MACHINE LANGUAGE UNDERSTANDABLE BY THE MICROCONTROLLER)
Hardware Required
HEX FILE CAN BE LOADED INTO THE MICROCONTROLLER USING BOOTLOADER or AVR PROGRAMMERS
Buzzer Beep
A Glimpse of Eyantra 2012-13
Thank you