Show Posts
Pages: 1 [2] 3 4 ... 59
16  Using Arduino / General Electronics / Re: Problem reading random noise generator on: June 04, 2014, 02:08:44 pm
Great, thank you. I'll mess around with some things tonight and let you know what comes out.

It doesn't solve the problem, but there is one thing I did notice that you might want to change.  You are accumulating the distribution counts at the byte level inside the while loop of the map20 function, yet some of those values are being discarded.  You might want to consider at least for this preliminary testing stage to only count distribution of the bytes that are actually used to produce the mapped values (move it outside of the while loop).

I had looked at my records, and I don't have any tests on my mapping function that uses a max value of 20.  One possibility is that the algorithm has an issue with some numbers.

Another approach, if your really only interested in values of 0-20 is to not create random bytes, but to create random nibbles (4-bits).  Since the generator is producing uniform distributions you can generate random 4-bit values (0-31) with just as much validity as the 8-bit values you are currently, and then simply discard any random that is greater than 19.  You just throwing away a little less then a bit that way.  And since the calculations would be more efficient, it should actually be faster (even with the waste of random numbers) than the more general approach I suggested earlier. 
17  Using Arduino / General Electronics / Re: Problem reading random noise generator on: June 04, 2014, 12:08:33 pm
I haven't had a chance to look at your mapping code in detail, but on the surface I couldn't find anything obviously wrong.  But you may want to not use uint32_t (from my code) but instead define the data types as bytes.  Since your generating only byte size randoms, my slicing code that was designed to work with 32-bit values doesn't need the larger data type.

I did use your code with one of my avalanche noise generators, and looked at the results produced.  I can confirm that your code is producing good byte value.

Chi Square on the byte distribution:
Code:
Chi-squared test for given probabilities

data:  tmp
X-squared = 254.5149, df = 255, p-value = 0.4968

but the mapped distribution is flawed.
Code:
Chi-squared test for given probabilities

data:  ob
X-squared = 42.3098, df = 19, p-value = 0.001609

So there is something wrong with your mapping code.  I can't look at it any more today, but if you don't get another solution, I will take a look at it in a day or two.
18  Using Arduino / General Electronics / Re: Which Handheld Oscilloscope? on: June 04, 2014, 08:30:04 am
I'd tell you what I want, but it is mostly contained here:

https://www.kickstarter.com/projects/751733865/smartscope-reinventing-the-oscilloscope

You can sync two of them for four 45MHz analog channels. I'll probably get a logic analyzer for that, though.

That device doesn't seem to be much better than the DSO Quad we have been talking about.  If one assumes that the analog front end has been designed properly to actually provide a 45MHz bandwidth, then they have overdesigned it for the device, since in that case the sampling rate limits the useability of the scope.  If their specs are accurate this scope would be relatively useful (decent pictures) for signals up to about 20 MHz, and only able to provide reasonably accurate measurements for signals below 4.5MHz.  Granted that is better than the Quad we have been discussing, but it still doesn't really compare well with the low end true-scopes.  And the price differential is even less here.
19  Using Arduino / General Electronics / Re: Which Handheld Oscilloscope? on: June 04, 2014, 08:22:52 am
Typical engineers. Obsessing over numbers, not usability.

If you don't think numbers are useful, then why are you bothering to look at your signals in the first place.  BTW, this entire conversation is about usability.  That you believe this toy is 'useable' is clear, many disagree.

Bandwidth is well below the sample rate on all digital 'scopes. Usually about a tenth. That's just the way it is.

Yes, but in this case, the designer doesn't provide such a basic specification (which is very suspicious), and it is clear that you, nor most of the users of this toy understand that bandwidth is invaluable in understanding the validity of the measurements the device produces.  For instance, yes, it is well understood that when digitally sampling you need at least 5 times the sample rate as the devices bandwidth to have reasonably accurate waveforms (not the nyquist 2 times you talked about earlier).

With a scope you can make frequency measurements that are reasonably accurate right up to the bandwidth and perhaps a little beyond.  Of course frequency measurements are not what scopes are really designed for (there are other/cheaper devices that can provide that measurement more accurately).  They are designed to provide voltage measurements over time.  An a scope with a bandwidth of say 50Mhz, can only provide a reasonably accurate voltage measurement on signals below about 5MHz.  That is because the 'bandwidth' is the point at which the signal is reported at a level of about 70% (=3db) below its true value.  Of course, you can't just divide the reported voltage, since you don't know the actual 3db point, nor usually do you have an accurate frequency.  The combination is why modern scopes have such high bandwidths. 

