Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GIGA R1: Reading MCU temp using analogRead(ADC_TEMP) returns -1 #959

Open
megacct opened this issue Sep 24, 2024 · 1 comment
Open

GIGA R1: Reading MCU temp using analogRead(ADC_TEMP) returns -1 #959

megacct opened this issue Sep 24, 2024 · 1 comment

Comments

@megacct
Copy link

megacct commented Sep 24, 2024

I was hoping to read the MCU internal temp sensor connected to ADC3_IN18 via the ADC_TEMP define. It would appear this isn't implemented correctly (possibly in mbed os)

@megacct
Copy link
Author

megacct commented Oct 11, 2024

If anyone wants this now:

mbed::AnalogIn mcuADCTemp(ADC_TEMP);
.....
mcuTemp = __HAL_ADC_CALC_TEMPERATURE (3300, mcuADCTemp.read_u16(), ADC_RESOLUTION_16B);

will give a rough value. You can tune the internal voltage (3300mv above) to your actual internal mV and there are other mbed macros for doing that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant