Hi Tam=E1s, this is your 3rd message, you are not a beginner! So, please, start to use correctly the subject of messages! Thanks On 06/11/2014 11:41, Tam=E1s Fekete wrote: > Hi everyone! > I am not sure if this problem is related to this topic. But I don't know > where else it would fit. > I am using a dspic33fj128mc802 with mplab xc16 compiler. I have to read > data from an ADC at about 1ms intervals. The data that I get is a floatin= g > point number. The data that you WANT maybe floating point, the data that you get from ADC is an integer number. > I convert this number into a string using the function > sprintf. Send out the string. At the PC side I receive and save the data > with putty.exe. Then save the session in a .dat file. I can use this .dat > file with matlab to plot the results. > > The problem is that sprintf really slows down the process. I should be > taking samples at about 1ms intervals and because of the sprintf function > this is between 5-7 mseconds. I checked this with an oscilloscope and > without the sprintf function I can get down to even less than 1ms interva= ls > easily. Do not convert the integer but transfer it as is: do the computation where = you have computational power! > > If anybody could suggest a faster way to make a string out of a floating > point number or another way to send and receive the data I would be very > thankful. You can convert the ADC data in a 4 chars string using hexadecimal notation= .. > > Cheers > Tomi > --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .