develop oscillioscope and signal generator using psoc3 kit

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

hello  to everyone i want to develop oscillioscope and signal generator using psoc3 kit and want to display on my laptop using any program. i have very basic knowledge about psoc.Request to all forum member please help me to design this project

0 Likes
1 Solution
Anonymous
Not applicable

Scope Part

   

 

   

The PSOC-030 has a 20 Bit ADC. You can purchase 24 bit ADC if you need more accuracy. I would start with the onboard 20 bit ADC. After you configure the 20 bit ADC! Then comes the fun part. You need to creat a time base versus voltage. You have many forms of communication on board the Cypress Psoc 3-030. There is SPI, I2C, RS232, RS485 and USB. I dont know how you are going to display the information? Ther are beatiful LCD displays on the market. Cypress even provides the library for graphic LCD displays. You need to provide your requirements in more detail. How fast do you want to capture data. Does it exceed the Cypress master clock? My suggestion would be to sit back and look at the whole picturee before you start. Cypress has made the coding very user friendly. But first creat your project in detail before you start coding.

   

Signal generators are easy to creat. I wouls suggest an external keyboard. Say a 4 by 4 matrix. Set your clock at some time base and read in your matrix number one at a time. Set up a parameter to read each number. Also set a rul base for youe case statement. Ex: F,100,2 This would be read by the Psoc as Frequency case followed by actual frequency then voltage amplitude. 

View solution in original post

0 Likes
43 Replies
Anonymous
Not applicable

i have only basic idea about the adc and the dac converter to convert input signal into digital and display it on computer via program or dump into file and plot it using matlab

   

 

   

tell me how can i generate various analog waves in the psoc and route it to analog pins to use it as a signal generator for testing purpose.

   

please help me out to develop this idea into a working project

0 Likes
Anonymous
Not applicable

Scope Part

   

 

   

The PSOC-030 has a 20 Bit ADC. You can purchase 24 bit ADC if you need more accuracy. I would start with the onboard 20 bit ADC. After you configure the 20 bit ADC! Then comes the fun part. You need to creat a time base versus voltage. You have many forms of communication on board the Cypress Psoc 3-030. There is SPI, I2C, RS232, RS485 and USB. I dont know how you are going to display the information? Ther are beatiful LCD displays on the market. Cypress even provides the library for graphic LCD displays. You need to provide your requirements in more detail. How fast do you want to capture data. Does it exceed the Cypress master clock? My suggestion would be to sit back and look at the whole picturee before you start. Cypress has made the coding very user friendly. But first creat your project in detail before you start coding.

   

Signal generators are easy to creat. I wouls suggest an external keyboard. Say a 4 by 4 matrix. Set your clock at some time base and read in your matrix number one at a time. Set up a parameter to read each number. Also set a rul base for youe case statement. Ex: F,100,2 This would be read by the Psoc as Frequency case followed by actual frequency then voltage amplitude. 

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Well, 20 bits are good, 24 bits are even better.... Truly???

   

Having an accuracy of about 2 percent would only require 8 bits of precision for the ADC when estimating the overall errors. Wouldn't that be enough for an oscilloscope? You may send the sampled data to a USBUART to connect to your laptop and have the signals displayed there.

   

I would start with a logic-analizer and not with a scope. The reasons are obvious, you can digitize 8 channels in parallel and code all logic states in a single byte. Triggering your analizer is relatively easy.

   

When you are through with that, PSoC side and Windows side, you have got a functional framework which you can use to implement some analog capabilities as analog triggering and at last analog measuring.

   

This is not a 3-days-at-weekend project, you'll have to put some thoughts in. What language (what compiler) are you choosing for the windows-side?

   

But when you start with logic-analizer and while programming everything keeping in mind that you are going to implement analog signals as well you will choose your data-structure more flexible.

   

