Embedded systems and programming (including my work at Eyantra (IIT Bombay))

1,608 views

Published on

This slide includes basics of embedded systems compiled by including ideas from various slides. Please download and watch the slides as they contain custom animations

Published in: Education, Technology, Business
  • Be the first to comment

  • Be the first to like this

Embedded systems and programming (including my work at Eyantra (IIT Bombay))

  1. 1. A Seminar on Embedded Systems in Robotics (An initiative of Electronics Hobby Club) by Akash Deep Singh B.E 7th Semester (Power Electronics & Instrumentation) Jorhat Institute of Science & Technology
  2. 2. “A system is an arrangement in which all its units assemble and work together according to the plan or program.”
  3. 3. It is a time display SYSTEM Parts: Hardware, Needles, Battery, Dial, Chassis and Strap Rules 1.All needles move clockwise only 2.A thin needle rotates every second 3.A long needle rotates every minute 4.A short needle rotates every hour 5.All needles return to the original position after 12 hours
  4. 4. It is an automatic clothes washing SYSTEM Parts: Status display panel, Switches & Dials, Motor, Power supply & control unit, Inner water level sensor and solenoid valve. Rules 1.Wash by spinning 2.Rinse 3.Drying 4.Wash over by blinking 5.Each step display the process stage 6.In case interruption, execute only the remaining
  5. 5. 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 software 2.Has specific requirements and perform predefined task.
  6. 6. 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=6 main() { set_tris_b(0); portb=255; //decimal delay_ms(1000); portb=0x55; //hexadecimal delay_ms(1000); portb=0b10101010; //binary delay_ms(500); }
  7. 7. And many more………….
  8. 8. Why do we require such systems??? Real-time operation size cost time reliability safety energy security
  9. 9. CENTRE OF STUDY???
  10. 10. 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
  11. 11. In 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.
  12. 12. 1. IR Sensors IR sensor works on the principle of 2. Position encoders emitting IR rays and receiving the reflected ray by a receiver (Photo 3. Ultrasonic Sensors Diode). 4. Accelerometers IR source (LED) is used in forward 5. Gyroscope bias. IR 6. Infrared TSOP Receiver Receiver (Photodiode) is used in reverse bias. 7. Motion Sensor 8. GPS
  13. 13. In human analogy: “Response” Actuators are the final control elements (F.C.E) used in all kinds of control systems. D.C Motor D.C Geared Motor Servo Motor Stepper Motor
  14. 14. The actual manifestation of an embedded system…
  15. 15. Microcontrollers manufacturers: INTEL 8031,8032,8051,8052,8751,8752 PIC AVR Architecture 8-bit PIC16, PIC18, 16-bit DSPIC33 / PIC24, PIC16C7x  Architecture developed by Brogen & Wollan  American based industry est.. In the year 1984  AVR stands for Alf & Vegard’s RISC processor Motorola  Later developed by ATMEL in the year 1996  MC68HC11 Focus on embedded systems build around microcontrollers Atmel  ATMEL stands for “Advanced Technology for Memory & Logic AtMEGA 8,16,32,64,128,256 etc AT90S2333
  16. 16. PROGRAMMING THE MICROCONTROLLER FOR SPECIFIED TASK 1. What is AVR Atmega 8 microcontroller 1. What are ports? 2. Basic idea of C programming Junctions where peripherals are Use of embedded C to create a small 3. connected. This program can be peripherals a. Input units b. Output units 4. Run the program on the bot. 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
  17. 17.  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 it 1. DDRx 2. PORTx 3. PINx
  18. 18. 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 INPUT DDRx=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: F Hex conversion of second nibble: 0
  19. 19. 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=PINC x=0xF0
  20. 20. PORTx Register  This register works in two different ways depending on the way in which the port is defined Case1: When portx is defined Output The 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
  21. 21. AVR Programming Tools  Software Required ATMEL STUDIO 6 1. Integrated Development Environment (IDE) 2. Supports Developing and Debugging of AVR and ARM based microcontroller application WE 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

×