Topic

FAQ
Login Register
ADC - discrepancies in documentation and driver
Mar 07, 2023 18:06

/

A

/A

Hi everyone,


I use TLSR8251 chip. I want to use ADC modul to period read voltage on pin PB2.

I chose the misc channel.

Max state = 2,   r_max_s = 10,   r_max_mc = 240,    sampling = 6 cycle.  Fadc = 4MHz,   Ttotad duration = 10,417us =>  Fs = 96kHz


I found some difference between documentation and driver. 

Documentation:

ADC data is always 15-bit format no matter what the resolution is set. For example, 14 bits
resolution indicates ADC data consists of 14-bit valid data and 1-bit sign extension bit.


Driver:

if(adc_data_buf[i] & BIT(13)){ //14 bit resolution, BIT(13) is sign bit, 1 means negative voltage in differential_mode

    adc_sample[i] = 0;

}
else{

    adc_sample[i] = ((unsigned short)adc_data_buf[i] & 0x1FFF); //BIT(12..0) is valid adc result

}


Which one is correct?




I have some questions.

1. Why in driver we wait minimum 2 sample cycles?   while(!clock_time_exceed(t0, 25)); //wait at least 2 sample cycle(f = 96K, T = 10.4us)

In documentation we can read that after "Caputre state" data is ready. It looks like 1 sample cycle is enough. Am I right?


2. Case: FIFO disable. Will the ADC module automatically go to the "Set state" after the "Capture state" will be completed? Or will it wait to result read?


3. Case: FIFO enable. Question as above. Will the ADC modul automatically go to write new value to FIFO buffer after it reaches FIFO size?


4. Does conversion take 6 cycle (in my settings) in Capture State or more? 




Thank you for your answers.


Best regards,

Krzysztof


3 replies
TL_Soyo Mar 08, 2023 13:59
0
/A

Hi,

  Documentation and driver all are right,we only use 14-bit valid data that contain BIT(12..0) valid adc,BIT(13) sign bit;

1、adc need 20.8us to do one sample

2、diable fifo ,you need control by yourself,please refrence adc_sample_and_get_result_manual_mode();fuction ,control the register "adc_data_sample_control"

3、ADC automatically go to write new value to FIFO buffer index 0 position agian

4、please calculate by yourself though the above table

  

krzysztof [Author] Mar 09, 2023 04:14
0
/A



Hi,

Which documentations do you have? In my version: Ver 0.8.10 2023/2/16 for TLSR8251 have:

afe_0xf3<7:0> - Reserved.


Best regards,

Krzysztof


TL_Soyo Mar 09, 2023 09:55
0
/A

you can download Tlsr8278 datasheet find it,but the two of chips many characteristics are different.