350 likes | 610 Views
CMPE 118/L Introduction to Mechatronics. Tu-Th 4:00-5:45pm, Jack Baskin Engineering 372. Lab: Jack Baskin Engineering 150, 24/7. Instructor: Prof. Gabriel Hugh Elkaim. TAs: Rob Kelbley, Eric Decker. Why “Smart Products?”. Focuses on Microcomputers as Components, not Controllers
E N D
CMPE 118/LIntroduction to Mechatronics Tu-Th 4:00-5:45pm, Jack Baskin Engineering 372 Lab: Jack Baskin Engineering 150, 24/7 Instructor: Prof. Gabriel Hugh Elkaim TAs: Rob Kelbley, Eric Decker
Why “Smart Products?” Focuses on Microcomputers as Components, not Controllers Encompasses Mechatronics, & Embedded Systems Design
What Makes Mechatronics Different? Intelligent Decision Making The Ability to Adapt Cost Effectiveness
What Makes the Decisions? Computers
Number Representations Binary: 10101010 Hexadecimal: $AA Converting: 1010 1010 $A A
Number Terminology Upper Nibble LSB MSB Lower Nibble 1010 1010 Byte Integer Word
11111111 +1 00000000 -1 00000000 11111111 Modulo Arithmetic
11111111 +1 00000000 -1 00000000 11111111 Modulo Arithmetic Watch out for intermediate results too: Cast variables up to next higher size Cast result back down How do you fix it?
Bit Manipulation How do you Set, Clear or Test individual bits?
To Test a bit 0011 1010 (VAR & IMASK) 0001 0000 AND mask, tests a single bit 0001 0000 Result is 0 or not 0 To Clear a bit 0011 1010 (VAR & CMASK) 1110 1111 AND mask, clears a single bit Result same except for bit position 0010 1010 To Set a bit 0011 1010 (VAR | SMASK) 1000 0000 OR mask, sets a single bit 1011 1010 Result same except for bit position Bit Manipulation How do you Set, Clear or Test individual bits? The Bitwise Operators Bitwise AND = & Bitwise OR = |
What is a: Microprocessor? Micro-computer? Microcontroller?
Micro-Computer Components CPU Program Memory Scratchpad Memory Input/Output (I/O)
Address Bus I/O Memory CPU Data Bus
Instructions Instructions to the Microprocessor. Often referred to as “Machine Language” Data Generally we put this there during the operation of our programs Control These occupy space like memory, but are actually Registers special locations that interact directly with the hardware of the microprocessor. Ports A subset of the control registers. Ports generally offer direct control of the pins on the microprocessor. What’s in the Address Space?
MROM PROM EPROM Erasable OTP EEPROM (E2PROM) FLASH EPROM Program Memory Options
Static RAM Battery-Backed Dynamic RAM Cache RAM Scratchpad Memory Options
Parallel I/O Programmable Fixed Direction What Features Will You Find?
Counters Timers Simple Complex Outrageously Complex What Features Will You Find?
A/D Converters 8-bit 10-bit Multi-channel What Features Will You Find?
D/A Converters PWM True DACs What Features Will You Find?
Feature Sets Architecture Physical Size Cost What Differentiates Micro-Controllers?
Hi-Performance 16-bit Controller 16-bit Data Bus Supports Hi-Level Languages Comes in over 45 “Flavors” The Freescale 68HC12(was Motorola)
16-bit Address Bus 64K (65536) Byte Address Space 16-bit Data Bus 2K (2048) Bytes RAM 32K Bytes FLASH ROM 68HC12 Memory
24 Bi-Directional Lines 8 are multiplexed analog input 68HC12 Parallel I/O
16-bit Free-Running Counter Input Captures (8) Output Compares (8) 68HC12 Timer System
10-bit (1:1024) Resolution 8 Channels 2 banks of 4 inputs 68HC12 A/D Converter
8/16 Bits Interrupt on Overflow 68HC12 Pulse Accumulator
SPI (synchronous) SCI (asynchronous) 68HC12 Serial I/O
The Development Process f o o PC NanoCoreDX Serial Cable (RS232) 68HC12