Microcontroller with inbuilt high speed ADC

Status
Not open for further replies.

tinto

Junior Member level 2
Joined
Mar 23, 2011
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Kerala, India
Activity points
1,413
I would like to build a digital oscilloscope. For that I am looking for a micro controller with inbuilt high speed ADC. I found PIC18F4523. But I don't know how much is the speed of the ADC in it. Can anyone please recommend me a good micro controller for this purpose?
 

you can see the specification of the PIC18F4523 on
PIC18F4523

It all depends on what bandwidth you require for the oscilloscope.
Unless you are looking for a very expensive microcontrooler with fast ADCs have a look at the dsPIC range
For example, the Microchips Microstick could be a good starting point
**broken link removed**

it comes with a PIC24HJ64GP502 - the documentation mentions 1-A/D 10x12-bit @ 500(ksps)
PIC24HJ64GP502

otherwise PIC32 or ARM or Texas ?
Digital Signal Processing (DSP) | Texas Instruments

how are you planning to display the results?
 
Reactions: tinto

    tinto

    Points: 2
    Helpful Answer Positive Rating
I am now planning to display it on a LCD screen. I have already built an oscilloscope for my mini project. But that one was very slow. Now I am planning to build a new one with a capability of showing frequencies up to mega hertz range. Is this possible with dsPICs?
 

not directly unless you get an ADC which can sample at least 10Msamples/sec and you would need a very fast DSP processor -in the past I have used a Texas TMS320C6000 series for such applications but the cost was about £3K for the complete system.
The PIC24HJ64GP502 specification mentioned 500ksps - you could sample over a number of cycles building up a display like a sampling oscilloscope
https://www.cbtricks.com/miscellaneous/tech_publications/scope/sampling.pdf

would be worth looking at PIC32 and ARM systems
 
Reactions: tinto

    tinto

    Points: 2
    Helpful Answer Positive Rating
Hello!

What do you mean by "it was very slow". How slow?
If you sample a burst with a microcontroller, you can sample at the MCU sampling frequency.
Display can be done after sampling. You will miss everything while you are displaying, but hey,
it's a sub-100USD project, not a real scope.
One first improvement might be to use an ARM processor (If I remember correctly, TI ARM series
can sample at 2 Mbps). Look for other makers, maybe there are some chips with higher sampling
rates. But this will still be a cheap scope. And for any processor I know, if you have a max sampling
of, say, 200 kHz, then it will be max 100 kHz for 2 channels, 50 kHz for 4 channels and so on.

If you really want fast sampling, then you will have to pay for it.
I mean: if you want to display from DC to 20 MHZ, then Nyquist does not apply here, you'll have
to sample to about 10 times the highest frequency you want to observe. I guess you understand
that if you have 2 samples per period only (Nyquist), then you cannot observe anything.
For example, the scope I recently bought is a 4x100 MHz, but it samples at 2.5 GHz per channel.

Now back to your MHz range scope. A microcontroller is not designed to implement fast
sampling. The purpose is to have a one-chip solution with fair ADC accuracy and some
processing for measurement / control, etc.
For a decent MHz range scope, I think you need to make a clean analog hardware
followed by an ADC unit (possibly using a small GAL or FPGA) that runs independently and
stores input data to extra fast ram. But this will not be a cheap solution.

I don't know what you want to do, so it's difficult to give you relevant advice. As Horace
told you, if you want some MHz capabilities, it will cost you... maybe more than a real
scope. He says 3K pounds for a DSP system. For this price, you can already buy a recent
4-channel Tektro. For instance:

Dora.
 
Reactions: tinto

    tinto

    Points: 2
    Helpful Answer Positive Rating
doraemon has given good advice - a general rule is the faster it goes the more it costs.
I was not building an oscilloscope with the Texas TMS320C6000 - it was a data acquisition system that used a DAC to inject a 1 to 10Mhz sginal into a tissue sample and then used an ADC sampling at 64Mbps to acquire the result - looking for attenuation and phase shift.
 
Reactions: tinto

    tinto

    Points: 2
    Helpful Answer Positive Rating
By 'slow' I meant that the sampling rate was very low. I was sampling at a rate of only 3ksps. I was sampling each point and then displaying it on a LCD screen. This cycle goes on repeating. I was using the flash ADC, ADC0820 and AT89S52 micro controller.

Now I am planning to build a handheld oscilloscope, just like the DSO nano. I think this one uses ARM Cortex MCU. Thanks for your advices. Now I have got an idea about how to approach this.
 

Hello!

By 'slow' I meant that the sampling rate was very low.
I was sampling at a rate of only 3ksps.

