STM32F1 Firmware Development

Job ID: 39964637

Budget: $30 – $250 USD

Project: Automotive Signal Injector for Camshaft and Crankshaft Sensor Simulation
1. Project Objective

This project aims to develop an embedded system capable of simulating camshaft and crankshaft sensor signals used in automotive ECUs (Electronic Control Units).
The device will allow ECU repair technicians to perform bench tests without needing the actual vehicle, making diagnostics and repairs faster and more efficient.

2. Scope of Work

The hired engineer will be responsible only for firmware development for the STM32F103C8T6 microcontroller, according to the specifications below.
The hardware design is already defined. The freelancer must deliver a fully functional and well-structured firmware.

3. Technical Specifications
3.1 Microcontroller

STM32F103C8T6 (ARM Cortex-M3 core)

3.2 User Interface

LCD 16x2 display (parallel interface)

Approximately 30 menu/configuration screens

4 navigation buttons: Left, Right, Enter, Exit

1 analog potentiometer to adjust the output signal frequency in real time

3.3 Generated Signals

A total of 6 output signals, including:

1 main signal (crankshaft) with an amplitude of +12V / -12V, generated through a MCP4922 DAC controlled via SPI by the STM32F103C8T6.

1 camshaft signal synchronized with the crankshaft signal.

Additional outputs representing different automotive sensor patterns, totaling around 30 different signal types.

Digital Hall-type signals, both 5V and 12V levels.

3.4 Synchronization

The firmware must ensure precise synchronization between camshaft and crankshaft signals, maintaining the correct angular relationship.

The frequency must be adjustable via the potentiometer in real time, while keeping both signals synchronized.

4. Firmware Requirements

Development in C language, using HAL or LL for STM32 (to be agreed with the developer).

SPI communication with MCP4922 for analog signal generation.

Real-time reading of the potentiometer to update signal frequency.

LCD menu system for:

Selecting the type of signal (from ~30 available patterns).

Adjusting related parameters.

Handling of the four navigation buttons (Left, Right, Enter, Exit).

Modular code structure separating:

Signal generation

User interface (LCD and menus)

Input handling (buttons and potentiometer)

Hardware drivers (SPI, GPIO, ADC, etc.)

5. Documentation and Extensibility (Important Requirement)

I am also a developer, and I plan to add new signal types and LCD screens in the future.
Therefore, the firmware must be well-documented, and the engineer must provide clear instructions on how to extend the system.

The freelancer must deliver a document explaining:

5.1 Project Structure

File and folder organization.

Description of main modules (e.g., signal.c, menu.c, drivers.c).

Location of data structures, enums, or tables that define signal types and LCD screens.

5.2 How to Create a New Signal

Step-by-step instructions for adding a new signal:

Where to declare it (enum, table, struct, etc.).

How to define its waveform (lookup table, duty cycle, missing teeth pattern, phase relationship, etc.).

How to assign the new signal to physical outputs (DAC, digital pins, 5V/12V Hall output).

How to ensure synchronization with the existing crank/cam relationship.

5.3 How to Add a New LCD Screen

Where to register a new screen (menu list, state machine, etc.).

How to define the two-line LCD text.

How to link the new screen to a specific signal or parameter set.

How to configure button behavior when that screen is active.

5.4 Example Implementations

At least one fully commented example of:

Adding a new signal.

Creating a new LCD screen to select it.

6. Deliverables

Complete and functional firmware source code.

Project set up for STM32CubeIDE (or similar IDE).

Final .hex or .bin file for flashing.

A technical document (PDF or DOCX) containing:

Firmware architecture description.

Step-by-step guide for creating new signals and screens.

Special configuration details (clock, timers, SPI, ADC, etc.).

7. General Expectations

The firmware must be stable, modular, and cleanly structured, allowing future expansion easily.
The main priorities are:

Signal reliability

Synchronization accuracy

Easy maintenance and scalability