Answer: The AGND can be brought out to an external pin using two methods.
Method-1:
Place the RefMux user module from the Muxes category in a CT block. In the user modules parameter, select AGND. The user module will connect the AGND to the Analog bus. Now, enable the Analog buffer in the analog bus to connect the reference to the external pin. In code, start the Refmux using the RefMux_Start function.

Method-2:
The above method uses one CT block. In applications where there is no free CT block, the AGND can be brought out by configuring and enabling the testmux by writing to the ACBxxCR2 register. For example, say there is a PGA placed in ACB00 and you would like to bring out the AGND using the Analog Bus 0 and P0[3]. In device editor, enable the analog buffer on Analog_ Bus_ 0 so that the analog bus is connected to P0[3]. Add the following lines of code in main.c
ACB00CR2 &= ~0x1C; // Clear the Test mux enable and configuration bits
ACB00CR2 |= 0x14; // Enable Test mux and select AGND as test mux output
In order to use this method, the analog bus on the column should be free. The already existing resource that is occupying the CT block or any other resource on the same analog column should not be using the Analog Bus.
The same procedures may be used to bring out the other references VREFHI and VREFLO to an external pin as well.



