x2-key

.pdf

School

University of North Carolina, Charlotte *

*We aren’t endorsed by this school

Course

ECGR-310

Subject

Electrical Engineering

Date

Feb 20, 2024

Type

pdf

Pages

6

Uploaded by CountWillpowerRook90

Report
Name Name NinerNET ID NinerNET ID Mid-Term X2 Mid-Term X2 ANSWER KEY r s a s s ECGR 3101 : Embedded Systems I ECGR 3101 : Embedded Systems I Fall 2023 § Wed 11/15/2023 Fall 2023 § Wed 11/15/2023 8 questions 8 questions 6 pages 6 pages 30 A • This is a timed test worth 30 points. There are 8 questions on 6 pages. No calculators/notes/books! No communication during this test! • There is one best answer to every question; do not provide more than what is asked. If any part of a statement is false, the whole statement is false. Relax! If you need to stretch or decompress, close your eyes or look up at the proctor :-) 1. (3pts) True or False? Circle the True if the statement is true; circle False if any part of the statement is false. True False The language C (and C++, by extension) has two different AND operations because they translate to different assembly instructions. yup, bit-wise AND and logical AND; AND vs CMP/Bcc True False If x=0 x1234ABCD ; and y=0 x0000F000 ; then x|y evaluates to 0x0000F000 . no, bitwise-OR is 0x1234FBCD True False The bit-wise operators in C/C++ include & , | , and ! . ! is a logical not; is bit-wise True False Using the operator in an if-statement is dangerous because regardless of whether b=1; or b=0; the following always outputs ‘yes’. if ( ~ b ) p r i n t f ( " y e s " ) ; True False In order to use the Port F pins on the MCU as an input for a switch, the following TivaWare call must be called first. YES S y s C t l P e r i p h e r a l E n a b l e ( S Y S C T L _ P E R I P H _ G P I O F ); True False In order to use the Port F pins on the MCU as an input for a switch, the following TivaWare call must be called before reading the pin. No, Input G P I O P i n T y p e G P I O O u t p u t ( G P I O _ P O R T F _ B A S E , G P I O _ P I N _ 4 ); A-1
2. (6pts) Draw the memory map for the TM4C123x MCU (the chip we use in class). Be sure to show: (a) The low and high addresses of the address space. student can write map 0 at top (book style) or FFFF FFFF at top (my style) (b) The relative location of the 256 KB of Flash (Read-Only Memory), 32 KB of RAM, and TI pe- ripherals in the map. peripheral on top, RAM middle, ROM bottom (c) Identify the location of the C program stack section in the memory map, as drawn. stack on high (address) side of RAM (d) Identify the location of the C program data section in the memory map, as drawn. data on low (address) side of RAM (e) Again using your map, as drawn, show exactly where the the variables curr and i are located in the memory map (using the C code below). curr in data; i on stack (f) Identify where the machine instructions of the C code shown below are in the memory map. code in ROM 1 i n t c u r r ; 2 i n t m a i n () { 3 i n t i , j , k ; 4 5 i = 0 ; 6 j = 0 ; 7 k = 0 ; 8 . . . 9 r e t u r n 0 ; 10 } A-2
3. (6pts) True or False? Circle the True if the statement is correct; circle False if any part of the state- ment is incorrect. True False General-Purpose Registers are located in the peripheral region of the micro- controller’s memory map. no, (general purpose) registers are in the register file True False The Arm processor R0 , SP , and PC are found in the register file. yes True False The value after reading a peripheral’s status register is 0x0000 8000 which means that there is ‘1’ in bit position 15. yes: 0000 0000 0000 0000 1000 0000 0000 0000 True False The ARM Store Register instruction STR will copy the register’s value to a loca- tion in memory. yes: STR is register memory True False The SysTick peripheral is system clock that comes with every ARM Cortex-M processor core. no, it is a counter that counts clock cycles; a system clock generates clock signals True False The Nested, Vectored Interrupt Controller (NVIC) is a peripheral that works with the processor to manage hardware interrupts. yes True False An interrupt vector table is stored in memory, not in the NVIC peripheral. yes, either RAM or ROM but never in NVIC True False The IVT is an array of character strings. an array of function pointers True False If interrupts are enabled and SysTick reaches 0, it it will generate an interrupt. yes True False If interrupts are enabled and SysTick reaches 0, the peripheral will reload counter and immediately start counting down again. also true! True False When adding a SysTick handler to the TM4C123G microcontroller, any un- used entry in Interrupt Vector Table can be used as long as it is registered in the main() . no, entries are hard-coded True False An Interrupt Service Routine (ISR) is also known as an interrupt handler. yup, they are interchangeable terms A-3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help