Thanks for your reply. Let me try one more time again with my oscilloscope and see what the real values are. Attempted it yesterday but confused by the I2C SDA/SCL signals after the first few bits, and gave up.
The reason why I suspect the sensor is faulty is because the same I2C routine has been used for various other I2C peripherals. including 24C64, DS1307 and DS1621 and it works well. When I first used the code with this sensor, the values all read invalid but consistent values. Using an oscilloscope, I figure out that the bit-bang I2C clock on a PIC24F at 32MHz is too fast for the sensor to catch up. By adding a delay I reached the current set of values. Most values seems in the same range as the datasheet sample figures, except for AC4 and AC5 which is almost the maximum size of a 16-bit unsigned integer (datasheet and other online sources show these figures to be in the range of 20000-30000, despite the datasheet saying that these numbers are of typed unsigned short 0-65535). I try adding delay here and then in the bit bang routines but could not get valid values.
How likely do you think it is for a buggy I2C routines to retrieve valid data in most cases, yet returning invalid results for only 2 values? This is the part that drives me crazy when dealing with hobbyist uC projects - sometimes I can't simply find the reasons why things just don't work, and attributing it to faulty components doesn't really make sense.
Could it be the calibration data is faulty? Does anyone here have similar values, e.g. 65xxx, for AC4/5?