We are here in PSoC3 forum, but the "Need for Speed" makes me thinking if it wouldn't be better to choose a PSoC5 especially because of the much larger amount of sram that comes with that chip and having a couple of KB to buffer some values makes (your) life easier.

   

Start small, think big, code flexible and the world is yours!

   

Bob 

HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Funny - I did both parts in the past 🙂

   

Let me start with the oscilloscope part: the PSoC3 itself is fast enough, but the ADC is way too slow for a useful oscilloscope. You really want to have the fast SAR ADCs of the PSoC5. Read about ADC and DMA, look at the demo projects provided by Cypress - they give you all the needed building blocks.

   

You may want to look at http://www.cypress.com/?id=3312&conID=235 - this was my contest entry which implemented an oscilloscope (together with a logic analyzer).

   

For the PC side of things, you may want to reuse what already exists. The OLS client under http://www.lxtreme.nl/ols or the SigRok project are good starting places. (I for myself used the OLS client)

HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Now for the signal generator part. Read about the DAC and DMA. Look for the WaveDAC8 component - it basically gives you the basic building blocks you need. Then read about DDS and NCOs, if you want to refine your solution further.

   

You may want to look at http://www.cypress.com/?rID=50106&cache=0 - there you find a basic project which may do what you need. If have it in a further advanced state (esp. better frequency resolution), but it is not in a state to publish it right now.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Some thoughts -

   

 

   

1) What is your target BW for the scope, eg. what Nyquist rate are you going to need ?

   

Most likely you will need SAR, PSOC5, to get anything meaningful in BW. PSOC3 Delsig

   

shows 384KPS which then = your Nyquist rate. So your analog rate, becomes 1/2 that. You

   

of course can use equivalent time sampling, but then there is a ton of other issues, like

   

sampling noise, etc..

   

2) One of the biggest challenges in a low frequency scope is all the code base to make it usable.

   

Win.net comes to mind for the "meat, GUI" portion of the design, unless you are going to use a

   

display attached to PSOC. Then your MIP needs go way up handling that.

   

3) A fast way of getting a basic display w/o writing hardly any code is this freebe,

   

 

   

http://www.selmaware.com/stampplot/index.htm

   

 

   

You can use a number of com schemes and send the data to it and with simple scripts it

   

will format and plot. This would allow you to get an analog scope up and running very

   

quickly.

   

4) As previously mentioned, storage allows a DSO to measure and look for many complex

   

criteria, like a dropped pulse, 6 pulses in a row inside a window,.........PSOC 3 kind of limited

   

in how much RAM you can commit, an eval of stack performance would have to be made

   

and its requirements.

   

 

   

Just some thought, Dana.

ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

For signal generator -

   

 

   

1) Your limit is tied to settling time of the VDAC component, or IDAC with outboard fast

   

OPAmp. Either way 250 KPS for 4V output. divide that by the size of the waveform table

   

you are going to use to create the waveform, and signal rate drops dramatically. Thats why

   

effective sig gens based on DDS principles are clocking in the 100's of Mhz.

   

 

   

2) Table size determins harmonic suppression in the waveform generated. A key spec

   

for analog work. An 8 bit table somewhere <= 40 db of suppresion.

   

 

   

3) You need offboard amp to be able to drive 50 ohms, PSOC cannot do that.

   

 

   

4) I have done digital generation on PSOC, trains of pulses, width, PW, freq programmable, as

   

well as N burst capability. Fairly simple. 1 Mhz kind of stuff and below. Still not 50 ohm capable.

   

 

   

There are a myriad of other considerations, these are just some.

   

 

   

Regards, Dana.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

