1 / 23

Microcontrollers and Microprocessors

Microcontrollers and Microprocessors. Prepared by: Greg Brownell. Definitions. Micro: Tiny Controller: Control – Decision-based Action Processor: Process Data (crunch numbers). Z80 8-bit Microprocessor. 68HC11 8-bit Microcontroller. Embedded Controls: Examples. Microcontrollers

kevinyeager
Download Presentation

Microcontrollers and Microprocessors

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Microcontrollers and Microprocessors Prepared by: Greg Brownell

  2. Definitions • Micro: Tiny • Controller: Control – Decision-based Action • Processor: Process Data (crunch numbers)

  3. Z80 8-bit Microprocessor

  4. 68HC11 8-bit Microcontroller

  5. Embedded Controls: Examples • Microcontrollers • ASICs (Application-Specific Integrated Circuits) • PGAs (Programmable Gate Arrays) • PLDs (Programmable Logic Devices) • SOCs (System On a Chip)

  6. Microprocessors: Examples • Intel 8086, 80286, 80386, 80486, 80586 • Zilog Z80, Z8, Z8000 • AMD K6 • Intel Pentium, Xeon, Itanium • Motorola 6800

  7. Comparison: 8-Bit Microcontroller 68HC11 (MicroStamp) 8-Bit Microprocessor Z80 • 8-Bit Microcontroller • 8-Bit Microprocessor Atribute Control/Monitor Process Data Function Instructions External Application Performance Data Handling Programming Connections Support RISC: 145 Full Set: 158 Text Text Digital/Analog Peripherals Text Embedded Logic CPU Core Text Text Text Instructions/second MFLOPS I/O Pins Bus-oriented Text Text Internal ROM External RAM Text 20 pins 40 pins Stand-alone External Chipset

  8. Programming the MicroStamp • Create a Project using Integrated Development Environment • Write the Source Code using the built-in text editor • Include Links to Definition (header) files needed • Add your Files to the Project • Build the Project (compile programs) • Download Compiled Code to MicroStamp

  9. Creating a Project • Open the IDE Application: ICC • Select “Project”, “New” • Enter a unique Name for your Project

  10. Write the Code • Various Language Compilers Available • C Language is Versatile and Popular • MicroStamp uses a limited Subset of ANSI C

  11. Include Header Files • Some Standard Functions from KERNEL.C • Other Library Routines from VECTOR.C • Use Standard #INCLUDE directives

  12. Adding Files to the Project • Simple Menu-driven Procedure • Select Files from the List • Pick “Project”, “Add Files”

  13. Building the Project • Files can be Compiled Individually, or • Click the “Build Project” Button • Automatically Compiles Programs

  14. Download Code to Stamp • Connect Serial Cable from PC Port • Run the program: MicroLoad.EXE • Under “Options” select MicroStamp 11 • Hit “Load” and open your .S19 file • Follow the on-screen instructions • Click the Download button

  15. Running the Finished Program • Switch the MicroStamp from “boot” to “run” and from “load” to “code protect” • Press the Master Reset button • Return switches to “load” position to download another program

  16. Code Example: IFLAB.C #include"kernel.c" void _HC11Setup(){ *(unsigned char volatile*)(0x3D) = 0x01; OPTION = 0x04; } void main(void){ int ilevel; int istep; init(); ilevel=0 ; display_digit(ilevel); while(1){ istep=butcontrol(); ilevel=(ilevel+istep)%8; display_digit(ilevel); } } #include"vector.c"

  17. Display Decoder Function void display_digit(int data){ int i; for(i=1;i<8;i++) clear_pin(i); switch (data){ case 0: set_pin(1);set_pin(2);set_pin(3); set_pin(4);set_pin(5);set_pin(6); break; case 1: set_pin(2);set_pin(3); break; case 2: set_pin(1);set_pin(2);set_pin(7); set_pin(5);set_pin(4); break;

  18. 7-Segment LED: Numeric

  19. LED Display: Detail

  20. Hexadecimal Display (base 16) Hexadecimal is used to represent numbers with a radix of 16. It consists of the numeric digits 0-9 plus alpha characters A-F. This “shorthand” notation is commonly used when writing binary computer code because fewer digits are required.

  21. Schematic Diagram

  22. Assignment • Create and Build your own project • Modify the existing code: IFLAB.C • Change the Display output from 0-7 to A-H or define your own character set

  23. Special Notes • Put the .c files in your own project folder • After demonstrating that your program runs, reload the original program from C:\ICC\learn_1\learn_1.s19 • Leave your project folder on the laptop as evidence that you have completed lab • Back up your files and then delete them • If the serial port becomes unplugged, re-insert it matching the black pin to the dot

More Related