Tool/software: Linux
Dear TI,
We are working on i.MX8QXP with ADS7841Q for one of the project. We connected the ADS7841Q to one of the spi bus of the processor. Here we couldn't find the driver for ADS7841. So we configured the spidev device like below.
&lpspi3 {
#address-cells = <1>;
#size-cells = <0>;
fsl,spi-num-chipselects = <1>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_lpspi3 &pinctrl_lpspi3_cs>;
cs-gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
status = "okay";
spidev@0x00 {
compatible = "spidev";
spi-max-frequency = <20000000>;
reg = <0>;
};
};
Using spidevtest able to send the spi packets like 0x9F, 0x00 ( 8 bit mode). But while reading from the SPI we are getting the exactly half of the CH0 voltage.
Why ADC is behaving like this.?
Calculation used here is static
void adcout_process(short int sampled_data)
{
float volt,vref,adc_bit;
vref = VREF_5V;
//adc_bit = ADC_12BIT;
adc_bit = 256; //8bit mode
// adc_bit = 1024; //10bit mode
printf("adcout_process::RAW data 0x%X\r\n",sampled_data);
volt = ((vref/adc_bit)*(float)sampled_data);
printf("Voltage : %f\r\n",volt);
}
Running command : ./spidev_test -v -b 16 -O
output : half of the voltage in the CH0
please help us to get the exact voltage. we are taking 10 samples.
If you share the linux driver and the application to use it will be a great help.
Best Regards,
Ranjith Hebbar