> From: Tam?s Fekete >=20 > 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. 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. >=20 > 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. >=20 > 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. >=20 > Cheers > Tomi >=20 The output from the ADC is probably in Fractional notation, the dsPIS33F do= es not support floating point notation. If you wish to convert that with an= y speed then it would be better to write your own code. You should read up = on the particular fractional notation that is used, I'm 99% certain that it= is Q15 but the information will be in the datasheet. Alternatively you can= send binary data directly to MATLAB if you use MATLAB's serial port object= and then convert the data once received. regards James =20 --=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 .