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