element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
IoT on Wheels Design Challenge
  • Challenges & Projects
  • Design Challenges
  • IoT on Wheels Design Challenge
  • More
  • Cancel
IoT on Wheels Design Challenge
Blog walkingwheels on Water  #14 Power Issues for Nucleo and Hardware Test Passed
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fyaocn
  • Date Created: 8 Nov 2017 2:21 AM Date Created
  • Views 580 views
  • Likes 1 like
  • Comments 0 comments
  • walkingwheels
Related
Recommended

walkingwheels on Water  #14 Power Issues for Nucleo and Hardware Test Passed

fyaocn
fyaocn
8 Nov 2017

1. Although the software has been completed there are still some problems with power supply.

I supply power with battery via USB. The st-link part works and the main part with STM32L476 chip does not.

image

It appears that  only PWR_EN is needed to enable the USB power. But it is not the case for Nucleo-F401 after test.

The power supply is provided either by the host PC through the USB cable, or by an external source: VIN (7V-12V), E5V (5V) or +3.3V power supply pins on CN6 or CN7.

Then I change to VIN. There are three external power input, VIN, E5V, +3.3V. For VIN, 7-12V is required. In my hardware test, 5.25V works fine. Since the specification of LD1117 can handle such power input.

The +3.3V and VIN is accessible in arduino compatible connector CN6, But E5V is only accessible in Morpho connector CN7.

2. Another problem comes that PWM can not drive the L298N even the code is OK. I think the PWM can not response to PWM in higher frequency. Make the switch frequency slower can solve the problem.

I use digitalwrite to make it work and change the Switch Part as follows,

DigitalOut motorA(A5, 0);
DigitalOut motorB(A4, 0);

... ...

switch (flycontrol)
    {
        case 0:         // Stop
            pwml=0;
            pwmr=0;
            motorA=0;
            motorB=0;
            pc.printf("\r\nflycontrol=%d\r\n",flycontrol);
            break;
        case 1:         //Fly
            pwml=PWM_FLY;
            pwmr=PWM_FLY;
            motorA=1;
            motorB=1;
            pc.printf("\r\nflycontrol=%d\r\n",flycontrol);
            break;
        case 2:         //turn left
            pwml=pwml-PWM_DELTA;
            pwmr=pwmr+PWM_DELTA;
            motorA=0;
            motorB=1;
            pc.printf("\r\nflycontrol=%d\r\n",flycontrol);
            break;
        case '3':         //turn right
            pwml=pwml+PWM_DELTA;
            pwmr=pwmr-PWM_DELTA;
            motorA=1;
            motorB=0;
            pc.printf("\r\nflycontrol=%d\r\n",flycontrol);
            break;
        case 4:         //Speed up
            pwml=pwml+PWM_DELTA;
            pwmr=pwmr+PWM_DELTA;
            pc.printf("\r\nflycontrol=%d\r\n",flycontrol);
            break;
        case 6:         //Speed down
            pwml=pwml-PWM_DELTA;
            pwmr=pwmr-PWM_DELTA;
            pc.printf("\r\nflycontrol=%d\r\n",flycontrol);
            break;
        default: // Nothing change if not 1~6
            pwml=pwml;
            pwmr=pwmr;
        break;
     }

 

3. Then it works fine. I can control both motors from mobile. The rest work is mechanical part.  I will make it in last blog.

image

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube