INTRODUCTION TO
MECHATRONIC DESIGN
J. EDWARD CARRYER
R. MATTHEW OHLINE
THOMAS W. KENNY
Mechanical Engineering
SOLUTION MANUAL FOR 1 / 4
Solution Manual for Introduction to Mechatronic Design Do Not Circulate Carryer, Ohline & Kenny Copyright 2011 2-1
1.1) Compile a list of at least 25 everyday objects that incorporate microcontrollers, microprocessors or digital signal processors.Cell phone Mp3 player Microwave oven PDA Automobiles (many!) Desktop computer Disk drives Digital cameras Dishwashers Washing machines Ovens DVD players CD players Stereo receivers Electronic musical keyboards Computer keyboards Computer mice Network routers / wireless access points Laser Printers Ink Jet printer Navigation systems Bicycle computers Noise cancelling headphones Video cameras TVs
1.2) Using the internet, locate the data sheet for the Atmel ATmega128A microcontroller, and answer the
following:
a) Does the ATmega128A have a von Neumann or a Harvard architecture?
b) How much non-volatile Flash program memory is incorporated?
c) How much volatile RAM data memory is incorporated?
d) List at least 5 other important peripheral systems that are included (there are many more than 5!)
a) Harvard, but the data sheet doesn’t explicitly call this out. You need to study the block diagram to see
that the program flash is connected directly to the instruction register.
- 128K Bytes
- 4K Bytes
d) UART
16 bit Timer A/D Converter Analog comparator Brown out detector Pulse Width Modulation Real Time Clock Two Wire Interface Watchdog
Chapter 2 2 / 4
Solution Manual for Introduction to Mechatronic Design Do Not Circulate Carryer, Ohline & Kenny Copyright 2011 2-2 1.3) How is a microprocessor different from a microcontroller?A microprocessor does not contain program memory and data memory and I/O.
1.4) How big is the address space for a microcontroller whose address bus is 24 bits wide?2 24 -1 = 16,777,215 locations
1.5) What is the biggest number that can be represented with 28 bits?2 28
-1 = 268,435,455
1.6) List three different types of non-volatile memory.Flash EEPROM ROM
EEPROM
1.7) Using the internet, locate the data sheet for the Microchip PIC16LF727, and answer the following:
a) What is the fastest clock source that can be used with this chip? What is the slowest?
b) Is there an analog-to-digital converter peripheral included on this chip?
c) How wide is the program memory bus? That is, how many bits are the program instructions?
d) How many input/output (I/O) pins does the PIC16LF727 have?
- 20MHz, DC (0Hz)
b) YES: 8 bits
- 14 bits
- 36
1.8) What kind of microcontroller peripheral is present on the PIC12F609 that is not present on the
MC9S12C32?
An analog comparator
1.9) What prevents a microcontroller with a von Neumann architecture from attempting to execute data? What about a microcontroller with a Harvard architecture?Nothing prevents the processor from executing data in a von Neumann architecture.In a Harvard architecture, the instructions are not fetched from the data space so it is impossible to execute data.
1.10) How many I/O pins are available in the largest HC9S12C32? How many are input only?
60 total I/O pins: 58 are inputs or outputs (I/O) and 2 are input only
- / 4
Solution Manual for Introduction to Mechatronic Design Do Not Circulate Carryer, Ohline & Kenny Copyright 2011 3-1 Chapter 3 Microcontroller Math and Number Manipulation
3.1) Convert the following binary patterns to hexadecimal:
1101 01010 10011
11001100
110011000001
1101 = 0xD 01010 = 0xA 10011 = 0x13 11001100 = 0xCC 110011000001 = 0xCC1
3.2) Construct a comparison expression that will test if bits 0, 2 & 4 in a byte are all in the high state without altering the state of the byte.If ((ByteToTest & 0x15) == 0x15) is true
3.3) Construct an expression that will clear bits 1, 3 & 5 in a byte-sized variable called Bumpers while not altering any of other bits.Bumpers = (Bumpers & 0xD5)
3.4) Construct an expression that will set bit 1 in a byte-sized variable called PortA without affecting any of the other bits in the variable.PortA = (Bumpers | 0x02)
3.5) Write out the 16 bit hexadecimal representation of the following signed decimal numbers (assume the
representation is 2’s complement):
10 17 27 -45 -128 127 10 = 0x000A 17 = 0x0011 27 = 0x001B -45 = 0xFFD3 -128 = 0xFF80 127 = 0x007F
- / 4