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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum GPIO set-reset in 50 ns
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 11 replies
  • Subscribers 678 subscribers
  • Views 3057 views
  • Users 0 members are here
  • raspberry_pi
Related

GPIO set-reset in 50 ns

Former Member
Former Member over 11 years ago

hi.

 

I am new to Pi. What I want to do is making a delay function of 50ns in python or C. I have not written  a single code for in python till now.

Please tell me if its possible or not.Should I over-clock the Pi to get that delay?

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    0 Former Member over 11 years ago

    Hi folks.

     

    Many of you guys are still confused with my specification. So Here are they in detail:-

     

    I am trying to make a screen of resolution 180X100.

    So total number of leds = 18000

    At maximum brightness each led can consume 50mA of current.

    Maximum current consumption = 18000x0.05 = 900A

    Maximum power consumption = 18000x0.05x5 = 4.5KW

     

    the screen size would be 3m by 1.33m.

     

    Strips (of length 3m) are connected horizontally in series. Power as well as the signal would also be carried horizontally.

     

    The data of pixel values to be written on screen would be provided serially from another system.

    And that is where the problem in my system lies.

     

    I have a total of 18000 leds. 3 bytes are required for each pixel. One frame requires a data of 54Kb. The refresh rate that would properly stream a video, is 25Hz.

     

    So on serial communication I would require a speed of 1.35Mbps. Maximum speed with any serial comm is 115200 i.e. 14.0625Kbps.

     

    Previously I tried with Teensy3.1 and arduino Mega. Both have the above limitation.

    That is the reason that I want to switch these boards with Pi.

     

    Following is a site were I found something related to "How to patch linux kernel with rt kernel?"

     

    https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO

     

    Let me know would it work with Pi or not.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rew
    0 rew over 11 years ago in reply to Former Member

    @John Alexander: I did not misunderstand the 50ns versus 50us. I tried to make clear that asking for 50us (1000 times longer than in the question) will already give you wildly inaccurate results.

     

    There are now two threads about this. Confusing! On another forum I frequent the moderators would close one thread and point everybody to the other thread.

     

    [When people ignore enough advice given: I switch to "answering the questions" mode. As opposed to "trying to help".]

     

    Let me know would it work with Pi or not.

     

    Yes. It will work with pi. Not with /your/ raspberry pi though.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to rew

    To write 1 to led strip you have to set data in high for 800ns and then low for  450ns.

    To write 0 to led strip you have to set data in high for 400ns and then low for  850ns.

     

    As you can see both values are in steps of 50ns. So if I am able to generate delay function in multiples of 50ns, then

     

    if(data_write == '1')

    {

      pin = HIGH;

      delaynano(800);

      pin = low;

      delaynano(450);

    }

    if(data_write == '0')

    {

      pin = HIGH;

      delaynano(400);

      pin = low;

      delaynano(850);

    }

     

    This would be much more simple.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Former Member
    0 Former Member over 11 years ago in reply to rew

    To write 1 to led strip you have to set data in high for 800ns and then low for  450ns.

    To write 0 to led strip you have to set data in high for 400ns and then low for  850ns.

     

    As you can see both values are in steps of 50ns. So if I am able to generate delay function in multiples of 50ns, then

     

    if(data_write == '1')

    {

      pin = HIGH;

      delaynano(800);

      pin = low;

      delaynano(450);

    }

    if(data_write == '0')

    {

      pin = HIGH;

      delaynano(400);

      pin = low;

      delaynano(850);

    }

     

    This would be much more simple.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • rew
    0 rew over 11 years ago in reply to Former Member

    I would write:

    pin = HIGH

    delay_nano (400);

    if (data) {delay_nano (400);pin = LOW;}

    else      {pin = LOW;delay_nano (400);}

    delay_nano (400);

    However, this way your CPU will be 100% busy during the sending of the data. There is no way you can handle more than one chain at a time. Any interrupt will corrupt one or more bits. As I said, this is in no way going to help you finish your project.

     

    You are setting your goals too far. "I want to build a rocket and go to the moon" is a project they achieve in comic books or in movies. Not in real life.

     

    For /you/ a nice project is to make fancy patterns on five of these led strips in series. Then 6*3=18 strips in series. (that's 1/16th of your big screen!)

     

    If you want you can see that as "necessary steps towards the big display".

    • Cancel
    • Vote Up 0 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