> > > From: Tam?s Fekete > > > > The problem is that sprintf really slows down the process. I should be > > taking samples at about 1ms intervals and because of the sprintf functi= on > > 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 > intervals > > easily. > > > Where do you display your output? Hitachi LCD? UART? SPI or i2c LCD module? Usually it is not the float to string conversion that takes that much time but the output device. You might want to cross check that by use printf or puts with a simple static string, no %f or any other stuff in it, just a simple "Hello World". If that way you experience faster loops then you can optimize the %f part (use ftoa() or write your own ftoa() or use fixed point arithmetic instead of floating point etc). Or you can just put the display routine into a background task and only display the output once in a while instead of each one of the acquisition cycles. Tamas --=20 int main() { char *a,*s,*q; printf(s=3D"int main() { char *a,*s,*q; printf(s=3D%s%s%s, q=3D%s%s%s%s,s,q,q,a=3D%s%s%s%s,q,q,q,a,a,q); }", q=3D"\"",s,q,q,a=3D"\\",q,q,q,a,a,q); } --=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 .