I am using adc7768 to receive ADC samples. According to datasheet to calculate CRC, we can do it every 4th or 16th sample. My question is for 4 samples last 3 samples CRC will be header of 4th sample. Similarly for 16th sample will it consider last 15 samples or last 4 samples CRC for 16th sample header?
The data sheet says this for register 0x07 in chapter "INTERFACE CONFIGURATION REGISTER" on page 83 (emphasis by me):
The options offer the user the ability to reduce the duty cycle of the CRC calculation by performing it less often: in the case of having it every 16th sample or more often in the case of every fourth conversion. The CRC is calculated on a per channel basis and it includes conversion data only.
The C example in chapter "CRC Check on Data Interface" on pages 73 and 74 shows that all samples are included. Unfortunately some ignorant editor destroyed the formatting, but the variable num_data_words
holds the number of samples.
So the CRC will be of all 16 samples in the case of every 16th sample.