The Nyquist ratio is only suitable if you can repeatedly scan the same signal. Otherwise, the scan rate should be at least 10 times the frequency of your signal. (Image a sine wave, were you have only 2 dots per wave - not very usable, isn't it?) With the limited memory of the PSoC, you cannot sample repeatedly, just one-shot measurements (BTDT).

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

One way to improve the voltage range of the DAC as well as its speed is to use a PGA with it - just connect it as output buffer to a VDAC. But since you will need an external amplifier anyways, you way want to skip that.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Thats correct, you have to oversample to get what Nyquist does not preserve, scale.

   

 

   

Thats what Wavelets are for, a new (actually old) way of looking at freq and amplitude as a f(t).

   

 

   

But equivalent time sampling can occur very close to Nyquist, but only for periodic

   

waveforms.

   

 

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Would like to know how to do wavelet transform with PSOC. Actually would love to have more DSP application notes from Cypress. Not sure if any one tried FFT with PSCO?

0 Likes
Anonymous
Not applicable

Just found that there is a new DFB assember component and the DFB v2 allows custom coeffecicents. Can't wait for Application notes using these components..:-)

Anonymous
Not applicable

thanks to all CDC members for such a good discussion

   

summary of oscillioscope:

   

i take input of any waveform on any analog pin of psoc kit and fed it to ADC(20/24 bit) then sampled data is send to pc via UART and dump it to a file.firstly i am not aiming to develop any application on window side.i am dumping UART sampled data to txt file and plot it using MATLAB.

   

please help me out that how can i achieve this whole process

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

As I said: read about the ADC and DMA components. The are multiple applicastion notes (and even sample projects) using the DMA to gather ADC data and store it into RAM. Then you can use the UART (or better the USBUART) component to send the data to the PC.

   

Did you look at the links? This sample project already does nearly everything you want to have.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

There is a PSOC 1 FFT application note, you can download it from this thread -

   

 

   

http://www.psocdeveloper.com/forums/viewtopic.php?f=3&t=5833

   

 

   

Regards, Dana.

Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

@hli,

   

had a look into your project. Well done!! that's a gem for this forum.

   

 

   

Bob

HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

The final version version had also a signal generator component in it (there was just some hardware over and I made it fit in there :). Unfortunately Cypress didn't make the final entries to the contest public, and I have not uploaded it anywhere. But I can prepare it, if it helps somebody.

Anonymous
Not applicable

@hli thanks i looked into your project.

   

Its great and can u tell me whats the need of the hardware that u put on psoc5.

   

this project can impelemented on CY8CKIT-001 also?

   

please reply

0 Likes
Anonymous
Not applicable

DDS/NCO part

   

i implemented DDS/NCO/signal generator in verilog code on fpga.

   

please give me basic idea how you achieve on psoc and discuss basic block diagram for implementing DDS.

   

in how much time you completed this project?

   

is there any online simulator to check my PSoc project because my kit reaches to me next week approximately.

   

 

   

can you suggest me the best kit among

   

CY8CKIT-030

   

CY8CKIT-050

   

CY8CKIT-001B

   

suggest kit for this overall use and for this project which kit is best?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The -001 Kit is more universal than the others, it contains a PSoC1, PSoC3 and a PSoC5 exchangeable processor module. So you are not fixed to a special chip.

   

The -30 has got a PSoC3 and is (opposed to -001) optimized for ADC with high resolution (minimum noise etc.) but this board will not fulfill the requirements of hli's project (SARs are missing on PSoC 3)

   

the -50 is the same as the -30 and contains a PSoC5 chip.

   

So if you do not plan to develope for PSoC1 in the next time, take a -50 board.

   

 

   

Bob 

ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

My implementation of the DDS was not in Verilog, I am handicapped until I learn Verilog. Something

   

I want to get done over next few months.

   

 

   

So I did it as a software/DMA driven solution using IDAC (faster setlling time) and PGA. For the

   

analog portion. I used counters to count complete waveforms, fed by clock to DMA, to implement

   

the N burst capability. Also counters to control delay between bursts. To give it a general capa-

   

bility. The Waveform table was filled at run time by simple equation result values, sine, half sine,

   

ramp, triangle, sinc(x)/x.......

   

 

   

The digital pulse generator portion similiar capabilities.

   

 

   

This is only a small fractional part of project, came together quickly, a few days roughly.

   

 

   

Unfortunately none of the PSOC family tools offer simulation in them.

   

 

   

DDS block diagram in this case simple, its just a DAC placed on design, table and DMA all done in

   

software.

   

 

   

There is a wavedac component done by Cypress EE, http://www.cypress.com/?rID=54728

   

 

   

I have a design done in PSOC 1 almost finished, but uses external Analog Devices DDS parts, I need

   

RF waveforms  in the 60 Mhz area, and thats out of the question for any PSOC internal DDS solution,

   

Verilog or otherwise.

   

 

   

Regards, Dana.

HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

If you have done Verilog work before, you should feel somewhat at home with the PSoC data path components. Look at the community videos - there are 5 lectures about how to develop own components with the data path (whioch is done mostly in verilog).

   

As for the NCO: the PSoC Sensei blog has a NCO/accumulator component for you. Using that together with an DMA and a DAC component gives you a DDS generator in about 5 minutes 🙂

   

For the DDS project you found in the linked blog, I needed one evening (but I had some PSoC experience before). The admScope took much longer, beacuse there was so much more stuff involved (the PC communication for example was not so good documented), and hunting bugs always takes some time...

HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

To your other question: yes, this can be implemented on a -001, since this as a PSoC5 module (I used a -050 kit though). The -050 should have the better analog performance, but since I used a 8bit-ADC only, this should not matter much. You will need to change the peripheral pin mapping also, there are other ports available.

   

For the hardware: there is no additional one involved. As long as you can stay within the limits of the PSoC (input voltages, output voltages, output current), nothing else is needed. 8The only exception was a graphical LCD for the standalone mode of the scope)

   

