[SOLVED] ENCE361 Tutorials

30.00 $

Category:

Description

5/5 - (1 vote)

Lecture 2 (ARM Intro – Not tested)

  1. What does the following code do?
CMP R0,              #9;                                                            ITE GT;                                                                              ADDGT R1, R0,   #65;                                               ADDLE R1, R0,    #48;

 

Lecture 4 (ADC I)

  1. According to Shannon-Nyquist theorem, we must sample at more than twice the highest frequency to reproduce the original waveform. Why not sampling at twice the highest frequency?
  2. What is the condition called that refers to the distortion caused by sampling below the Nyquist rate?
  3. What does 1/Ts represent and what units does it have?
  4. If signal averaging is used for sampling an input signal of with a highest frequency f max, what is the relationship between M , f max and the sampling rate f s to ensure that the signal averaging operation does not introduce significant aliasing? sampling rate of at least 2*M* f max (M = samples)

Lecture 5 (ADC II)

  1. Understand the example code c with help of the following documents
  • Using the Stellaris Microcontroller Analog-to-Digital Converter (ADC).pdf
  • TivaWare Peripheral Driver Library Users Manual.pdf
  1. What type of ADC is used on the Tiva C-Series Launchpad?
  2. What common instrument uses a dual-slope integrating ADC? Digital multimeter (DMM)
  3. How many analog channels are supported by the Tiva C-Series Launchpad ADC?
  4. What is the range of quantisation error in volts for an 8-bit quantiser with an input range 0 – 3 V?
  5. If the maximum signal frequency is 500 Hz and 12-bit quantization is being performed with signal averaging over 15 consecutive samples, what is the minimum sampling rate? 2*fmax*samples = 15 kHz
  6. A 3-bit uniform quantisation with Vmax = 1 V and Vmin = 0 V, quantization step Δ = 1/8 and Analogue input = 0.425 V.

Find the (3-bit) quantisation result in binary from the control unit.

Start with bin code 100

 

Lecture 6 (Noise)

  1. A primary source of noise in resistors is due to thermal (Johnson) noise
  • What is the noise RMS voltage of a 1 MΩ resistor at 300° K over a 100 kHz bandwidth?
  • What is the noise RMS voltage of a 1 MΩ resistor in parallel with a 1 kΩ resistor at 300° K over a 100 kHz bandwidth?
  1. In the example with SNR = 20 dB shown on slide 12, the average power of the signal is 0.9 W (ignoring the DC offset). What is the average power of the noise?
  2. In slide 12, explain why the noise amplitude on the right (obtained via signal averaging with M=32) is significantly less than that on the left (obtained via signal averaging with M=16).
  3. For a sinewave with amplitude A and frequency f Hz, What is the maximum error magnitude is ∆𝑉 = 2𝜋𝑓𝐴∆𝑡?
  4. A 4-bit uniform quantization with 16 discrete values.
  • Find the Quantization step Δ.
  • Find the Random error with maximum magnitude.

 

Lecture 7 (Interrupt Processing I)

  1. Can the c program achieve a comparable performance without using interrupts? If so, how? If not, why not?
  2. By looking within the microprocessor datasheet TM4C123GH6PM Data Sheet.pdf, find out how many sorts of interrupts can be generated by the ADC and Timer modules. List all the types (assuming all timers are the same and ADC channels are the same).
  3. In general, how can a compiler decide which of the registers need to have their contents saved as part of the context?

 

Lecture 8 (Buffering)

  1. Using circBufT.c as a model, write C code to implement the function initDbleBuf ().

int32_t *initDbleBuf (dbleBuf_t *buffer, uint32_t size);

  1. Write C code to implement the function writeDbleBuf ().

void writeDbleBuf (dbleBuf_t *buffer, int32_t entry);

  1. Could you use the functions prototyped in circBufT.h and implemented in circBufT.c to implement a FIFO buffer (Slide 17)? If so, how? If not, why not?
  2. In the call to displayMeanVal () on Slide 13, the expression in red finds a rounded value for the mean using only integer arithmetic. Comment on the order of operations in the expression, does the order matter?

 

Lecture 9-10 (Serial Communications)

  1. A particular UART-to-UART transmission is set for 1 start bit, 8-bit data, odd parity and 2 stop bits. Which of the following 4 strings are received without detectable error and what is the data word in each of those cases?
  2. 0101 0101 1111
  3. 0011 1000 1111
  • 0010 0110 1111
  1. 0111 1000 1001
  2. UART units on the Tiva Microcontroller have Tx and Rx FIFO buffers. What is the difference between a FIFO buffer and a circular buffer?
  3. What are the advantages and disadvantages of using a blocking Tx function?

Lecture 11 (Interrupt Processing II)

  1. Can static variables be used for inter-thread communication?
  • If so, how? If not, why?
  1. In the vending machine example, if initially, there are indeed 21 chocolate bars, the sold out information may not be displayed
  • Why? How to fix it?
  • Read about the use of NVIC_ISER and NVIC_ICER registers

Lecture 12 (Interrupt Processing III)

  1. Consider Slide 6. If the function lSecondsSinceMidnight() starts being executed at the time when the global variables have values iSeconds = 59, iMinutes = 59 and iHours = 3. After an interrupt occurs, what is the biggest difference possible between the value the function returns and the actual number of seconds since midnight?
  2. Consider the discussion of the use of the C keyword volatile on Slides 12 and 13. The two global variables in the example code for tick64Test.c (available on Learn) are declared as volatile. Is this necessary? If so, why?
  3. Why is there a shared data problem associated with the conventional read-modify-write operation used on many microprocessors to write to (i.e., to change) individual bits on I/O ports? Describe a scenario in a program using interrupts where the shared data problem exists.

Lecture 13.1 (UI Design)

  1. Consider a GUI which implements the game Tetris on the TIVA using the navigation buttons (e.g. UP to rotate the falling piece clockwise and slider SW1 for starting a new game). List a set of functions that would be needed for the GUI and decide which would belong in each of the MVC components.
  2. Design an FSM (in the form of a state – diagram) which could be used to control a simple oscilloscope-type display on the TIVA (e.g. setting vertical and horizontal scale, selecting input channel, etc.). Assume that, as well as support for writing characters (which you have already), support is available for graphics (via individual pixel addressing) on the 128 × 21 OLED display.
  3. With the aid of diagrams, explain the concepts of proximity, continuity, similarity, and closure as they relate to graphical user interfaces.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4.1