USB/Serial sampling rate issue

Hello,

I'm working on a project which involves getting accelerometer data from an I2C bus, and also an ADC value and sending that to a computer. The requirement is that the analog signal be sampled at > 2KHz. I've written some code below, but from the timestamps the effective sampling rate seems to be 250 Hz.

I'm using at ATMega16u4, 8 MHz internal oscillator, USB low speed (1MBit/s)

http://pastebin.com/09U7yPJx

Does anyone know how to work around this issue?

ASCII output

490000936;1022;17;-14;262; 490005200;303;17;-14;262; 490009352;475;17;-15;264; 490013504;1022;17;-15;264; 490017808;1022;17;-15;264; 490022112;1007;16;-14;265; 490026392;196;16;-14;265; 490030576;644;17;-15;264; 490034736;1022;17;-15;264;

Is it a special design ?
You are making it hard, by using low USB speed, only 9600 baud, 8MHz clock. Since the interal ocillator is not very accurate, you can’t do high baudrates.

Can you try it first on a Arduino Uno ? With a high baud rate.
Your code seems already the bare minimum.
Some I2C devices allow higher datatransfer. Perhaps you have to alter the library for that.

Do you need a continues flow of data ? Perhaps you can store data in a EEPROM or SD card.