About ARM GPIO Ports

How many GPIO ports does the STM32F407XX microcontroller have?
The STM32F407XX microcontroller has 9 GPIO ports.

How many GPIO pins does each GPIO port have?
Each GPIO port has 16 GPIO pins.

What determines which GPIO ports are brought out to physical pins?
The GPIO ports which are brought out to physical pins is determined by the package size.

What package sizes don't bring out all GPIO ports to physical pins?
The package sizes that don't bring out all GPIO ports to physical pins are smaller package sizes.

What four functions can each GPIO pin be configured to do?
The four functions each GPIO pin can be configured to do include:

  1. An input.
  2. An analog input.
  3. An output.
  4. An alternate function based on the pin number.

What do all GPIO ports have?
All GPIO ports have the same register set.

What is different between the register sets for each GPIO port?
The register sets for each GPIO port have different addresses.

What GPIO ports are brought out to physical pins on the STM32F4 Discovery boards?
The GPIO ports that are brought out to physical pins on the STM32F4 Discovery boards are ports A to E.

Push Pull vs Open Drain

What two outputs does a push-pull output generate?
The two outputs a push-pull output generates are:

  1. Logic 0 - GND.
  2. Logic 1 - 3.3V

What two outputs does an open drain output generate?
The two outputs an open drain output generates are:

  1. Logic 0 - GND.
  2. Logic 1 - High impedance, which requires an external pull-up resistor.

What are the diagrams for push-pull and open drain output circuits?
The diagrams for push-pull and open drain output circuits are:
Push-Pull And Open Drain Output Circuits.png

GPIO Port Pull-Up/Pull-Down

What does it mean to pull up a GPIO pin?
To pull up a GPIO pin means to pull the pin value toward the supply voltage.

What does it mean to pull down a GPIO pin?
To pull down a GPIO pin means to pull the pin value toward ground.

What is the diagram for a GPIO pin that can be pulled up or down?
The diagram for a GPIO pin that can be pulled up or down is:
GPIO Pin That Can Be Pulled Up Or Down.png

Pushbutton Switches

...

Alternate Functions

...

Discovery Board LEDs

What is the circuit diagram for the four LEDs on the STM32F4 Discovery board?
The circuit diagram for the four LEDs on the STM32F4 Discovery board are:
STM32F4 Discovery Board LED Circuit Diagram.png

Bit Manipulation

What are five ways you can manipulate individual bits?
Five ways you can manipulate individual bits are:

  1. x |= (1 << n) - Force bit n to be 1.
  2. x &= ~(1 << n) - Force bit n to be 0.
  3. x &= (1 << n) - Set all bits to 0 except bit n, which is left alone.
  4. x ^= (1 << n) - Invert the value of bit n.
  5. x |= ~(1 << n) - Set all bits to 1 except bit n, which is left alone.

How Does An ADC Work?

What is the first thing an Analog to Digital Converter (ADC) does with an analog signal?
The first thing an ADC does with an analog signal is capture the waveform voltage at a moment in time and holds it via a sample and hold (S/H) circuit.

What does an Analog to Digital Converter (ADC) do with the captured sample?
With the captured sample, the ADC quantizes and encodes it as a binary value at the bit resolution of the ADC circuit.

What is the circuit diagram of an Analog to Digital Converter (ADC)?
The circuit diagram of an ADC is:
ADC Circuit Diagram.png

Sampling

What is sampling?
Sampling is the process of capturing data from a signal.

At what two timing intervals can samples be made?
Two timing intervals that samples can be made at include:

  1. Regular time intervals.
  2. Sporadic time intervals.

How is sampling at regular intervals done?
Sampling at regular intervals is done at a sampling rate , or the number of samples per second.

What is the sampling interval?
The sampling interval is the time between samples, or .

What is the minimum sampling rate for an analog signal according to Nyquist?
According to Nyquist, the minimum sampling rate for an analog signal is twice the maximum frequency to be sampled.

Quantization And Encoding

What is quantization?
Quantization is the process of mapping each sample value to a discrete level represented by a sequence of bits.

How many bits is each quantization level represented with in a -bit quantizer?
The number of bits each quantization level is represented with in a -bit quantizer is bits.

How many quantization levels are there in a -bit quantizer?
The number of levels there are in a -bit quantizer are .

What is the difference between the digital sample and the analog level?
The difference between the digital sample and the analog level is called the quantization error.

What is the diagram of the quantitzation levels?
The diagram of the quantization levels is:
Quantization Levels Diagram.png

ST32 ARM ADC Features

What are the configurable resolutions of the ST32 ARM Analog to Digital Converter (ADC)?
The configurable resolutions of the ST32 ARM ADC are:

  • 6-bit.
  • 10-bit.
  • 12-bit.

