12 Replies Latest reply on Feb 19, 2015 6:41 PM by user_14586677

    transmitting sine wave to pc

    jos.sbio

       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?

        • 1. Re: transmitting sine wave to pc
          user_14586677

          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.

          • 2. Re: transmitting sine wave to pc
            jos.sbio

             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!

            • 3. Re: transmitting sine wave to pc
              user_1377889

              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

              • 4. Re: transmitting sine wave to pc
                user_14586677

                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.

                • 5. Re: transmitting sine wave to pc
                  user_342122993

                  @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

                  • 6. Re: transmitting sine wave to pc
                    jos.sbio

                    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 .

                    • 7. Re: transmitting sine wave to pc
                      user_14586677

                      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.


                      • 8. Re: transmitting sine wave to pc
                        jos.sbio

                         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?

                        • 9. Re: transmitting sine wave to pc
                          user_14586677

                          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.

                          • 10. Re: transmitting sine wave to pc
                            user_49271930

                            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 

                            • 11. Re: transmitting sine wave to pc
                              jos.sbio

                              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?

                              • 12. Re: transmitting sine wave to pc
                                user_14586677

                                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&_nkw=saleae+logic&_sacat=0

                                   

                                 

                                   

                                Regards, Dana.