Hi all
I want to get the temperature acquisition by MPC5744 , I find the ADC0.MCR.B. CTUEN must be set to 0,
then the function of CTU will shut down,SO how to set the TSENS successful initialization on ADC
and ADC_0.MCR.B. CTUEN = 1 .
Thanks
Best Regards
Hi,
There is no need to use the ADC’s CPU mode (ADC0.MCR.B.CTUEN=0) for TSENS conversion. It is up to user how the ADC will be configured. There is a demo code, https://community.freescale.com/docs/DOC-104657, which uses the ADC’s CPU mode for sensing the TSENS, however you can simply configure the CTU to send commands to convert desired channels. On the https://community.freescale.com/docs/DOC-329623 you can find several examples for the CTU-ADC usage, so you can create your own code to start TSENS output sampling by the CTU.
BR, Petr
Dear Petr:
Thanks you for the relay. The example I use is the demo code Example MPC5744P TSENS temperature calculation ,In ADC initialization ,if
the ADC0.MCR.B. CTUEN =1; The program will stop here (while (ADC_0.CDR[15].B.VALID != 1) {}; /* Wait for last scan to complete */).
As shown below,and please tell me the reason.
Thanks
Best Regards
Hi,
If you select CTU conversion mode, you also need to configure CTU module to send commands to the ADC so the conversion is started. This is not done in the example you pointed to. In the CTU mode normal conversion cannot be used.
As I mentioned on the https://community.freescale.com/docs/DOC-329623 you can find several examples for the CTU-ADC usage, so you can create your own code to start TSENS output sampling by the CTU.
BR, Petr