Versions Compared

Key

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

...

This state machine governs the running state of the car and defines the conditions under which the driver can turn on and move the vehicle. Transitions for this FSM depend on the state of the directional state machine.

StateDescription

Off

The vehicle is not receiving power

Brake

The car is on, but
no pedals are pressed
braking is active

Cruise

The gas pedal is pressed
car is in motion
just enough to allow the car to coast.
DriveThe brakes are engaged and the car is not moving
Cruise ControlThe car is currently in cruise control mode


Directional State Machine

...

The ADC does conversions in groups of selected channels. Each conversion can be performed in either single mode, in which the ADC converts all the channels in the group in one single sequence, and continuous mode, where the device automatically restarts the scan after finishing the sequence, resulting in a nonstop conversion of the input channels. The 12-bit value obtained from each conversion will be stored in the ADC read-only data register (ADC_DR). To obtain the desired value from ADC_DR reading, the following formula is used:

Mathinline
body\frac{\textrm{ADC Resolution}}{\textrm{System Voltage}} = \frac{\textrm{ADC Reading}}{\textrm{Analog Voltage Measured}}

Additionally, the sequence of channels to convert is defined in the ADC's 32-bit Channel Selection register (ADC_CHSELR), which contains a series of selection bits corresponding to each analog input channel. By using this register, it is possible to select the set of channels to be converted by the ADC, making it useful for when you want to convert either a single channel or a specific set of them. 

The following formula is used to determine the ADC reading:

Image Removed

Driver Inputs

SMT32F0 Interrupts

Interrupts on the SMT32 are managed by the extended interrupts and events controller (EXTI), which allows for the management of up to 32 different interrupt lines (23 external and 9 internal). Each line can have both its active edge and interrupt priority programmed independently.

...