Go to advanced search

by mbferguson
Thu Dec 06, 2018 1:36 am
Forum: General discussion
Topic: Nanosleep in C gives 60us overhead on Raspberry Pi
Replies: 11
Views: 969

Re: Nanosleep in C gives 60us overhead on Raspberry Pi

By deleting the nanosleep calls, and adding in a bunch of if statements that don't do anything, I was able to get pretty close to 100ns. But the oscilloscope is jumping back and forth between two waves, the 100ns, and 200ns images below. https://i.imgur.com/FqIqseZ.png https://i.imgur.com/IA8q2hC.pn...
by mbferguson
Thu Dec 06, 2018 12:54 am
Forum: General discussion
Topic: Nanosleep in C gives 60us overhead on Raspberry Pi
Replies: 11
Views: 969

Re: Nanosleep in C gives 60us overhead on Raspberry Pi

There have been some peeps on here that got very high MHz frequencies, much greater than 5MHz. Is it really necessary to use a vibrator multistablor?
by mbferguson
Wed Dec 05, 2018 11:42 pm
Forum: General discussion
Topic: Nanosleep in C gives 60us overhead on Raspberry Pi
Replies: 11
Views: 969

Re: Nanosleep in C gives 60us overhead on Raspberry Pi

Using the following command gave this:

$ sudo chrt -v -r 99 /usr/bin/taskset -c 2 ./myfile

Image

Only 15us, but still not close to 100ns.
by mbferguson
Wed Dec 05, 2018 11:32 pm
Forum: General discussion
Topic: Nanosleep in C gives 60us overhead on Raspberry Pi
Replies: 11
Views: 969

Nanosleep in C gives 60us overhead on Raspberry Pi

I'm trying to toggle the GPIO pin at a pulse width of 100ns. I have used a singe core by isolating core 2 on my four core Raspberry Pi model 3b, and then running my program on that core with taskset command. Here's my code: https://i.imgur.com/Yrz5QNo.png This was taken from https://elinux.org/RPi_G...
by mbferguson
Wed Nov 28, 2018 6:01 am
Forum: General discussion
Topic: Toggling GPIO pins for pulse width of <100ns
Replies: 35
Views: 1632

Re: Toggling GPIO pins for pulse width of <100ns

mbferguson, Never mind "supposed" go and measure it. We can only tell by looking at it with the scope. I have all the components and am soldering them all now :mrgreen: I originally wanted to wait on the simulation to ensure things were working, which I wasn't able to get right until before Thanksg...
by mbferguson
Tue Nov 27, 2018 11:13 pm
Forum: General discussion
Topic: Toggling GPIO pins for pulse width of <100ns
Replies: 35
Views: 1632

Re: Toggling GPIO pins for pulse width of <100ns

All you need to detect the change between high and low (assuming a high voltage) is to through capacitive isolation bias the input to by division. As long as you bias it so that it will be high value when needed. Now you will have to skew it to have a large enough change in range for a digital sign...
by mbferguson
Tue Nov 27, 2018 10:49 pm
Forum: General discussion
Topic: Toggling GPIO pins for pulse width of <100ns
Replies: 35
Views: 1632

Re: Toggling GPIO pins for pulse width of <100ns

The MCP3008 sounds more like it at 200ksmps. If you can get them into the Pi at that rate. Personally I would consider skipping the ADC. Just add some signal conditioning to get a nice pulse into the GPIO pin that you can then time. Why are you wanting to use a Pi for this? The output pulse and ret...
by mbferguson
Tue Nov 27, 2018 7:29 pm
Forum: General discussion
Topic: Toggling GPIO pins for pulse width of <100ns
Replies: 35
Views: 1632

Re: Toggling GPIO pins for pulse width of <100ns

Where do you want to use the ADC for. And what for frequency do you want to measure. Because the adc need to be at least 2 times faster then the signal you want to measure (Nyquist). Also, you say you don't want to use a ADC. But give a replacement part for the ADC? Here you can find more suitable ...
by mbferguson
Tue Nov 27, 2018 7:20 pm
Forum: General discussion
Topic: Toggling GPIO pins for pulse width of <100ns
Replies: 35
Views: 1632