If you look at the contest pages, you also find a video of Cypress presenting my prototype, and you see the hardware there. I just added a test circuit to the board, to have something the scope can display 🙂

Anonymous
Not applicable

@hli can you give me link to your video of showcase of your project and tell me where do i get the link of psoc blog for dds component

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

If you want to boost the effective BW of your sampler equivalent time sampling

   

is used in many scopes. Note your analog channel still must have your target BW,

   

this just relieves the BW required by the sampler.

   

 

   

http://www.tek.com/application-note/real-time-versus-equivalent-time-sampling

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

thanks danaa i read  that document by tektronix

   

@danaaknight can you tell me is there any cloud implementation of PSoC so that i can try my project on it and able to anlyse output because my PSoC kit is arriving next week

   

regards

   

sachin

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

When I visited Cypress I made that suggestion. I have three kits running in my lab and I can control everything from my living-room's laptop via TightVNC. What goes amiss are watching the character LCD and the LEDs, I did not (yet) put a camera there looking at the slab. Something like that could be done giving access to that via internet, but I'm darn sure that some crack would start to shorten a handfull of pins and try to overcome Abolute Maximum Ratings, let it be power dissipation or max. output current, thus blowing the chip.

   

 

   

No, there is no sw-emulator for PSoCs avail. and I question if it would be wise to code a project like that for a 10$ chip.

   

 

   

Bob

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Sorry, I thought the video was linked. You can find it here: http://www.ustream.tv/recorded/14502046 . (This is the Cypress presentation. My video showing the scope is linked within m,y contest entry - see the link above).

   

For the DDS - see also my link above. The accumulator/NCO component can be found here: http://www.cypress.com/?rID=39408&cache=0

   

