| Electronic Components Datasheet Search |
|
AN4371 Datasheet(PDF) 21 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4371 Datasheet(HTML) 21 Page - STMicroelectronics |
|
21 / 29 page ![]() DocID025337 Rev 1 21/29 AN4371 Appendix A 28 ADC0.STCR3.B.ALG = 0x0; // Select the Self Testing algorithm in STCR3.ALG. Default is Algorithm S /* 6 */ ADC0.STCR2.B.EN = 1; // ADC0 Enable self testing channel by setting EN bit in the STCR2 register /* 7 */ /* Step 0 - ADC0 internal bandgap voltage register configuration */ ADC0.STCR3.B.MSTEP = 0; // For Scan-shot mode, defines the first step for algorithms S ADC0.STAW0R.B.THRL = ADC0_Self_Test_Flash_Calibration_Data[6]; // Set ADC0 Self-Test calibration data - S algo S0 step - 3.3V ADC0.STAW0R.B.THRH = ADC0_Self_Test_Flash_Calibration_Data[7]; // Set ADC0 Self-Test calibration data - S algo S0 step - 3.3V ADC0.STAW0R.B.AWDE = 1; // Enable analog watchdog related to the algorithm S (step 0) /* Step 1 - ADC supply voltage register configuration */ /* Integer */ ADC0.STAW1AR.B.THRL = ADC0_Self_Test_Flash_Calibration_Data[10]; // Set ADC0 Self-Test calibration data - S algo S1 step - (integer) - Low Treshold Value ADC0.STAW1AR.B.THRH = ADC1_Self_Test_Flash_Calibration_Data[11]; // Set ADC0 Self-Test calibration data - S algo S1 step - (integer) - High Treshold Value /* Float */ ADC0.STAW1BR.B.THRL = ADC0_Self_Test_Flash_Calibration_Data[12]; // Set ADC0 Self-Test calibration data - S algo S1 step - (float) - Low Treshold Value ADC0.STAW1BR.B.THRH = ADC0_Self_Test_Flash_Calibration_Data[13]; ADC0.STAW1AR.B.AWDE = 1; // Enable analog watchdog related to the algorithm S (step 1) /* Step 2 - ADC reference voltage register configuration */ ADC0.STAW2R.B.THRL = ADC0_Self_Test_Flash_Calibration_Data[14]; // Set ADC0 Self-Test calibration data - S algo S2 step) - Low Treshold Value ADC0.STAW2R.B.AWDE = 1; // Enable analog watchdog related to the algorithm S (step 2) ADC0.MCR.B.NSTART = 1; // Start ADC0 normal conversion by setting NSTART bit in the MCR ADC0.MCR.B.NSTART = 0; // Stop ADC0 normal conversion by setting NSTART bit in the MCR while (ADC0.ISR.B.ECH == 0); ADC0.ISR.B.ECH = 1; while (ADC0.STSR1.B.ST_EOC == 0); ADC0.STSR1.B.ST_EOC = 1; if (ADC0.STSR1.B.ERR_S0 == 1 || ADC0.STSR1.B.ERR_S1 == 1 || ADC0.STSR1.B.ERR_S2 == 1) // Check if No S-algorithm error has occurred { while(1); // Self test failed |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |