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.
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?
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.
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.
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
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.
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 .
sinewave_to_pc.zip 2.0 MB
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().
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?
sinewave_to_pc1.zip 1.9 MB
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.
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?
result1.png 59.6 K
If you go here -
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,
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 -