transmitting sine wave to pc

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

cross mob
Anonymous
Not applicable

 Dear all,

   

 

   

I have a wavedac8 block to generate a sine wave.  i use a ADC_delsig do converte the generated funcion to digital and i need to transfer that data to computer and see it (like an osciloscope) whith a program like simplot to see the sin funcion on the computer.. 

   

 

   

can you please help me?

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

There are example projects, link to them on Creator start page,

   

The example projects are using ADC in various configurations,

   

and communications, such as UART, USBUART.

   

 

   

You can take the code from these and adapt to your application.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 thank you Dana for your feadback,

   

 

   

i already look for almost all examples in start page. my problem is i don't find an example were was a comunication in real time beetwen psoc and computer of a sine function for example. do you know any of these example?

   

 

   

Kind Regards!

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

The motto should be "Divide et impera". When you resolve the communication between PSoC and PC you are half through.

   

When you measure a sine-wave that will be the other half.

   

Lastly you just have to combine both parts to form your sine-wave communication.project.

   

For the communication: Easiest will be to use on PSoC side an USBUART component. It uses the USB interface on your development kit and emulates on the PC side a serial COM-port to which you can attach with a terminal-program. You may even use the Cypress Bridge Control Program which can be a bit difficult to handle but which is able to produce a simple graphical output.

   

 

   

Bob

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

Are you using A/D to recreate sine generated by Wavedac8 or is A/D sampling

   

a signal chain that takes the sine and transforms it, like amplify, filter. In other

   

words use A/D to gen a bode plot by sweeping wavedac8 ? If former just take the

   

wavedac8 sine table and transmit it instead of adding an A/D into design.

   

 

   

Stampplot PRO is a freeware non commercial plotting program that will take serial

   

or IP treams and plot. You set it up on PC side with scripts to interpret serial data

   

coming to it.

   

 

   

    

   

          http://www.parallax.com/downloads/stampplot-pro-software

   

 

   

At the most basic level if you have a serial connection working, and A/D working,

   

then all you have to do is take A/D samples and convert them to a char string and

   

send that via serial connection. sprintf() (library function) makes that easy to do

   

 

   

Regards, Dana.

0 Likes
lock attach
Attachments are accessible only for community members.
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

@ze,

   

attached demo project transferring and plotting Sin data to PC, using Cypress long forgotten application Multichart (included in the bundle). Using Simplot is similar, but it seems to have less features than Multichart. Tested on PSOC4200 (PioneerBoard), but should work on PSoC5LP.

   

odissey1

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

thanks for your precious information , but I must be making a mistake somewhere in programming. Attached is the test that I am conducting for more easily understand my problem .

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

Some issues -

   

 

   

1) You should use UART_PutString(const char8 string[]) to transmit a string.

   

 

   

2) You have an isr component, but do not enable it or do anything inside the interrupt ?

   

Right now you start it, but inside ISR do not read uart status reg to clear it, so re-enter

   

it upon exit. You should either not use ISR or inside ISR read status reg.

   

 

   

3) isr component should be changed to edge triggered

   

 

   

4)            sprintf(OutputString, "%i",ADCResult);    should change formatting string to %l

   

or change the variable to an int16.

   

 

   

5) You run ADC at 16 bits but wavedac8 only produces 8 bit samples ? Why not

   

run ADC at 10 bits, make result variable an int, use Getresult16() rather than GetResult32().

   

 

   

Regards, Dana.


0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 I think i solve the issues . ( except the ISR)

   

 

   

now i get some information on stampplot, not in graphic view but in a window whith some random character informations.

   

its a problem in  a program or is a problem in viwer dimension plot?

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

Did you format the data being sent per stampplot pro. Their user

   

manual has the instuctions for how it wants to see its data and what

   

format and deliniation between samples, etcc.

   

 

   

Regards, Dana.

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

Perhaps my old projects will help you:  ADC-> UART  and  ADC-> USBUART
But they are very ancient. PSoC is changing very quickly.
1. PSoC_OSC_12bit.zip      on  this   page
   and oscilloscope program for this project.
2. ECG.ZIP   and   ECG_PGA.zip    on   this  page
    For them, there is a primitive viewer: ECG_PSoC.exe 

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

thanks for all the examples and tips on this subject.

   

already can do the data transfer between the psoc and the computer.

   

my problem now is, with the format of the transmitted data or setting the plot program.

   

see the attached image, I'm getting data but not graphic. what can I be doing wrong?

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

If you go here -

   

 

   

    

   

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

   

 

   

There is example code, mainly AVR code, that give you an idea of

   

what to send and its format.

   

 

   

In the help files for Stamplot, in windows start menu, stampplot menu,

   

there is a section on plotting and serial links you should read.

   

 

   

The data you show in the image seems wacky, that is from "normal" numbers to

   

impossibly large values, seems like first tackle sending one float value converted

   

into a string and get that right. Terminated by CR. Then send 2 floats, seperated by comma,

   

then CR.

   

 

   

Use a logic analyzer to confirm your send are correct, or set up a Rx channel on PSOC

   

and view its received data with debug/breakpoint.

   

 

   

El cheapo but very capable logic analyzer -

   

 

   

    

   

          http://www.ebay.com/sch/i.html?_from=R40&_trksid=p2050601.m570.l1313.TR0.TRC0.H0.Xsaleae+logic.TRS0&...

   

 

   

Regards, Dana.

0 Likes