Ce diaporama a bien été signalé.
Le téléchargement de votre SlideShare est en cours. ×

Microcontroller from basic_to_advanced

Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Publicité
Prochain SlideShare
microcontroller basics
microcontroller basics
Chargement dans…3
×

Consultez-les par la suite

1 sur 79 Publicité

Plus De Contenu Connexe

Diaporamas pour vous (20)

Similaire à Microcontroller from basic_to_advanced (20)

Publicité

Plus récents (20)

Microcontroller from basic_to_advanced

  1. 1. By: Imran sheikh
  2. 2.  Architectures: – Von Neumann – Harvard – Harvard modified
  3. 3.  Microcontroller 8 bit 16bit 32bit,etc.  Digital Signal Processor Digital Signal Controller  FPGA/ASIC-Programmable Logic  SoC-Processor System & Programmable Logics
  4. 4.  Arduino IDE  Energia  Python IDE  IAR workbench  Keil  CCS  Xilinx ISE/Vivado web edition
  5. 5.  Arduino  Raspberry Pi  8051 development board  PIC development board  Tiva C series  STM32F4  Many more…..
  6. 6.  There are different programming styles available to use or we can create it by mixing one in another. Standards available languages are: ◦ Assembly level: Board specific ◦ Embedded c: Generalized with common instructions
  7. 7.  C/C++  Embedded C  Python  VHDL  Verilog  MATLAB  Simulink
  8. 8.  External Memeories  RS232  CAN  LAN(RJ45)  SPI  I2C  PCI  PCIe  Other networking protocols
  9. 9.  Temperature sensor module  Vibration switch module  Hall magnetic sensor module  Key switch module  Infrared emission sensor module  Small passive buzzer module  Laser sensor module  3-color full-color LED SMD modules  Optical broken module  Etc..many more available on: https://tkkrlab.nl/wiki/Arduino_37_sensors
  10. 10.  Unsigned Integers ◦ All eight bits represent the magnitude of a number  Bit7 to Bit0 ◦ Range 00H to FFH (010 to 25510) 12
  11. 11.  Signed Integers ◦ 2's Complement  Bit7 is sign bit ◦ Positive numbers: 00H to 7FH (010 to 12710) ◦ Negative numbers: 80H to FFH (-110 to -12810) 13
  12. 12.  Binary Coded Decimal Numbers (BCD) ◦ 8-bit number divided into two groups of four  Each group represents a decimal digit from 0 to 9 ◦ AH through FH are invalid ◦ Example: 0010 0101BCD = 2510 14
  13. 13.  American Standard Code for Information Interchange (ASCII) ◦ 7-bit alphanumeric code with 128 combinations (00H to 7FH) ◦ Represents English alphabet, decimal digits from 0 to 9, symbols, and commands 15
  14. 14.  Which is easy? Assembly Language Embedded C Language
  15. 15.  Meeting the computing needs of the task efficiently and cost effectively  Speed, the amount of ROM and RAM, the number of I/O ports and timers, size, packaging, power consumption  Easy to upgrade  Cost per unit  Availability of software development tools  Assemblers, debuggers, C compilers, emulator, simulator, technical support  Wide availability and reliable sources of the microcontrollers.
  16. 16.  A Harvard Architecture (separate instruction/data memories)  Single chip Microcontroller(µC)  Developed by Intel in 1980 for use in embedded systems.  Today largely superseded by a vast range of faster and/or functionally enhanced 8051-compatible devices manufactured by more than 20 independent manufacturers
  17. 17. Feature 8051 8052 8031 ROM (program space in bytes) 4K 8K 0K RAM (bytes) 128 256 128 Timers 2 3 2 I/O pins 32 32 32 Serial port 1 1 1 Interrupt sources 6 8 6 Comparison of the 8051 Family
  18. 18. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 RST (RXD)P3.0 (TXD)P3.1 (T0)P3.4 (T1)P3.5 XTAL2 XTAL1 GND (INT0)P3.2 (INT1)P3.3 (RD)P3.7 (WR)P3.6 Vcc P0.0(AD0) P0.1(AD1) P0.2(AD2) P0.3(AD3) P0.4(AD4) P0.5(AD5) P0.6(AD6) P0.7(AD7) EA/VPP ALE/PROG PSEN P2.7(A15) P2.6(A14) P2.5(A13) P2.4(A12) P2.3(A11) P2.2(A10) P2.1(A9) P2.0(A8) 8051 (8031)
  19. 19. 23
  20. 20.  MPU (CPU) ◦ Read instructions ◦ Process binary data 24
  21. 21.  Storage Device ◦ Addresses ◦ Registers  Major Categories ◦ Read/Write Memory (R/W) ◦ Read-only-Memory (ROM) 25 D7 D0
  22. 22.  Input Devices ◦ Switches and Keypads ◦ Provide binary information to the MPU  Output devices ◦ LEDs and LCDs ◦ Receive binary information from the MPU 26
  23. 23.  MPU communicates with Memory and I/O using the System Bus ◦ Address bus  Unidirectional  Memory and I/O Addresses ◦ Data bus  Bidirectional  Transfers Binary Data and Instructions ◦ Control lines  Read and Write timing signals 27
  24. 24. 28
  25. 25.  Machine Language ◦ Binary Instructions ◦ Difficult to decipher and write  Error-prone ◦ All programs converted into machine language for execution 29 Instructio n He x Mnemoni c Description Processor 1000000 0 80 ADD B Add reg B to Acc Intel 8085 0010100 0 28 ADD A, R0 Add Reg R0 to Acc Intel 8051 0001101 1 1B ABA Add Acc A and B Motorola 6811
  26. 26.  Assembly Language ◦ Machine instructions represented in mnemonics ◦ One-to-one correspondence ◦ Efficient execution and use of memory ◦ Machine-specific 30
  27. 27.  High-Level Languages ◦ BASIC, C, and C++ ◦ Written in statements of spoken languages ◦ Machine independent ◦ Easy to write and troubleshoot ◦ Larger memory and less efficient execution 31
  28. 28.  RISC CPUs ◦ 8-bit ◦ 16-bit  Number of I/O pins: 4-70  Memory types and sizes: ◦ Flash; OTP; ROM ◦ 0.5k – 256k
  29. 29. 5/6 Programming pins 8 A/D channels 2 Oscillator Inputs 2 RS-232 inputs 33 I/O ports
  30. 30.  Download @ http://microchip.com  Assembly compiler for programming PICs  Based on specific PIC instruction set
  31. 31. PIC: Elements of a digital controller CPU Central Processing Unit Input Peripherals Output Peripherals ROM Read Only Memory RAM Read & Write Memory Program download User input User output The microcontroller contains all these elements in one chip
  32. 32. 16F877 pin-out The microcontroller pins have multiple functions
  33. 33. Screenshot of MPLAB Project The C program is compiled and tested in simulation mode
  34. 34. ARM
  35. 35.  Developed at Acorn Computers Limited, of Cambridge, England, between 1983 and 1985  Problems with CISC:  Slower then memory parts  Clock cycles per instruction 41
  36. 36.  Typical RISC architecture:  Large uniform register file  Load/store architecture  Simple addressing modes  Uniform and fixed-length instruction fields 42
  37. 37.  Enhancements:  Each instruction controls the ALU and shifter  Auto-increment and auto-decrement addressing modes  Multiple Load/Store  Conditional execution 43
  38. 38.  Floating Point Processor-Ex.TMS320F28335  Fixed Point Processor-Ex.TMS320F6745
  39. 39. Digital Signal Controller
  40. 40.  Simple logic gates ◦ combine transistors to implement combinational and sequential logic  Interconnect ◦ wires to connect inputs and outputs to logic blocks  I/O blocks ◦ special blocks at periphery for external connections  Add wires to make connections ◦ done when chip is fabbed  “mask-programmable” ◦ construct any circuit
  41. 41.  Logic blocks ◦ to implement combinational and sequential logic  Interconnect ◦ wires to connect inputs and outputs to logic blocks  I/O blocks ◦ special logic blocks at periphery of device for external connections  Key questions: ◦ how to make logic blocks programmable? ◦ how to connect the wires? ◦ after the chip has been fabbed
  42. 42.  Soft-core are available with FPGA /ASIC’s and SoC. ◦ ARM processor ◦ Microblaze processor
  43. 43.  Implementation of random logic ◦ easier changes at system-level (one device is modified) ◦ can eliminate need for full-custom chips  Prototyping ◦ ensemble of gate arrays used to emulate a circuit to be manufactured ◦ get more/better/faster debugging done than possible with simulation  Reconfigurable hardware ◦ one hardware block used to implement more than one function ◦ functions must be mutually-exclusive in time ◦ can greatly reduce cost while enhancing flexibility ◦ RAM-based only option  Special-purpose computation engines ◦ hardware dedicated to solving one problem (or class of problems) ◦ accelerators attached to general-purpose computers
  44. 44.  Complete ARM®-based processing system ◦ Application Processor Unit (APU)  Dual ARM Cortex™-A9 processors  Caches and support blocks ◦ Fully integrated memory controllers ◦ I/O peripherals  Tightly integrated programmable logic ◦ Used to extend the processing system ◦ Scalable density and performance  Flexible array of I/O ◦ Wide range of external multi-standard I/O ◦ High-performance integrated serial transceivers ◦ Analog-to-digital converter inputs
  45. 45.  The Zynq-7000 AP SoC architecture consists of two major sections ◦ PS: Processing system  Dual ARM Cortex-A9 processor based  Multiple peripherals  Hard silicon core ◦ PL: Programmable logic  digital logic design
  46. 46.  Three basic modes: ◦ 1. Continuous dedicated monitoring of the sensor by the microprocessor ◦ 2. Polling the sensor ◦ 3. Interrupt mode
  47. 47.  Microprocessor is dedicated for use with the sensor  Its output is monitored by the microprocessor continuously  The microprocessor reads the sensor’s output at a given rate  Output is then used to act
  48. 48.  Sensor operates as if the microprocessor did not exist.  Its output is monitored by the microprocessor  The microprocessor reads the sensor’s output at a given rate or intervals - poling  Output is then used to act
  49. 49.  Microprocessor is in sleep mode  Outputs of the sensor are not being processed  Upon a given event, microprocessor wakes up through one of its interrupt options  The sensor activates the interrupt
  50. 50.  Interrupts can be timed  Interrupts can be issued by sources other than the sensor  The microprocessor may be involved in other functions, separate from the sensor, such as control of an actuator  Feedback from actuators may also be used to perform interrupts
  51. 51.  Microprocessor input interfacing requirements  Microprocessor output requirements  Errors introduced by microprocessors
  52. 52.  Signal level  Impedance and matching  Response, frequency  Signal conditioning  Signal scaling  Isolation  Loading
  53. 53.  Signal levels  Power levels  Isolation
  54. 54.  Basic level: zero to Vdd ◦ Must scale signals if necessary  No dual polarity signals ◦ Must translate/scale as necessary  Direct reading or A/D  Can read voltages only ◦ AC or DC ◦ Limitations in frequency
  55. 55.  P are high input impedance devices ◦ ~ 1 - 10 M ◦ Input current - < 1 A.  Ideal for direct connection of low impedance sensors (magnetic, thermistors, thermoelectric, etc.)  High impedance sensors (capacitive, pyroelectric, etc.) must be buffered ◦ Voltage followers ◦ FET amplifiers
  56. 56.  Most sensors are slow devices ◦ Can be interfaced directly ◦ No concern for response and frequency range  Some sensors are part of oscillators ◦ Frequencies may be quite high ◦ Need to worry about proper sampling by the microprocessor
  57. 57.  Example: 10 mHz P, cycle time of 0.4 s. (most processor divide the clock frequency by a factor - 4 in this case)  Any operation such as reading an input required n cycles, say n=5  Effective frequency: 0.5 MHz  Sampling cannot be done at rates higher than 250 kHz  Any sensor producing a signal above this frequency will be read erroneously
  58. 58.  Some solutions: ◦ Divide the sensor’s frequency  Reduces sensitivity  Must be done externally to the P ◦ F-V converter  Introduces conversion errors  Must be done externally ◦ Frequency counter at input  Use output of the counter as input to mP.  Expensive ◦ Faster microprocessors
  59. 59.  Offset ◦ Primarily for dc levels ◦ Can be offset up or down ◦ Usually done to remove the dc level ◦ Sometimes needed to remove negative polarity. ◦ AC signals may sometimes be coupled through capacitors to eliminate dc levels
  60. 60.  Example ◦ Thermistor: 500 at 20ºC ◦ Varies from 100 to 900 for temp. between 0 and 100ºC
  61. 61.  At 500ºC ◦ V = (12/1500)*500 = 4 V  At 0ºC ◦ V = (12/1400)*400 = 3.428 V  At 100ºC ◦ V = (12/1900)*900 = 5.684 V  V varies between 3.428V and 5.684V ◦ 5.684V is above the 5V operating voltage of the microprocessor
  62. 62.  Errors introduced by the microprocessor: ◦ Due to resolution of A/D, D/A ◦ Sampling errors  These come in addition to any errors in the sensor/actuator
  63. 63.  Most microprocessors are 8 bit microprocessors  Integer arithmetics  Largest value represented: 256  Roundoff errors due to this representation  Special math subroutines have been developed to minimize these errors (otherwise they would be unacceptably high)
  64. 64.  All inputs and outputs on a microprocessor are sampled. That is: ◦ Inputs are only read at intervals ◦ Outputs are only updated at intervals ◦ Intervals depend on the frequency of the clock, operation to be executed and on the software that executes it ◦ Sampling may not even be constant during operation because of the need to perform different tasks at different times ◦ Errors are due to changes in input/output between sampling to which the microprocessor is oblivious ◦ Errors are not fixed - depend among other things on how well the program is written
  65. 65.  There are lots of application use microcontroller some of them are given below: ◦ CAR ◦ Refrigerator ◦ Airplane ◦ Trains ◦ Medical devices, etc. Some example will be explained in Last slides.
  66. 66. 75
  67. 67. 76
  68. 68.  Microcontroller and Microprocessor  Digital System  Signal and System(Z transform and Filter Designing)  Digital Signal Processing  Networking  Control system  Basic analog design
  69. 69. Contact: imran.sheikh.vjti@gmail.com

×