lpc 2148 based pc oscilloscope

Started by anik...@yahoo.in September 17, 2013
Hello i trying to make pc oscilloscope using lpc 2148..

1)what would be the maximum 'digital signal' frequency i can apply at the inputs of lpc 2148 for proper processing?

2)As said in datasheet, for 10 bit ADC max sampling rate is 400 kSPS so what sampling rate should i take for proper regeneration of input 'analog signals' on display?
or
if i set the sampling rate at 400ksps what would be the max. analog signal frequency i can allow at the inputs of adc for proper regeneration?

3) with the baud rate of 9600 what bandwidth i can achieve?

An Engineer's Guide to the LPC2100 Series

Hello i trying to make pc oscilloscope using lpc 2148..

1)what would be the maximum 'digital signal' frequency i can apply at the inputs of lpc 2148 for proper processing?

----
You will need to use the FIO (Fast IO) feature of the pins. Even then, IO is not very fast compared to the clock speed. You can use the Interrupt On Change feature to avoid polling but the code overhead of interrupt handlers is quite high. I have no idea how fast you can sample, particularly multiple channels. Considering the pipelined nature of the ARM processor and the possibility of having to flush the pipeline on a branch, I'm not sure you can even do digital sampling with any kind of accuracy.

Write some code and try it.
----
2)As said in datasheet, for 10 bit ADC max sampling rate is 400 kSPS so what sampling rate should i take for proper regeneration of input 'analog signals' on display?
or
if i set the sampling rate at 400ksps what would be the max. analog signal frequency i can allow at the inputs of adc for proper regeneration?

----
Shannon/Nyquist Sampling Theory still applies. At best you need to sample at twice the highest frequency in the signal. This also implies that you need to bandwidth limit the signal before sampling. At 100 kHz square wave has harmonics all the way to daylight and this can not be reconstructed by sampling at 200 kHz. A sine wave of 100 kHz, without harmonics, should sample fairly well at 200 kHz. People tend to overlook the requirement that the input signal be bandwidth limited.

http://www.princeton.edu/~achaney/tmve/wiki100k/docs/Nyquist%E2%80%93Shannon_sampling_theorem.html
----

3) with the baud rate of 9600 what bandwidth i can achieve?

----
Every 8 bits of data sent over a serial link is framed by at least a start and stop bit. So, 10 bits are sent for every 8 bits of data. You can send 960 framed characters (bytes) per second.

Now you want to send 10 bits/sample and that won't fit in an 8 bit byte. You can spread each sample over 2 bytes (6 bits wasted) so you can send 480 samples per second.

You can pack the data; 4 10 bit samples (40 bits) in 5 8 bit bytes (40 bits, zero wasted bits).

Five bytes transfer in 5/960 of a second. Your throughput would be 4 * 960/5 or 768 samples per second.

There may be some fancy encoding schemes that might do better statistically but they are computationally intense (like .zip).
----

This problem set seems a lot like homework!

Richard
Thanks for help..
--- In l..., "rtstofer" wrote:
> Every 8 bits of data sent over a serial link is framed by at least a start and stop bit. So, 10 bits are sent for every 8 bits of data. You can send 960 framed characters (bytes) per second.
>
> Now you want to send 10 bits/sample and that won't fit in an 8 bit byte. You can spread each sample over 2 bytes (6 bits wasted) so you can send 480 samples per second.
>
> You can pack the data; 4 10 bit samples (40 bits) in 5 8 bit bytes (40 bits, zero wasted bits).
>
> Five bytes transfer in 5/960 of a second. Your throughput would be 4 * 960/5 or 768 samples per second.
>
> There may be some fancy encoding schemes that might do better statistically but they are computationally intense (like .zip).
> ----

Of course, if you are buffering the samples into RAM, the serial link speed is unimportant. First you take all the samples then, some time later, you send them out. I suspect all real logic analyzers do it this way.

Richard