GoConqr has a new look! Let us know what you think.

Flashcards

mbed_exam2_p2

Charlotte Gonzalex English 8 cards

Cards in this deck (8)

  1. 1Describe how you could create a PWM similar functionality in software.With a digital output and some timing. By setting time (how long) a pin should be high or low.
  2. 2When using libraries, an embedded system program typically consists of multiple source and header files. Describe the main role of the linker in this case.A computer program that takes one or more object files generated by a compiler and combines them into one executable program
  3. 3An include guard (see below) is implemented with precompiler statements. #ifndef TEST #define TEST #endif (a) Where are include guards typically implemented?in header files
  4. 4An include guard (see below) is implemented with precompiler statements. #ifndef TEST #define TEST #endif (b) Explain what an include guard “guards” against and describe how it works.#ifndef: define variables and function prototypes only if they have not been defined. Based on #define values.
    #define: Preprocessor replaces with actual value associated that name
    #endif: Uses #if before. If the statement is defined it complies the code. Specify the end of the statement.
  5. 5How does a PWM work?- PWM turns a GPIO pin on & off
    - The on & off period is configurable
    - Only some pins support PWM
    - It simulates an analog output at a digital pin
  6. 6A 32768 Hz clock signal is connected to a timer module. The module uses a prescaler with a division on factor 8 and its counter is 16 bit wide. How long will it take for the timer to count from 0 to its max value?f = 32768 Hz
    T = 1/f=3,05*10^-15
    T/8 =3,81*10^-6
    2^16 = 65536
    65536*(3,81*10^-6) = 0,25 s
  7. 7Consider the following line of code for the EFM32HG microcontroller. GPIO->P[4].DOUT |= (1 << 7); (a) What does this line of code do? Describe how it works.Sets pin 7 to 1 in register for pins pushpull outputs (4)
  8. 8Consider the following line of code for the EFM32HG microcontroller. GPIO->P[4].DOUT |= (1 << 7); (b) Explain why the arrow operator is needed.Because its a pointer, it points at pin register 4

Information

Description
Flashcards on mbed_exam2_p2, created by Charlotte Gonzalex on 14/01/2020.
Created by
Charlotte Gonzalex · Jan 2020
Updated
Jan 14, 2020
Views
2
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?