So, if we assume this toy is properly designed, and that the version you have (older) has a bandwidth 1/5 of its sample rate of 36MSps (two channels), you have a bandwidth of about 7MHz.  That means that AT BEST this device can provide reasonably accurate measures for signals with frequencies below 720kHz.  Or not much better than audio signals...

Of course if your 4 channel overpriced logic analyzer (the function you seem most interested in) works for you, Great!
20  Using Arduino / Programming Questions / Re: Using Random() on: June 03, 2014, 06:33:53 pm
Quote
However, the output wasn't really random since I received 3 followed by 3 and later 2 followed by 2. I would not have expected these results.
So, clearly your expectations are wrong. There is nothing that says the random number generator can't generate the same number two or three times in a row, any more than there is a law that says you can't roll the same value on a die more than once. Expecting otherwise is unreasonable.

Indeed one of the markers for truly random number sequences is that repeats of the same number (as well as repeats of series of numbers) will occur with a predictable frequency.

Perhaps the OP wasn't looking for a random number, but rather a random card draw--like drawing a card from a single deck so that no card repeats.  If so there are several good examples of how to implement that in the Playground.

http://playground.arduino.cc/Main/RandomHat
https://gist.github.com/wandrson/9816376
21  Using Arduino / General Electronics / Re: Which Handheld Oscilloscope? on: June 03, 2014, 05:45:54 pm
The Quad has been out for ages now:
a) I don't understand why the price hasn't gone down.
b) Isn't it time for an update? DSO Quad II? (with little connector for the external dial/button box)

Alas, I suspect your questions provide their own answers. The price hasn't gone down because people are still buying them (and I guess it's a very small market) - hence there is no need to "waste money" on an upgrade.

I doubt if many satisfied owners would bother to buy the upgrade so the market for the upgrade would be no bigger than the present market. Two lots of investment for no extra sales.

Perhaps it's like Lego who seem to have pitched their price just right so that nobody is bothered to make a clone.

And the enthusiasm of evangelists is a wonderful sight to see smiley

...R

They have made a significant upgrade to their hardware, though it isn't advertised well.  That is why there was such a price difference between the E200 model, I quoted and the E115 one you quoted.

On the older hardware, the device is capable of sampling 72Msps for one channel, but only 36Msps if using both channels.  On the new hardware the device is capable of sampling 144Msps if only using one channel, but 72Msps if using both channels.  So the improvement is considerable in sampling, even if they didn't bother to actually improve performance by improving the bandwidth, which is well below their sample rates...
22  Using Arduino / General Electronics / Re: Potentiometer Value on: June 03, 2014, 12:01:08 pm
This web page may help explain why an audio taper pot was recommended