...

Interrupt

What is an interrupt?
An interrupt is a signal generated by an event external to the CPU which causes the CPU to stop what it's currently doing and jump to a separate function that handles the event (Interrupt Service Routine or ISR).

What are the three properties of interrupts?
The three properties of interrupts are:

  1. Hardware or software.
  2. Maskable or non-maskable.
  3. Internal or external.

What is the diagram for how a CPU handles an interrupt?
The diagram for how a CPU handles an interrupt is:
CPU Handling Interrupt Diagram.png

Interrupt vs Polling

Example of an analogy for an interrupt

An interrupt is like the ringer on a phone. It lets you know when a call is coming in.

How must the CPU handle an interrupt?
To handle an interrupt, the CPU must receive the interrupt signal and use the appropriate ISR depending on the type.

Example of an analogy for polling

Polling is like having to pick up the phone periodically to see if someone wants to talk to you.

How must the CPU handle polling?
To handle polling, the CPU must continuously monitor flags or signals one by one for all devices and functions so it can respond when a condition occurs.

Software Interrupt

...

Hardware Interrupt

...

Interrupt Handling

...

Interrupt Service Routines (ISR)

...

Nested Vector Interrupt Controller (NVIC)

What does the Nested Vector Interrupt Controller (NVIC) do?
The NVIC prioritizes and handles all interrupts.

What can the Nested Vector Interrupt Controller (NVIC) do with interrupts?
With interrupts, the NVIC can:

  • Enable or disable interrupts.
  • Configure the priority and sub-priority of each specific interrupt.
  • Set and clear the handling bit for each specific interrupt.

How many control bits does each interrupt have?
Each interrupt has 6 control bits.

What are the different interrupt control bits and their corresponding registers?
The different interrupt control bits and their corresponding registers include:

  • Enable Bit - Interrupt Set Enable Register (ISER).
  • Disable Bit - Interrupt Clear Enable Register (ICER).
  • Pending Bit - Interrupt Set Pending Register (ISPR).
  • Un-Pending Bit - Interrupt Clear Pending Register (ICPR).
  • Active Bit - Interrupt Active Bit Register (IABR).
  • Priority Bits - Interrupt Priority Register (IPR).
  • Software Trigger Bit - Software Trigger Interrupt Register (STIR).

What Is A DAC?

What is a Digital to Analog Converter (DAC)?
A DAC is a device that converts binary numbers into analog voltage or current output.

What is the diagram for a Digital to Analog Converter (DAC)?
The diagram for a DAC is:
Digital To Analog Converter Diagram.png

Why Use A DAC?

What are Digital to Analog Converters (DACs) used for?
DACs are used to produce or recreate analog signals.

How are audio files stored and what must be done to play them back through a speaker?
Audio files are stored as digital data and must be converted to analog signals to play them back through a speaker.

What other devices are controlled with analog signals?
Other devices controlled with analog signals include:

  • Motors.
  • Servos.
  • Other electro-mechanical devices.

R-2R Resistor Ladder DAC

What type of Digital to Analog Converter (DAC) is used in the ARM devices?
The type of DAC used in the ARM devices is an R-2R resistor ladder DAC.

What does each input bit of a Digital to Analog Converter (DAC) control?
Each input bit of a DAC controls a switch between ground and the inverting input of the op amp.

When is the switch in a Digital to Analog Converter (DAC) connected to ground?
The switch in a DAC is connected to ground if the corresponding bit is zero.

The R-2R resistor ladder DAC is the ... type of DAC.
The R-2R resistor ladder DAC is the simplest type of DAC.

What is the circuit diagram for an R-2R resistor ladder Digital to Analog Converter (DAC)?
The circuit diagram for an R-2R resistor ladder DAC is:
R-2R Resistor Ladder DAC Circuit Diagram.png

STM32F4 General Timers

What three things does a timer provide?
Three things a timer provides are:

  1. Accurate timestamps.
  2. Time-interval measurements.
  3. Timer-related periodic events for hardware and software.

Up, Down, And Up/Down Modes

...

Pulse Width Modulation (PWM)

...

Types Of Motors And PWM

...

H-Bridge DC Motor Driver

...

H-Bridge Motor Control Summary

...

Servo Motor Usage

...

Servo Motor PWM Control

...

USART And UART

...

Simplex, Half Duplex, Full Duplex

...

Serial Interface Between Devices

...

UART Definitions

...

Data Framing

...

Parity Examples

...

Inter-Integrated Circuit (I2C)

...

I2C SDA And SCL Pins

...

Serial Peripheral Interface (SPI)

...

USB 1.0 Specification

...

USB 2.0 Specification

...

USB 3.0 Specification

When was the USB 3.0 specification released?
The USB 3.0 specification was released in 2008.

...