microcontrollers?

profileasher0411
microcontrollers.pdf

1

E&CE 371 - Homework 1 due by 11:59 pm Fri 6/27/14 Please scan your homework solutions and email to grader ([email protected]) with a copy to me ([email protected]). 1. Briefly describe the basic difference between a microprocessor and a microcontroller. 2. List the different types and corresponding sizes (in bytes) of the memory resources contained in the MC9S12DP256B microcontroller chip. 3. Which of the following resources are NOT contained on the MC9S12DP256B microcontroller? Circle your answer. - A/D converter - D/A converter - Timer - Pulse Width Modulation signal - Serial I/O

2

4. (a) How many pin connections are there on the MC9S12DP256B microcontroller chip? (b) How many 8-bit ports are there on the MC9S12DP256B microcontroller? Also list each of them. 5. (a) What the primary difference between EEPROM and Flash EEPROM, in terms of how they can be used? (b) Approximately how many times can a typical EEPROM be reprogrammed? (See Section 4.7 in text.) (c) Approximately how many times can a typical Flash EEPROM be reprogrammed? (See Section 4.7 in text.)

3

6. How many different Operating Modes can be selected for the MC9S12DP256B microcontroller? (b) How can the Operating Mode for the MC9S12DP256B microcontroller be selected? 7. Describe the "Normal Single Chip" Operating Mode and indicate how this mode can be selected. (b) Describe the "Normal Expanded Wide" Operating Mode and indicate how this mode can be selected. (c) Describe the "Normal Expanded Narrow" Operating Mode and indicate how this mode can be selected.

4

8. (a) In the Normal Expanded Wide mode or the Normal Expanded Narrow mode, the MC9S12DP256B microcontroller can fetch external RAM memory over the address range of 4000H through FFFFH. From what ports does the microcontroller send out the 16-bit address of the RAM memory it is trying to access? (b) What control signals does the microcontroller send out when it is trying to read from this external memory? Provide the names of these signals and tell where they come from (which pins of which ports). (Assume that the microcontroller is using the Normal Expanded Wide mode for this part of the problem.) (b) Indicate the logic value of the signals of part (b) for a "memory read" operation. (Hint: One of these signals starts out as a 0, then changes to a 1.) (c) Referring to part (b), how does the answer change in the operation is “memory write” instead of “memory read.”

5

9. The maximum available memory address space for flash memory on the MC9S12DP256B is 1M byte (1024K bytes). Since the size of internal flash memory is only 256K, the other 768K would have to be implemented using external memory. A 20-bit address bus would be required to fetch instructions from external flash memory from the 1M address space. The MC9S12DP256B sends out a 20-bit address using the following ports: A7-A0 from Port B A13-A8 from Port A (bits 5 – 0 of Port A) A19-14 from Port K (bits 5 – 0 of Port K) If the MC9S12DP256B is presenting the following values on the pins listed below, at the time that it sends out a low-to-high transition on the ECLK pin, from which external memory location (or locations) is it trying to read from? Lstrb* = 0 (The “*” indicates that this is a low-active signal.) Port A = 82 hex Port B = 40 hex Port K5-0 = 100111 binary R/W* = 1 (b) repeat for Lstrb* = 1 Port A = 82 hex Port B = 40 hex Port K5-0 = 100111 binary R/W* = 1 (c) repeat for Lstrb* = 0 Port A = 82 hex Port B = 41 hex Port K = 100111 binary R/W* = 1

6

(d) What should happen in the memory interface when a low to high transition occurs on the ECLK signal from the microcontroller? 10. Provide a logic diagram that shows how a MEMR* (sometimes called OE*) signal and a MEMW* signal can be generated from the appropriate control signals sent out by the MC9S12DP256B microcontroller.