http://electronics.stackexchange.com/questions/50218/whats-the-difference-between-linear-and-audio-tapers-and-why-should-i-care
23  Using Arduino / General Electronics / Re: Which Handheld Oscilloscope? on: June 03, 2014, 11:46:05 am
(Two channels isn't enough...)

Again, you are conflating logic channels with analog channels. 

Let's see if this works for you instead: "Two input connectors isn't enough".


It has been for the vast majority of hobbyists and professionals for decades.  In the vast majority of cases, when you need to examine more than two signals, you need a logic analyzer functionality, not scope functionality.  Which can be had for much less than this toy...

Further, YOU clearly don't need more than two analog signals since the toy your so fond of only has two...
24  Using Arduino / General Electronics / Re: Which Handheld Oscilloscope? on: June 03, 2014, 11:43:39 am
I'd say the minimum is much higher then $400, maybe as high as $700-$800.

Considering your willingness to purchase chinese knockoffs from ebay, I find your insistance that a 'minimum' real scope costs so much...

So ... why don't you show us a 4 channel 'scope for $400, Chinese or otherwise?

That would prove your point.


When you bother to show how your using a four channel scope rather than a two channel logic analyzer and a two channel toy scope...

You might be suprised, but people made due with out such toys for years.  Logic analyzers are relatively new at the hobbyist level, and scopes when they were available were typically 20MHz analog versions.  Never-the-less such antiques (which are very cheap now) were able to solve most problems and certainly better at solving problems then this toy we are discussing.   

You have not described what precisely you are doing with three channels, when at most only two of them are 'scoped'...
25  Using Arduino / General Electronics / Re: Which Handheld Oscilloscope? on: June 03, 2014, 10:13:18 am
I'd say the minimum is much higher then $400, maybe as high as $700-$800.

Considering your willingness to purchase chinese knockoffs from ebay, I find your insistance that a 'minimum' real scope costs so much...

A quick search of Amazon (both US and UK) would indicate otherwise.

UK, 247.41, http://www.amazon.co.uk/Rigol-DS1052E-2-Channel-Oscilloscope-Bandwidth/dp/B005ZPGPI6/ref=sr_1_1?ie=UTF8&qid=1401807997&sr=8-1&keywords=rigol

US, $$390.00, http://www.amazon.com/Rigol-DS1052E-Digital-Channels-sampling/dp/B003MYND5A/ref=sr_1_2?ie=UTF8&qid=1401808036&sr=8-2&keywords=rigol

And the Current model of the DSO Quad (the one with 72Msps/channel) appears to cost not much less than the Rigol; http://www.amazon.co.uk/DSO-Quad-Pocket-Sized-Digital-Oscilloscope/dp/B005C5HTV6/ref=sr_1_4?ie=UTF8&qid=1401808225&sr=8-4&keywords=DSO+Quad is listed for 197 pounds/euros?
26  Using Arduino / General Electronics / Re: Which Handheld Oscilloscope? on: June 03, 2014, 10:04:49 am
(Two channels isn't enough...)

Again, you are conflating logic channels with analog channels.  Two very separate functions.  Indeed your beloved DSO Quad only has TWO analog channels...  There are many ways to make use of an analog scope in conjunction with analysis of digital signals...
27  Using Arduino / General Electronics / Re: Which Handheld Oscilloscope? on: June 03, 2014, 07:34:37 am
This debate seems to reduce to one view which believe one should spend (rough numbers) $400 to get the minimum useful product and another view which believes that the $200 product will be OK.

Actually, I also suggested you would be better off with a good used analog scope for less than $100... and perhaps a device like the bus pirate (or your own arduino code--always an excuse for another arduino)...

Best of luck with your purchase!
28  Using Arduino / General Electronics / Re: Which Handheld Oscilloscope? on: June 02, 2014, 03:25:46 pm
So ... basically you're saying that neither a 2-channel or a 4-channel fits the job.

No, that isn't what I said.  IME, you rarely need to analyze both a logic level signal and an analog level signal at the same time.  Now you can frequently need an analog level event or a digital signal event to capture the other in the time frame you want to analyze.  For instance, I frequently use a trigger on my logic analyzer (or custom micro-circuit) to capture a set of analog signals on my scope.  I am analyzing and debugging the analog signals, I don't care about the digital in that case.  That is one reason I like real scopes with external triggering.  Even before I had a digital storage scope, I could use the same principal, external logic analyzer to trigger an old fashioned analog scope on single trace mode.  Combine that with a polaroid and later a digital camera and I didn't 'need' a DSO scope to measure the light curve of a microsecond flash.

If the Quad DSO serves your needs, more power to you; however, the thread was about the usability for the general hobbyist.  Like I said, I think most folks will end up disappointed in the money spent for what they get.
29  Using Arduino / General Electronics / Re: Problem reading random noise generator on: June 02, 2014, 03:15:02 pm
I use two methods, depending upon mood.  Most of the time I use my computer and capture the serial port output to a text file in a background process.  For the long term test device I created code that uses a micro-SD card to save each 'block' of data to the card.  The code reuses the same memory block I use for the calibration storage, thereby allowing it to compile and run on a 328 level chip.

You can find the complete code at; https://code.google.com/p/avr-hardware-random-number-generation/source/browse/Avalanche/TRNG_SD/TRNG_SD.ino
30  Using Arduino / General Electronics / Re: Which Handheld Oscilloscope? on: June 02, 2014, 02:09:09 pm
a) They're far better than no oscilloscope at all

But a real oscilliscope purchased used is the single best option for the hobbyist on a budget amd can generally be found for less than either of the new options we are talking about.

b) 2 channels isn't enough, 4 channels pushes the price of a "real" scope far too high.

But you aren't using 4 channels.  Indeed your not clear if you are using the two analog channels as simple logic analyzer channels...  In which case, the scope portion isn't particularly of much use since you spending a lot of money for analog analysis and using  it solely for logic level.

A separate logic analyzer that isn't on the same screen as the 'scope feels like a fail to me - the two sets of signals often go together.

User interface is quite easy to deal with, even when I used to work with purely custom tools.  Personally, the user interface on these toy scopes is much less friendly to me than using proper tools with two displays.

Either way, you and the OP will use whatever you wish.  If it works for you great!
Pages: 1 [2] 3 4 ... 59