Skip to content

This project shows how to add custom GPIO-controlled LEDs to indicate motor direction in Infineon's sensorless FOC motor control demo using the Eclipse IDE.

Notifications You must be signed in to change notification settings

Mouser-Electronics/Infineon_Kit_PSC3M5_MC1_Motor_Control_Demo_With_LEDs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Motor Direction LEDs with Infineon FOC Demo

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.


Project Overview

What It Does

  • 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

Purpose

  • 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

How to Import the Project

  1. Download and extract the ZIP file provided in this repository.
  2. Open Infineon’s Eclipse IDE.
  3. Go to File > Import > General > Existing Projects into Workspace.
  4. Browse to the extracted folder and click Finish.

This will import the full workspace generated by Infineon's IDE.


Where the Code Is

All customizations are located in:

<motor-control-project-root>/main.c

New code sections are clearly marked with:

// ADDED BY MOUSER ELECTRONICS

Custom Functions Added

  • Init_LED_Pin() – Initializes GPIO pins for LED output
  • Update_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.


Expected Behavior

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

Requirements

  • 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)


License

MIT License.


About

This project shows how to add custom GPIO-controlled LEDs to indicate motor direction in Infineon's sensorless FOC motor control demo using the Eclipse IDE.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published