This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

is there any different between 4-wires and 8-wires

hi,

    we found that the config of 4-wires and 8-wires is exactly the same:(in ti_tscadc.c   fun tsc_step_config) BSP-04.06.00.08

switch (ts_dev->wires) {
case 4:
stepconfigx |= TSCADC_STEPCONFIG_INP |
TSCADC_STEPCONFIG_XNN;
break;
case 5:
stepconfigx |= TSCADC_STEPCONFIG_YNN |
TSCADC_STEPCONFIG_INP_5 | TSCADC_STEPCONFIG_XNN |
TSCADC_STEPCONFIG_YPP;
break;
case 8:
stepconfigx |= TSCADC_STEPCONFIG_INP |
TSCADC_STEPCONFIG_XNN;
break;
}

...

switch (ts_dev->wires) {
case 4:
stepconfigy |= TSCADC_STEPCONFIG_YPP;
break;
case 5:
stepconfigy |= TSCADC_STEPCONFIG_XPP | TSCADC_STEPCONFIG_INP_5 |
TSCADC_STEPCONFIG_XNP | TSCADC_STEPCONFIG_YPN;
break;
case 8:
stepconfigy |= TSCADC_STEPCONFIG_YPP;
break;
}

is it correct that the config is same?

in our board, we want to use 4-wire tsc and other 4 ADC channels. but now we detected that the other 4 ADC channels has some power pluse

  • Hi yu li2,

    The PSP you are using is an older version. The latest PSP version is 04.06.00.09. Here is a link to the PSP Release notes: http://processors.wiki.ti.com/index.php/Sitara_Linux_Software_Developer%E2%80%99s_Guide#Linux_PSP_Documentation

    In the "New in this Release" section of the latest PSP there are some changes regarding the TSC/ADC. The code in the new PSP has changed compared to the code posted by you.

    Please try the new PSP 04.06.00.09 and see if your issue is still present. Also you can take a look at this AM335x ADC Driver's Guide.

    Best regards,
    Miroslav

  • hi  ,

        Thanks for your replly, now we are using the latest PSP which version is 05.06.00.00, and we do steps in  AM335x ADC Driver's Guide. the guide show files list like:

    but now in our board it list:

    and it seems thar the adc value we cat is still wrong(for our input value is gnd ,but the cat value is 4095)

    is there anything we don't config? or do we need other patch to fix it?

  • Hi yu li2,

    The reason why the contents of your /sys/bus/iio/devices/iio\:device0/ are different from what is shown in the AM335x ADC Driver's guide, is that the contents of this particular wiki page are ahead of the v3.2_AM335xPSP_04.06.00.09-rc2 PSP release which comes with the latest SDK. There are patches in the development branch (v3.2-staging), uploaded between tags v3.2_AM335xPSP_04.06.00.09-rc2 and v3.2_AM335xPSP_04.06.00.10-rc1. The patches are:

    2013-02-12
    Patil, Rachna
    IIO: ti_adc: Add support for ADC continuous mode

    2013-02-12
    Patil, Rachna
    input: ti_tsc: Enable shared IRQ for TSC

    2013-02-12
    Patil, Rachna
    IIO: ADC: ti_adc: Fix wrong samples received on 1st...

    2013-02-12
    Patil, Rachna
    IIO: ADC: ti_adc: Reflect the correct analog input...

    2013-02-12
    Patil, Rachna
    MFD: ti_tscadc: disable TSC control register bits when...

    2013-02-12
    Patil, Rachna
    MFD: ti_tscadc: register children only when they are...

    2013-02-12
    Patil, Rachna
    ARM: OMAP2+: AM335x: Update defconfig with ADC support

    2013-02-12
    Patil, Rachna
    ARM: OMAP2+: AM335X: Add ADC platform data

    The ADC driver wiki being ahead of time seems to be a mistake, since the new PSP version is not yet officially released. However you can download and apply these patches if you want to check out the new features they add. Keep in mind, though, that the branch is still in development, so bugs may still be present.

    Regarding the wrong ADC readings issue, can you please tell me which pin and which platform are you using for your tests? When using both touch screen and 4 ADC channels with the configuration from the AM335x ADC Driver's guide wiki page, signals AIN0-AIN3 are used for the LCD display and signals AIN4-AIN7 are used as the ADC channels. Please make sure you are applying voltage to the correct ADC input pin. You can check the schematics of the TI supported boards for the correct connector pins - links to the schematic files can be found in this section.

    I tested reading the ADC values for in_voltage0_raw (signal AIN4) which is expanded to pin 2 from connector J8 located on the AM335x EMV daughter board and the readings are correct. I followed the instructions from the AM335x ADC Driver's guide wiki page without applying the missing patches.

    Best regards,
    Miroslav