STM32 – PWM, ADC, FFT, LCD

    Cards (7)

    • What factors affect the choice of sampling frequency for the ADC?
      ·        Signal Band width
      ·        Nyquist Shannon sampling frequency - especially when the sampling frequency has to be at least 2x the max frequency.
      ·        ADC resolution
    • The STM programming made significant use of the HAL library. Why do you think this was and what advantages does it offer?

      ·        This library simplifies the programming process. It does so by provide a consistent interface which makes it easier to port code across different microcontrollers.
      ·        This helps in portability and ease of development.
      ·        Optimises code size and promotes code reuse.
    • The ADC and PWM made use of interrupt functions. What is an interrupt and give an example of how they were used?
      ·        Interrupt is a mechanism that allows the microcontroller to stop what its doing and perform a different specific task and then go back to the original task.
      ·        Example: In ADC a interrupt may be called when a conversion has been completed, in order for the processor to read the result
    • Explain what is an FFT? How might you implement this on a micro-controller such as the STM32?
      ·        FFT is an algorithm that analyses the frequency content of a signal
      ·        In STM32 there various libraires like the microcontroller software which has multiple functions that help enhance the calculation of FFT
      ·        CMSIS DSPCortex microcontroller software interface standard digital signal processing
      ·        Libraries optimise functions for FFT calculations
    • The LCD module supports both 4-bit and 8-bit modes. In terms of advantages and disadvantages, what are the differences between these two modes?
      ·        The 8-bit mode has a faster data transfer and can send more data at once. However, it requires more pins
      ·        A 4-bit mode requires less pins therefore conserves pins. However, the speed of data transfer might be less than the 8bit.
    • Explain the different types of ADC implementation you can do with the STM32 microcontroller you used?multiple
      ·        Single mode
      ·        Continues conversion.
      ·        Scan mode
      ·        In single mode the ADC samples one channel continuously, while in scan mode the ADC samples over multiple channels sequentially
      ·        Continuous conversion mode ADC continuously and repeatedly samples input signal without any external trigger or intervention
    • How do you calculate the sampling frequency of the ADC used in the STM32 microcontrollers?
      ·        Sampling frequency = 1/sampling time+ conversion
      ·        Where sampling time is the time taken to acquire the analogue signal
      ·        Where conversion time is the time taken to convert the analogue signal into a digital value
      ·        This can then be implemented in the ADC configuration in the software
    See similar decks