Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

StateDescription
NeutralThe vehicle is in neutral gear
ForwardThe vehicle is in forward gear
ReverseThe vehicle is in reverse

Image RemovedImage Added

Turn Signal State Machine

...

On the STM32 is a 12-bit analog-to-digital converter (ADC). The role of an ADC is to take an analog signal as an input and give as output a digital number proportional to the magnitude of the input signal. The following formula can be used to determine the ADC reading:

The ADC on the STM32 has 19 multiplexed channels, with 16 of them being mapped to analog input pins. The 16 external allowing it to read signals from 16 external sources and 3 internal sources. The pin mappings for the STM32 are as follows16 external sources are included below:


ADC ChannelPin Name
ADC_IN0PA0
ADC_IN1PA1
ADC_IN2PA2
ADC_IN3PA3
ADC_IN4PA4
ADC_IN5PA5
ADC_IN6PA6
ADC_IN7PA7
ADC_IN8PB0
ADC_IN9PB1
ADC_IN10PC0
ADC_IN11PC1
ADC_IN12PC2
ADC_IN13PC3
ADC_IN14PC4
ADC_IN15PC5

In addition, the ADC has two different modes for converting analog signals:

...

Analog-to-digital conversion of the different channels can be performed both single mode, in which the ADC converts all the channels at once in a single sequence of conversions, and continuous mode, where the device automatically restarts the scan after converting all of the different channels. The 12-bit value obtained from the conversion will be stored in the ADC read-only data register (ADC_DR).