<aside> <img src="/icons/map-pin_gray.svg" alt="/icons/map-pin_gray.svg" width="40px" /> Relevant Notes/Resources:

1 Introduction to the HCS12 Microcontroller

$\vdots$

14 Internal Memory Configuration and External Expansion

</aside>

Multiple Choice

These m/c questions are from F2020 exams.

  1. Where does the 9S12 processor start to execute the program when power is turned on?
    1. The program starting address is fetched form the stack pointer

    2. The program starting address is fetched from a fixed memory location

      Refer to 1.6.2 of the textbook. The HCS12 microcontroller from Freescale fetches the program starting address from memory locations at 0xFFFE and 0xFFFF into PC and then start program execution from there.

    3. The program starting address is fetched form an interrupt service routine

  2. How many bytes are reserved by the following Assembler directive: dc.b $16?
    1. 1 Byte

      Refer to DB (define byte), DC.B (define constant byte), and FCB (form constant byte).. The following directive dc.b is used to define the value of a byte that will be placed at a given location.

    2. 16 Bytes

    3. 32 Bytes

  3. After execution of the instruction: movb #$FC, $1020 the Negative Bit (N) in the CCR register will be:
    1. set

    2. cleared

    3. not affected

      Refer to Instruction Set. Just search for the movb instruction and check the condition code column.

  4. Which of the following interfaces allows the 9S12 to communicate asynchronously with peripheral devices:
    1. SCI

      Refer to 9 Serial Communication Interface. Somewhat of trick question — “Asynchronously” for SCI, “synchronously” for SPI, and “half-duplex” for IIC.

    2. SPI

    3. IIC

  5. When the jmp label instruction is executed, the following operations follow:
    1. The Program Counter PC is recovered from the stack.

    2. The Program Counter PC is overridden by the jump target.

      Refer to Instruction Set. Find the jmp instruction and check the operation.

    3. The return address and all of the CPU registers are saved in the stack

  6. Which of the following statements refers to the direct addressing mode?
    1. This mode uses 1 byte to specify the address.

      Refer to 1 Introduction to the HCS12 Microcontroller or Instruction Set. The first page explains the different address mode notations.

    2. This mode uses 2 bytes to specify the address.

    3. This mode uses sum of index register and an offset to specify the effective address.

  7. The address space of a microcontroller system is organized as follows: 2 most significant bits are used to select a page and 8 remaining bits are used to select a memory location in the page. Each memory location holds 16 bits of data. What is the capacity of the memory addressable by this microcontroller system?
    1. 2K Bytes

    2. 1024 Bytes

      Refer to 14 Internal Memory Configuration and External Expansion. $2^{10} = 1024$, not a hundred percent sure about this one.

    3. 512 Bytes

Fill In The Blanks

Some random questions I’ve picked in F2020 and F2021 exams.

  1. Consider the EEPROM of the 9S12 microcontroller which is organized as 1K x 8 bits. The first address of the EEPROM is $0800 in the address area. Determine the last address (in Hex) of the EEPROM. Write this last address (in Hex) in the box below (use Upper case for A, B, C, D, E, F):
  1. The contents of memory locations at addresses $2401, $2402 and $2403, are respectively $04, $06, and $38. What is the content of Accumulator A (in Hex) after execution of the following instructions?

    					ldx      #$2403
    					ldaa     1,-x
    					adda     1,-x
    
  1. Complete the following program to create a time delay of $98\ \mu S$. Assume that the E-clock signal frequency is $1\ \textrm{MHz}$.