This project demonstrates how to enhance an existing motor control demo for Infineon's PSoC™ Control MCU by adding two external GPIO-controlled LEDs to indicate motor direction (forward or reverse). It serves as a simple and hands-on example of how developer-friendly the Infineon + ModusToolbox™ ecosystem is — even when working through the Eclipse IDE.
-
Adds two GPIO-driven LEDs that illuminate based on the motor’s direction:
- Forward: one LED turns on
- Reverse: the other LED turns on
- Motor disabled: both LEDs remain off
- Provides a visual indicator of motor behavior
- Demonstrates how to extend the FOC demo with custom I/O logic
- Highlights how straightforward it is to modify existing firmware
- Download and extract the ZIP file provided in this repository.
- Open Infineon’s Eclipse IDE.
- Go to
File > Import > General > Existing Projects into Workspace
. - Browse to the extracted folder and click Finish.
This will import the full workspace generated by Infineon's IDE.
All customizations are located in:
<motor-control-project-root>/main.c
New code sections are clearly marked with:
// ADDED BY MOUSER ELECTRONICS
Init_LED_Pin()
– Initializes GPIO pins for LED outputUpdate_LED_State(bool motor_enabled)
– Updates LED states based on motor status and direction
These functions are called from main()
and operate alongside the motor state machine.
After flashing the updated firmware:
-
The LEDs toggle based on the real-time motor direction.
-
When the motor is disabled, both LEDs turn off.
-
When the motor is running:
- If direction is forward: one LED turns on
- If direction is reverse: the other LED turns on
-
Infineon PSOC™ Control C3M5 Complete System Motor Control Kit (KIT_PSC3M5_MC1)
-
Infineon Eclipse IDE (ModusToolbox-based)
-
Two external LEDs connected to:
- P0.0 (Reverse)
- P0.1 (Forward)
-
Base motor control project (provided in this repo)
MIT License.