Ok, one of the problems is your method.
If you acquire 1 sample, display it, then acquire another, etc, then you cannot
go very fast. Usually when you display a curve sample by sample, you have to
write a vertical line for every sample to be displayed. This vertical line
contains the background on which you superimpose the curve you are writing.
This means that for even 1 point, you have to write a lot of data and therefore
tune the ADC so that i's slower than the display.

Alternative method: if you want to display for instance one frame (for a small
COG LCD, this might be for example 128 samples) then you have to acquire
128 samples at once, then write your curve. This becomes pretty fast, and you
can probably be closed to the MCU max sampling frequency.
I did a few scopes with a MSP430. You can acquire 16 samples with the
internal ADC memory, then transfer them using DMA to your data buffer.
This is close to 200 ksps. Then when the buffer is full, you stop the ADC
and display the whole curve.

Now I am planning to build a handheld oscilloscope, just like the DSO nano. I think this one uses ARM Cortex MCU. Thanks for your advices. Now I have got an idea about how to approach this.

This is certainly a good exercise. However, it will cost you more than this
scope for a result which is not as good. You probably want to start with a
development board. There are boards, but they are already more expensive
than this little scope. For instance LM3S9B96 dev board (Texas) costs around
4 ~ 500 USD. At that price, you can get a real digital scope (a chinese one).
And even with a Cortex M3 board, you will get a hardware which is designed
for embedded systems, not for fast measurement devices.
And remember: the Cortex M3 CPUs can sample at about 2 MS/s. Maybe
there are faster devices, but probably not 10 MS/s.

Just to be sure: do you want a scope in order to use it after completion
of your project, or do you want to practice embedded hardware / software?
If you want to practice, then it's fine. If you want a scope, buy one!

To conclude with a general rule which works in every possible field:

You can never do better and cheaper than the industry. (provided of
course that you buy the components)
You can do better, but it will be more expensive. You can do cheaper,
but not as good.

Dora.
 
Reactions: tinto

    tinto

    Points: 2
    Helpful Answer Positive Rating

A small doubt about the alternative method you have mentioned above. If I am sampling 128 samples at once and displaying the curve, will I miss a few samples continuously for a small instant? Will this lead to glitches in the display? Will this method display waveforms as smooth as the method I used?
 

Hello!



Basically if you sample fast and then display a bunch of data, you will skip
most of the data.
Let's take an example:
MSP430 at 25 MHz. It can sample at 200 kHz. So If I want to sample as fast
as possible, then I will have to move all the samples directly from the ADC to
some RAM space. Since there are 125 clocks per sample (25 MHz / 200 kHz),
there is enough time to move the data and implement a simple trigger, but
not enough to format it and display it.

- If you want to update graphics, you will have to update the complete scope
area. I don't know what kind of LCD you plan to use, but even with a black
and white (2 levels) with 8 pixels per byte, supposing your display is 128
pixels wide and 64 pixel high, then you have to send 128 * 64 / 8 = 1024
bytes. If you send them serially using a 10 MHz clock (usually the speed of a
SPI COG LCD), then you will need around 10 000 clocks, therefore 1 ms if you
use DMA. Add to this the time you need to prepare your LCD data, and you
will end with a few more milliseconds.

- It is useless to update all the samples at the screen since you would refresh
the screen way too fast for your eyes. At 200 kHz, if you display 128 samples
would mean a refresh rate of more than 1.5 KHz, which is absolutely useless.
Therefore the tricky part of an oscilloscope is to display useful data, not all
data. Now if you consider the problem from the eye point of view, you will
need about 25 refresh per second. 25 x 128 = 3200 samples. Therefore,
supposing you sample at 200 khz, you will display 1~2% of what a 200 kHz
continuous sampling would yield.

- If you sample a data set and display, you will (likely) not miss any data for
the data set, but you will miss all the data while you are displaying. I would
say it does not matter provided that you are able to display what you want to
observe. I think the most difficult part is to select the right set of data and to
format it in order to provide relevant info and graphics. And whatever you
use (ARM, DSP, etc), the problem will be the same. Only the figures I have
given above will change, and the tricky part will be to display something
useful.

Dora.
 
as other contributers have said if you want an oscilloscope it is a lot cheaper to buy one than build one.
However, microcontroller based data acquisition systems often acquire data and display it on an LCD in situations where an oscilloscope will not work. For example, consider medical applications. On may give a patient a drug and monitor parameters - probably sampling every 10 seconds, updating the LCD in real time and scrolling the display when it was full. Another application may apply a signal to a tissue sample and measure parameters (sampling at 10's or 100's of killo samples per second) for a given time then display the results. In such a case one may acquire data storing it in FRAM or flash drives to be viewed later using software to scroll and zoom the display and analyse the results.
 

Thank you guys for your replies...very much helpful to me.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…