Re: Toggling GPIO pins for pulse width of <100ns

What about that 860 SPS rate? What kind of time of flight are you expecting to see? Sorry have no idea about that sensor but I imagine it can be very short. The medium being measured is Aluminum, speed of sound is 6320m/s. The dimensions of my object are 20cm x 20cm x 1.5cm and will be measured fro...
by mbferguson
Tue Nov 27, 2018 7:05 pm
Forum: General discussion
Topic: Toggling GPIO pins for pulse width of <100ns
Replies: 35
Views: 1632

Re: Toggling GPIO pins for pulse width of <100ns

Why do you want mV resolution, you only need to know when a pulse comes back? You could do that with a comparator circuit. Correct, my apologies. I can confuse myself since I've been working on this for a while, going through different iterations of how it will work. The voltage shouldn't matter, o...
by mbferguson
Tue Nov 27, 2018 5:24 pm
Forum: General discussion
Topic: Toggling GPIO pins for pulse width of <100ns
Replies: 35
Views: 1632

Re: Toggling GPIO pins for pulse width of <100ns

What you can not do is respond to that pulse from Linux in any guaranteed time. The only thing that is necessary is determining the time of flight of the wave between emission and recievsion. By respond, do you mean counting clock cycles accurately, or communicating this information to the Arduino ...
by mbferguson
Tue Nov 27, 2018 5:13 pm
Forum: General discussion
Topic: Toggling GPIO pins for pulse width of <100ns
Replies: 35
Views: 1632

Re: Toggling GPIO pins for pulse width of <100ns

Do read that whole thread, it's not so long, to see how well it worked out. Will do my good sir. An update will be posted with progress soon. :geek: ADC I'm planning on using --> https://www.amazon.com/gp/product/B01DLHKMO2/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1 Datasheet: http://www.ti.com/li...
by mbferguson
Tue Nov 27, 2018 5:08 pm
Forum: General discussion
Topic: Toggling GPIO pins for pulse width of <100ns
Replies: 35
Views: 1632

Re: Toggling GPIO pins for pulse width of <100ns

davidcoton wrote:
Tue Nov 27, 2018 9:43 am
How on earth are you going to check what is happening withoput an oscilloscope?

I'm out.
Woah there buddy. Slow down nessy.

I don't have an oscilloscope IN MY BEDROOM.

There are many good oscilloscopes in my university electronics lab 8-)

Also, it was a pretty good netflix show. :cry:
by mbferguson
Tue Nov 27, 2018 2:51 am
Forum: General discussion
Topic: Toggling GPIO pins for pulse width of <100ns
Replies: 35
Views: 1632

Re: Toggling GPIO pins for pulse width of <100ns

Gavinmc42 wrote:
Tue Nov 27, 2018 2:46 am
Setup a hardware PWM with clock of 19.2MHz , a width of 1 at a period of 24,000?
I'm not following the width of 1 and period of 24,000. :oops:
by mbferguson
Tue Nov 27, 2018 2:32 am
Forum: General discussion
Topic: Toggling GPIO pins for pulse width of <100ns
Replies: 35
Views: 1632

Re: Toggling GPIO pins for pulse width of <100ns

rzusman wrote:
Tue Nov 27, 2018 2:31 am
Raspbian IS Linux...
Said like a true Linuxian 8-)
by mbferguson
Tue Nov 27, 2018 2:08 am
Forum: General discussion
Topic: Toggling GPIO pins for pulse width of <100ns
Replies: 35
Views: 1632

Re: Toggling GPIO pins for pulse width of <100ns

A lot of the limit depends on what else you also need to do in your program. My Pi will simply be sending a 50ns pulse, up to 800 times per second. My analog to digital converter is 16-bit precision and can sample up to 850 samples/s. All the Pi will be doing is: Toggling the pin to 3.3V HIGH, wait...
by mbferguson
Tue Nov 27, 2018 1:13 am
Forum: General discussion
Topic: Toggling GPIO pins for pulse width of <100ns
Replies: 35
Views: 1632

