Analog Subsystem Software
947
SPRUHE8E – October 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
Analog Subsystem
NOTE:
For the above example to work, the C28 Analog Subsystem function,
InitAnalogSystemClock, must be called first.
unsigned short analogclock1 = 0;
unsigned short analogclock2 = 0;
HWREG
(SYSCTL_MWRALLOW) = 0xA5A5A5A5;
// ALLOW reads and writes to protected registers;
while((**AnalogClockEnable)(AnalogConfig1,ADC1_ENABLE));
// Enable ADC 1
while((**AnalogClockEnable)(AnalogConfig2,ADC2_ENABLE|COMP1_ENABLE|COMP4_ENABLE));
// Enable ADC 2, COMP1, and COMP4
analogclock1 = (**ReadAnalogClockStatus)(AnalogConfig1);
// Check Analog Config 1 Register for correct values (bit 3 should be set)
analogclock2 = (**ReadAnalogClockStatus)(AnalogConfig2);
// Check Analog Config 2 Register for correct values (bits 15,3,0 should be set)
NOTE:
Bits in the Analog Config 1 and 2 registers that are not defined by the AnalogClockMask
#define values are reserved.
The functions above perform the same functionality as the C28 Analog Subsystem functions.
These functions are available for software ease-of-use.
NOTE:
The ReadAnalogClockStatus function must be used to check the correctness of the Analog
Config 1 and Analog Config 2 Registers if the header file functions (InitSysCtrl, InitAdc1, and
InitAdc2) are not used to enable ADC1 or ADC2.