How to Use ADC Converter Diagnostics Test in TC23x Device

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
abcmo123
Level 1
Level 1
25 sign-ins 10 questions asked 5 questions asked

Dear Aurix User,

I'm trying to use the converter diagnostic test in TC23x ADC, but I am facing some register configuration problems.

For example, I am trying to do the Group1 Channel0 converter diagnostic test with single path test mode in TC23x device. The 5V voltage is used for ADC reference voltage, and the resolution is 12 bits.

The user manual shows that it can start a single channel converter diagnostic with register GLOBTE and GLOBTF configuration. 

Is the register configuration look like the following?

/* Enable group1 for diagnostic  */

GLOBTE.TFEG1 = 1u;

/* Enable the group and channel for converter diagnostic  */

GLOBTF.CDWC = 1;  /* Write Control for Conversion Diagnostics */

GLOBTF.CDSEL = 3;  /* 2/3rd VAREF */

GLOBTF.CDEN = 1;  /* Converter Diagnostics Enable */

GLOBTF.CDGR = 1;   /* Group 1 */

GLOBTF.CDCH= 0;   /* Channel0*/

 

Can I get the result of about 2730 in result register G1RES0 If the converter diagnostic test can be triggered successfully?

0 Likes
1 Solution
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

Below is a sample from others:

 

 

Question: We run some other tests, but we cannot understand what value should we expect after we have enable the test register. Let's suppose we have:

Channel 5 = 2000
Channel 6 = 2000
VAGRD = 0
VAREF = 4098

If we set the GLOBTF register as below:

    Ifx_VADC_GLOBTF my_GLOBTF;
    my_GLOBTF.B.PDD = 1; 
    my_GLOBTF.B.CDWC = 1;
    my_GLOBTF.B.CDEN = 1; 
    my_GLOBTF.B.CDGR = IfxVadc_GroupId_0; //the ADC group
    my_GLOBTF.B.CDCH = IfxVadc_ChannelId_6; //the ADC channel
    my_GLOBTF.B.CDSEL = 0; 
    vadc.vadc->GLOBTF.U = my_GLOBTF.U;


//The correction to above code:
my_GLOBTF.B.PDD should be 0 (PDD is for pull down diagnostic, see picture "Signal Path Test" in user manual).

To do Converter Diagnostic using Group 0 Ch6, test code is VADC_GLOBTF.U = 0x8106.

It is necessary to user longer sampling time, because the charge current is very small (due to big pull device resistance). 

It is suggested to have at lest "5 * RCSD * CAINS" sampling length (footnote for parameter Rcsd in datasheet). 

In test just use the longest possible sampling time (VADC_G0ICLASS0.B.STCS = 0x1F) and in real application the user can shorten it.

The observed results for CDSEL = 0 (VAREF) is 0xFFF or 0xFFE and when CDSEL = 1 (VAGND) is 0x000 or 0x001, which are as expected.

 

 

View solution in original post

4 Replies
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

Below is a sample from others:

 

 

Question: We run some other tests, but we cannot understand what value should we expect after we have enable the test register. Let's suppose we have:

Channel 5 = 2000
Channel 6 = 2000
VAGRD = 0
VAREF = 4098

If we set the GLOBTF register as below:

    Ifx_VADC_GLOBTF my_GLOBTF;
    my_GLOBTF.B.PDD = 1; 
    my_GLOBTF.B.CDWC = 1;
    my_GLOBTF.B.CDEN = 1; 
    my_GLOBTF.B.CDGR = IfxVadc_GroupId_0; //the ADC group
    my_GLOBTF.B.CDCH = IfxVadc_ChannelId_6; //the ADC channel
    my_GLOBTF.B.CDSEL = 0; 
    vadc.vadc->GLOBTF.U = my_GLOBTF.U;


//The correction to above code:
my_GLOBTF.B.PDD should be 0 (PDD is for pull down diagnostic, see picture "Signal Path Test" in user manual).

To do Converter Diagnostic using Group 0 Ch6, test code is VADC_GLOBTF.U = 0x8106.

It is necessary to user longer sampling time, because the charge current is very small (due to big pull device resistance). 

It is suggested to have at lest "5 * RCSD * CAINS" sampling length (footnote for parameter Rcsd in datasheet). 

In test just use the longest possible sampling time (VADC_G0ICLASS0.B.STCS = 0x1F) and in real application the user can shorten it.

The observed results for CDSEL = 0 (VAREF) is 0xFFF or 0xFFE and when CDSEL = 1 (VAGND) is 0x000 or 0x001, which are as expected.

 

 

abcmo123
Level 1
Level 1
25 sign-ins 10 questions asked 5 questions asked

Dear dw,

Thank you for your reply.

I tried to do your GOLBTF setting in our project, but I still have some problem.

I can not get the conversion result 0xFFF or 0xFFE when  CDSEL is 0(VREF).

In my project, I used queued 0 as request source for group0 channel6.

Did you used software trigger to start the conversion? And How did you start the conversion diagnostic test?

Thanks

 

0 Likes
Di_W
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 100 likes received

Hi abcmo123,

Please refer to TC2xx user manual for below chapter:

28.13 Use Case Example for VADC
This section provides a code example for the VADC module to give an overview about the core functionality. The code example realizes an event triggered analog to digital conversion. The result is stored as a 12-bit digital value and triggers a result service request.

dw 

0 Likes
abcmo123
Level 1
Level 1
25 sign-ins 10 questions asked 5 questions asked

Dear dw,

Thank you for your reply and advise.

I can implement the ADC converter diagnostic in my project now.

0 Likes