(please read the whole blog, it is very informative,m that's why I originally did not link to the component directly - the PSoC Sensei blog is not so difficult to find if you look for it)

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

No, there is no cloud implementation. The only thing you can do right nowmis to install PSoC Creator, and start implementing your solution. You can get a feeling of how it might work for your solution.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

The problem with oversamplig is that you need much more memory. The PSoC5 has only 64k, of which you might use 48k. This gives you 48k samples - and with each pass of oversampling you reduce that (4 times oversamplinbg reduces it to 12k samples, which is not so much if you have a complicated signal).

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

@sachinbvp

   

 

   

Actually NEC had a net based dev system in early 90's for customers to

   

eval compiler perfromance, and display as well. A number of customers

   

used it for simple test cases of on chip display controller and math. Their

   

SH3 series.

   

 

   

Regards, Dana.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

@hli

   

 

   

Not sure if you were refering to my post but "equivalent time sampling" is sampling

   

<< Nyquist.

   

 

   

Regards, Dana.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Yes, oversampling is the same as equivalent time sample. But it doesn't neccesarily mean to sample with a sample rate lower than the nyquist frequency. Even if you sample with two times the frequency of your signal, oversampling will give you more information.

   

@Dana: I think we both mean the same, but explain it differently 🙂

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

ETS is under sampling. One sample per trigger, incrementally delayed from one trigger to the

   

next. Here is Teks description -

   

 

   

Sequential Equivalent-time Sampling. The sequential equivalent-time
sampler acquires one sample per trigger, independent of the time/div
setting, or sweep speed, as illustrated in Figure 34. When a trigger is
detected, a sample is taken after a very short, but well-defined, delay.
When the next trigger occurs, a small time increment – delta t – is added
to this delay and the digitizer takes another sample. This process is
repeated many times, with  “delta t” added to each previous acquisition,
until the time window is filled. Sample points appear from left to right in
sequence along the waveform when displayed on the oscilloscope screen.

   

 

   

http://aries.ucsd.edu/najmabadi/CLASS/COMMON/XYZ-Scope.pdf

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

The pdf file is good. Tks dana

0 Likes
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

DDS from      http://kazus.ru/forums/showthread.php?t=21022   :

   

DDS  (square wave output )
http://kazus.ru/forums/attachment.php?attachmentid=16481&d=1294238558

   


DDS - ( hardware, no software. While checking up 24MGts).
http://kazus.ru/forums/attachment.php?attachmentid=14946&d=1290267658

   

Stroboscopic converter for the sound card..
http://kazus.ru/forums/attachment.php?attachmentid=15585&d=1291893810

   

_________________________________________________________________________________
oscilloscopes
from hendriklipka.de:
mixed analog-digital scope
http://webcache.googleusercontent.com/search?q=cache:6-TgptyFUWgJ:www.cypress.com/?id=3312&conID=235...

   

http://hendriklipka.de/misc/adm_scope_20110421.zip

   

----------------------------------------------------------------

   

my oscilloscopes from  http://mylab.wmsite.ru/moi-razrab/cypress-psoc/:

   

PSoC_OSC_12bit.zip
http://mylab.wmsite.ru/ftpgetfile.php?id=55

   

USBUART_ADC__12Bit.zip
http://kazus.ru/forums/attachment.php?attachmentid=21097&d=1303982465

   

 ECG_PGA.zip
http://mylab.wmsite.ru/ftpgetfile.php?id=59

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Looks like I really should do a video explaining how this mixed scope works...

0 Likes
Anonymous
Not applicable

@hli

   

i want to implemet only Mixed scope not DDS.Please guide me through the process and tell me how do i modify the code of yours for CY8CKIT-001B.

   

Please mail me sachin3392@gmail.com

   

 

   

thanks

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

@sachinbvp: just take my project, and remove the one schematic page with the DDS on it. After that, compile the project, look for errors come up and remove everything which is referenced but not there. The most complex part here will be the UI for the LCD.

   

There is an old version of the project available here: http://www.cypress.com/?id=3312&conID=235 , which doesn't contain the DDS. But instead it contains some bugs 😞

   

For the -001, just change the ports for the LCD, since it is on another port there. Everything else should stay the same. Check for the crystal frequency (depending which one is installed on your board).