- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, All!
I'm sorry for my bad English!
I make HID device for transfer in real time data from I2C sensors to PC. But I have some problems with transfer data from PC to PSoC. Data is transmitted after a long delay or not at all transmitted. This data on the sensors scale.
And another question, how best to transfer the data type float ?
Oleg
Solved! Go to Solution.
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Note that with Creator 3.0, newlib-nano is used by default. For that, floating point support in all *printf() functions need to be enabled explicitely: http://www.cypress.com/?id=4&rID=87354
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Since the implementation of floats on a PSoC may differ from a float on your PC I would suggest to write them out as a string using sprintf() and read them back in with sscanf(). This will insure a common coding over the interface.
Merry Chistmas
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Convert floats to character string and send as a NUL terminated string,
sprintf() (convert into a char buffer) will do that nicely with formatting.
Then use atof() (or its equivalent) on PC side to convert string back to
float.
Attached sprintf (printf) formatting string reference.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Note that with Creator 3.0, newlib-nano is used by default. For that, floating point support in all *printf() functions need to be enabled explicitely: http://www.cypress.com/?id=4&rID=87354
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply!
Anybody can give an example how to transfer string data?
and what about the first question? Why do not always transmit data from a PC to PSoC or transferred after a long delay?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have seen the following ap note and ones listed at bottom
of this page ?
http://www.cypress.com/?rID=39553 AN56377
Regards, Dana.