AN4371
Application note
SPC56ELxx ADC Built-in self-tests
ADC working in CPU mode
Introduction
In automotive more and more often comes in foreground the question of safety. For this
reason the ST’s PowerPC microcontrollers are embedded with various self-test features and
procedures. This document provides detailed view on ADC built-in self-tests (BIST’s), along
with demonstration examples to guide the customer for correct use of the ADC BIST’s.
October 2013
DocID025337 Rev 1
1/29
www.st.com
Contents
AN4371
Contents
1
ADC built-in self-test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1
1.2
1.3
1.4
ADC Built-in self-test description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
ADC self-test important note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
ADC calibration data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Reading from Test Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4.1
Flash content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2
ADC built-in self-test algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.1
2.2
2.3
2.4
Self-test execution flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Supply self-test – Algorithm S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
2.2.1
Supply self-test in CPU mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Resistive-Capacitive self-test - Algorithm RC . . . . . . . . . . . . . . . . . . . . . . 16
2.3.1
Resistive-Capacitive self-test in CPU mode . . . . . . . . . . . . . . . . . . . . . 16
Capacitive self-test - Algorithm C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.4.1
Capacitive self-test in CPU mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3
Appendix A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.1
3.2
3.3
3.4
3.5
3.6
Test Flash copy function example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Algorithm S example in CPU scan mode . . . . . . . . . . . . . . . . . . . . . . . . . 20
Algorithm RC example in CPU one-shot mode . . . . . . . . . . . . . . . . . . . . 22
Algorithm RC example in CPU scan mode . . . . . . . . . . . . . . . . . . . . . . . 23
Algorithm C example in CPU one-shot mode . . . . . . . . . . . . . . . . . . . . . . 24
Algorithm C example in CPU scan mode . . . . . . . . . . . . . . . . . . . . . . . . . 25
Appendix A Reference document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2/29
DocID025337 Rev 1
AN4371
List of tables
List of tables
Table 1.
Table 2.
Table 3.
Table 4.
Table 5.
Test Flash Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Typical values stored in Test sector of Flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Sampling phase duration for the test conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Sample phase settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
DocID025337 Rev 1
3/29
3
List of figures
AN4371
List of figures
Figure 1.
Figure 2.
Figure 3.
Figure 4.
Figure 5.
Figure 6.
Figure 7.
Figure 8.
Figure 9.
Figure 10.
Figure 11.
Figure 12.
ADC block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Test Flash reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Self-test execution sequence example C and RC in scan mode . . . . . . . . . . . . . . . . . . . . 11
Self-test execution sequence flow example S in scan mode . . . . . . . . . . . . . . . . . . . . . . . 11
Self-test baud rate example C and RC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
ADC self-test Algorithm S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
ADC self-test configuration – Algorithm S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Example test execution flow for Algorithm S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Test execution flow - Algorithm S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Self-test flow in one-shot mode- algorithm RC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Test flow - Algorithm RC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Self-test flow in one-shot mode- algorithm C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4/29
DocID025337 Rev 1
AN4371
ADC built-in self-test
1
ADC built-in self-test
For safety relevant applications, it is important to perform the ADC functionality check at
regular intervals
(a)
. For this purpose, hardware build in self testing feature has been
incorporated inside the ADC. Tests at application level can be used in place of the ADC self-
test to verify the integrity of the ADC itself. It is a user's tasks to choose the counter-
measure which better fit his needs.
Three types of Self Testing algorithms have been implemented inside ADC analog.
•
•
•
Supply Self test: Algorithm S
Resistive-Capacitive Self test: Algorithm RC
Capacitive Self test: Algorithm C
The built-in self-tests use analog watchdogs to verify the result of self-test conversions.
During the production factory testing, accurate threshold values for these watchdogs are
stored in the Test sector of the flash memory. Each testing algorithm contains its own
threshold values. Each microcontroller has its own threshold values. Most values are
identical or very similar across the microcontrollers. The build-in self-tests can be executed
in CPU mode as well as in CTU (Cross Triggering Unit) mode
(b)
.
1.1
ADC Built-in self-test description
The ADC implements a channel (self-test channel) dedicated for self-testing. The self-test
schedule is done via special set of self-test registers in ADC. ADC also offers capability of
monitoring the converted data using analog watchdog registers and flags the error to the
Fault Collection and Control Unit (FCCU) in case any of the algorithms fails.
a.
b.
depending on the specific safety concept, the ADC self-test can be run only once after the boot
this AN focuses on ADC working in CPU mode
DocID025337 Rev 1
5/29
28