Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microcontrollers and Microprocessors

Similar presentations


Presentation on theme: "Microcontrollers and Microprocessors"— Presentation transcript:

1 Microcontrollers and Microprocessors
Prepared by: Greg Brownell 11/19/2018

2 Definitions Micro: Tiny Controller: Control – Decision-based Action
Processor: Process Data (crunch numbers) 11/19/2018

3 Z80 8-bit Microprocessor 11/19/2018

4 68HC11 8-bit Microcontroller
11/19/2018

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

6 Microprocessors: Examples
Intel 8086, 80286, 80386, 80486, 80586 Zilog Z80, Z8, Z8000 AMD K6 Intel Pentium, Xeon, Itanium Motorola 6800 11/19/2018

7 Comparison: 8-Bit Microcontroller 8-Bit Microprocessor Atribute Text
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 11/19/2018

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 11/19/2018

9 Creating a Project Open the IDE Application: ICC
Select “Project”, “New” Enter a unique Name for your Project 11/19/2018

10 Write the Code Various Language Compilers Available
C Language is Versatile and Popular MicroStamp uses a limited Subset of ANSI C 11/19/2018

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

12 Adding Files to the Project
Simple Menu-driven Procedure Select Files from the List Pick “Project”, “Add Files” 11/19/2018

13 Building the Project Files can be Compiled Individually, or
Click the “Build Project” Button Automatically Compiles Programs 11/19/2018

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 11/19/2018

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 11/19/2018

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; #include"vector.c" 11/19/2018

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); case 2: set_pin(1);set_pin(2);set_pin(7); set_pin(5);set_pin(4); 11/19/2018

18 7-Segment LED: Numeric 11/19/2018

19 LED Display: Detail 11/19/2018

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. 11/19/2018

21 Schematic Diagram 11/19/2018

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 11/19/2018

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 11/19/2018


Download ppt "Microcontrollers and Microprocessors"

Similar presentations


Ads by Google