When I use the sensor and do not include any code redefining ASTEP or ATIME, the maximum value is 1000 no matter what I change the gain to. However when I change astep or atime, the maximum value has been as high as 65535 but sometimes its ~9200 or under other parameters it stagnates at lower numbers. Does anyone know why the default is 1000 or how to predict the maximum based on astep or atime?
The AS7341 library defaults might be of interest.
For instructions on getting help, please have a look at the "How to get the best out of this forum" post, linked at the head of every forum category.
When you increase ATIME or ASTEP, you increase the real integration time. The ADC then accumulates more charge and raw counts rise accordingly.
The effective integration time is defined in the datasheet as (ATIME + 1) × (ASTEP + 1) × 2.78 µs.
I suspect that with the default configuration, this time is extremely short, so even at high gain the photodiodes cannot accumulate enough charge to drive the ADC near full scale.
The maximum depends on the illumination as well as those two factors. This is explained in the AS7341 data sheet, which is the very best source of information.