element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
Moto Mods
  • Products
  • Manufacturers
  • Moto Mods
  • More
  • Cancel
Moto Mods
Forum Generating A Rectangular wave from GPIO pin
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Moto Mods to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 3 replies
  • Answers 1 answer
  • Subscribers 58 subscribers
  • Views 860 views
  • Users 0 members are here
Related

Generating A Rectangular wave from GPIO pin

suresh_n
suresh_n over 7 years ago

Hi,

Just realised a square wave by changing the blinky output to GPIO pin 10 instead of the perfboard LED

 

I need to generate a rectangular wave with an high time of 2 ms and low time of 998 ms.

 

I'm working on ubuntu linux environment for firmware development, kconfig-mconf configuration editor to Change nuttx configuration , Hardware used is the moto mods reference mod output observe in gpio pin 10 , nuttx.tftf file flashed using mdk-utility apk on moto z.

 

 

Any suggestions on how to implement this by editing the blinky code.

 

The Edited file has been attached.

 

Open source firmware code for this example is located at https://github.com/MotorolaMobilityLLC/nuttx - specifically:

  • Build Target: https://github.com/MotorolaMobilityLLC/nuttx/tree/master/nuttx/configs/hdk/muc/blinky
  • Source Directory: https://github.com/MotorolaMobilityLLC/nuttx/tree/master/nuttx/configs/hdk/muc/src
Attachments:
stm32_modsraw_blinky.c.zip
  • Sign in to reply
  • Cancel

Top Replies

  • michaelkellett
    michaelkellett over 7 years ago in reply to suresh_n +1
    Well, actually you haven't, quite. What you have done is posted a load of links that mean I would have to do a parcel of work to find out what your target device actually is. However, I can see enough…
Parents
  • michaelkellett
    0 michaelkellett over 7 years ago

    I've looked at both your posts and nowhere do you tell us what processor, language or development tools you are using.

     

    Tell us these things, and post the blinky code you want to modify, and it will be possible for some one to help you.

     

    You might also consider how accurate the pulse timing should be and if it should be readily adjustable in the future.

     

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • michaelkellett
    0 michaelkellett over 7 years ago

    I've looked at both your posts and nowhere do you tell us what processor, language or development tools you are using.

     

    Tell us these things, and post the blinky code you want to modify, and it will be possible for some one to help you.

     

    You might also consider how accurate the pulse timing should be and if it should be readily adjustable in the future.

     

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
  • suresh_n
    0 suresh_n over 7 years ago in reply to michaelkellett

    Hi I've done the needful.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • michaelkellett
    0 michaelkellett over 7 years ago in reply to suresh_n

    Well, actually you haven't, quite.

     

    What you have done is posted a load of links that mean I would have to do a parcel of work to find out what your target device actually is.

     

    However, I can see enough to know that I can't help you (much) - you seem to be attempting something with a Moto Z (which is a phone ?)(the group you have posted this in suggests the same !) and the name of the source code file you refer to suggests that the target processor is some kind of ST Cortex part. The code is accessing the hardware via lots of library calls which are specific to the environment you are working in.

     

    In order to make progress you will need to understand the library calls and their limitations, as well as the processor your code is running on and its limitations. The processor will be very adequately documented by ST but you will need to know what it is. The library code may or may not be documented, if it's open source at least you can look at it.

     

    Normally, if you want to precisely generate a pulse on a pin you would use the timer hardware on the processor to directly control the pin. To know if this is possible in your case you would need the schematic showing exactly how the hardware is connected. The hardware approach will take a few lines of code to set up some registers in the processor, the approach taken in the c file you link to is a horribly complicated (and non-optimum) way to do a simple thing, without detailed knowledge of the whole system (hardware and software) I can't say which method of wiggling the pin is the best for you.

     

    You haven't told us the overall object of your work - that might make a difference too.

     

    MK

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
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 © 2025 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