Re: Toggling GPIO pins for pulse width of <100ns

It is quite easy to get pulse times of that range, and a bit shorter. You will definitely need to use C or another compiled language to reach that kind of speed. Keeping Linux out of the way will be the hard part, though it is possible. Alternately you could do so in Ultibo for your OS instead of L...
by mbferguson
Mon Nov 26, 2018 11:38 pm
Forum: General discussion
Topic: Toggling GPIO pins for pulse width of <100ns
Replies: 35
Views: 1632

Re: Toggling GPIO pins for pulse width of <100ns

Why don't you try it and find out? That answer would be far more valuable than trying to resolve conflicting reports of other people's results. You could even write up the results here. :D I'm watching netflix right now, and would rather have someone else do it for me :mrgreen: Also, no oscilloscope.
by mbferguson
Mon Nov 26, 2018 11:05 pm
Forum: General discussion
Topic: Toggling GPIO pins for pulse width of <100ns
Replies: 35
Views: 1632

Toggling GPIO pins for pulse width of <100ns

I'm trying to use the PI's 3.3v logic gpio pins to create a short pulse that lasts around 50-100ns. Googling 'GPIO pin toggle speed' gives many different answers that don't agree with one another. Is this possible? What would be the limitation of pulse width if I was running a small program in pytho...
by mbferguson
Tue Nov 20, 2018 4:53 pm
Forum: General discussion
Topic: Hexdump outputting too many radixes (was) VERY ANNOYING!!! [Solved]
Replies: 9
Views: 436

Re: Hexdump outputting too many radixes VERY ANNOYING!!!

Jamesh, why is there no way to upvote/like comments on this forum? When someone help me I want to give them the thumbs up, and the only way to tell if someone is a forum badass is by their post count. I could simply post a bunch of wrong answers and pretend I'm a cool guy then... Why not just a qui...
by mbferguson
Tue Nov 20, 2018 4:41 pm
Forum: General discussion
Topic: Hexdump outputting too many radixes (was) VERY ANNOYING!!! [Solved]
Replies: 9
Views: 436

Re: Hexdump outputting too many radixes VERY ANNOYING!!!

Jamesh, why is there no way to upvote/like comments on this forum? When someone help me I want to give them the thumbs up, and the only way to tell if someone is a forum badass is by their post count. I could simply post a bunch of wrong answers and pretend I'm a cool guy then...
by mbferguson
Tue Nov 20, 2018 3:20 pm
Forum: General discussion
Topic: Hexdump outputting too many radixes (was) VERY ANNOYING!!! [Solved]
Replies: 9
Views: 436

Re: Hexdump outputting too many radixes VERY ANNOYING!!!

I found the answer in the BMP documentation. There is simply an enormous amount of header information, color definitions, etc. So now I get to write a java program to print 0x in front and comma after of all the radixes :lol:
by mbferguson
Tue Nov 20, 2018 1:51 pm
Forum: General discussion
Topic: Hexdump outputting too many radixes (was) VERY ANNOYING!!! [Solved]
Replies: 9
Views: 436

Hexdump outputting too many radixes (was) VERY ANNOYING!!! [Solved]

I am trying to get some icons to display on my arduino TFT screen. I'm using the following example on the mcufriend library --> drawBitmap_kbv. There is a clear way he has gone about putting the bitmap radixes into an array. He is using a 64x64 bit icon, I don't want my icon to be that big but I'm s...
by mbferguson
Sun Nov 18, 2018 3:48 pm
Forum: General discussion
Topic: Ban from Raspberry Pi forums. [Self-imposed.]
Replies: 33
Views: 2436

Re: Ban from Raspberry Pi forums. [Self-imposed.]

I like me some forum drama 8-)

Wouldn't it just be a leave of absence though? That's like saying you are self-banishing yourself from your country when you leave to go on vacation. :mrgreen:

Go to advanced search