The solution is based on an Application Code Hub example designed for the FRDM-A-S32K344 platform.
Transmission Control Module On FRDM-A-S32K344
This article focuses on both practical implementation and core embedded system concepts:
The system follows a typical embedded control structure organised around a periodic control loop:
Transmission Control Application Architecture
Unlike systems based on push buttons or digital switches, this implementation uses a continuous analog input signal. The potentiometer provides a variable voltage level that represents the driver's throttle command. This value is continuously monitored and converted into a digital representation using the ADC peripheral. The processed value feeds a transmission model that simulates vehicle speed, selects a gear, and estimates engine RPM, which are then translated into commands for the servo (gear display) and the DC motor (speed). This approach allows smooth transitions instead of abrupt state changes and better reflects real-world automotive control systems.
The potentiometer acts as a variable voltage divider. As the potentiometer position changes, the output voltage changes continuously, the ADC acquires the voltage, and the MCU converts it into a throttle percentage. This value becomes the primary input variable for the transmission model. This process mirrors how many automotive sensors operate, where physical movement or operating conditions are converted into an analog voltage signal that must be processed by the control unit.
Unlike the DC motor, the servo motor is not driven directly by an MCU PWM channel. Instead, the MCU sends I²C commands to an external PWM controller located on the Servo Click board, which in turn generates the PWM pulses required to position the servo shaft. The transmission model computes the current gear and provides it as an input; the MCU translates the gear number into a pulse-width value and sends it to the external controller. Each discrete gear position corresponds to a specific servo angle, so the servo acts as a physical gear indicator on a graduated scale.
The DC motor is driven directly by the MCU through the eMIOS peripheral, which generates the PWM signal required by the DC Motor 2 Click H-bridge driver. As the potentiometer value increases, the PWM duty cycle also increases, resulting in higher motor speed. When the throttle is at zero, the motor is stopped; above zero, the duty cycle is clamped to a minimum dead-band value (approximately 20 % of the full range) to guarantee reliable motor start-up, and then scales linearly up to full speed. This mirrors the response of a real drivetrain to a throttle input.
The transmission model implements six forward gears plus neutral. Rather than mapping the throttle directly to a gear, the model maintains an internal simulated vehicle speed, which increases when the throttle is applied and decreases when it is released. Gear selection is performed by comparing the vehicle speed against a set of predefined thresholds:
In parallel with gear selection, the model estimates an engine RPM value based on the throttle input and the currently engaged gear. On each gear change, the RPM is smoothly adjusted — decreasing on upshifts and increasing on downshifts — to reproduce the characteristic behaviour of an automatic transmission. This smoothing avoids abrupt jumps and gives a more realistic feel to the simulation.
The application transforms the continuous throttle input into two coordinated actuator commands: a discrete gear position displayed by the servo, and a continuous PWM level applied to the DC motor. The conceptual mapping is shown below.
| Throttle Input | Transmission State | Servo Position (Gear Indicator) | DC Motor Speed |
|---|---|---|---|
| 0 % (idle) | Neutral | Rest position | Stopped |
| Low | 1st – 2nd gear | Low-gear positions | Dead-band minimum → low speed |
| Medium | 3rd – 4th gear | Mid-range positions | Medium speed |
| High | 5th – 6th gear | High-gear positions | Maximum speed |
This mapping demonstrates how a continuous sensor input can be transformed into both a discrete state (gear) and a continuous actuator command (motor speed).
Physical rotation of the potentiometer → analog voltage → ADC sample → throttle percentage → transmission model (vehicle speed, gear, RPM) → I²C command to the external PWM controller (servo position) and eMIOS PWM signal (DC motor speed). All stages are re-evaluated at a fixed update rate to keep the actuators synchronised. This direct chain from the student's hand to the actuators is the main educational value of the demo.
Required Hardware
| Component | Image | Purpose |
|---|---|---|
| FRDM-A-S32K344 |
MCU platform used to run the transmission control application, execute the transmission model, and drive the connected peripherals through ADC, eMIOS PWM, and I²C.
|
|
| FRDM K64 click shield | |
mikroBUS expansion adapter that connects Click modules to the FRDM board.
|
| Servo Click | |
Expansion board carrying an external PWM controller. It receives I²C commands from the MCU and generates the PWM pulses that drive the servo motor.
|
| Micro Servo Motor SG 180° | |
Actuator used to physically indicate the currently selected gear on a graduated scale.
|
| DC Motor 2 Click | |
Compact add-on board with a PWM-controlled, full-bridge brushed DC motor driver. It receives the eMIOS PWM signal directly from the MCU.
|
| DC Motor | |
Simulates the vehicle drivetrain speed, reflecting the throttle input applied by the user.
|
| USB-C cable | — |
Provides power and enables programming and debugging.
|
The example application demonstrates how these peripherals are connected to the MCU pins and used to simulate a complete transmission control chain, from throttle input to gear indication and drivetrain speed.
| Transmission Control Full Setup on FRDM-A-S32K344 |
|---|
The hardware configuration allows simultaneous control of a position actuator (servo motor driven through I²C) and a speed-controlled actuator (DC motor driven through eMIOS PWM).
S32 Design Studio IDE
S32K3 Real-Time Drivers (RTD)
Application Code Hub project import
| Step | Action | Sub-steps | Expected Result |
|---|---|---|---|
| 1 | Import the Project |
|
Project appears in workspace |
| 2 | Build the Application |
|
Successful build with no errors |
| 3 | Connect Hardware |
|
Board powers up and is detected by IDE |
| 4 | Flash and Run |
|
Application runs continuously |
| 5 | Functional Validation |
|
Gear indicator and motor speed respond consistently to throttle changes |
| Issue | Possible Actions |
|---|---|
| Board Not Detected |
|
| DC Motor Not Responding |
|
| Servo Not Moving |
|
| Incorrect Behavior |
|
| Unstable / Jittery Output |
|
The application can be enhanced by adding:
Closed-Loop Control
Integrate feedback sensors to dynamically adjust actuator outputs
Compare commanded vs. actual position/speed for corrective action
Additional Transmission Modes
Extend the current six-gear + neutral model with Park and Reverse modes for a full PRND emulation
Map potentiometer regions or dedicated inputs to specific transmission states
Safety Functions
Implement input plausibility checks on the throttle signal
Add fault monitoring and safe-state transitions in case of sensor or actuator failure
CAN Communication
Transmit gear, RPM, and speed information over CAN or CAN FD networks
Integrate with larger automotive powertrain systems
Continuous Versus Discrete Control
Compare button-based (discrete) and potentiometer-based (continuous) input styles
Emulate electronic throttle control, position sensing, or actuator positioning applications
Transmission control is part of vehicle motion systems, requiring:
Reliable signal processing
Deterministic control behavior
Safety-aware design
In production systems:
Redundant checks are implemented
Fault detection is mandatory
Standards such as ISO 26262 apply
Automotive transmission control units also implement input plausibility checks and safe-state fallback strategies to prevent unintended gear engagement or actuator runaway.
This transmission control demonstration illustrates how the S32K344 platform can combine analog sensing, ADC conversion, I²C communication, PWM generation, and actuator control to implement a complete embedded control application.
Using a potentiometer as a continuous input source, the system processes the throttle signal through a transmission model with six forward gears plus neutral, hysteresis-based gear selection, and RPM estimation, and translates the result into real-time commands for both a servo motor (gear indicator) and a DC motor (drivetrain speed). The project provides practical insight into the operation of automotive control systems and serves as a foundation for more advanced transmission, actuator, and motion-control applications.
| Result on FRDM-A-S32K344 |
|---|
The course provides a strong foundation for more advanced systems, including closed-loop feedback control, additional transmission modes, CAN communication, and safety-oriented designs typical of automotive transmission control modules.