2018-01-18 08:30 AM
Solved! Go to Solution.
2018-01-22 07:50 AM
The difference was the VREF+ pin. VREF+ and VDDA are not double bonded on the 100LQFP package and since VREF+ was not connected externally in the design it was not being powered. Adding the below code fixed the issue:
/**Configure the VREFBUF */
HAL_SYSCFG_VREFBUF_VoltageScalingConfig(SYSCFG_VREFBUF_VOLTAGE_SCALE0); HAL_SYSCFG_VREFBUF_HighImpedanceConfig(SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE); if (HAL_SYSCFG_EnableVREFBUF() != HAL_OK) { _Error_Handler(__FILE__, __LINE__); }2018-01-18 08:48 AM
Can you share the code and tell us what pins you are trying to use? What is the source of DC voltage you want to measure. How did you wired the pins (pot or resistor divider, etc)
2018-01-18 11:36 AM
I've updated the question with the code. Some of the pins I've just been manually shorting to VCC (3.3) or GND, but PA0 is connected to a temperature sensor like below which is putting PA0 at 1.3V roughly. If multiple ADC channels are configured how do I know which one I'm converting when I receive the interrupt?
2018-01-18 12:52 PM
By counting the interrupts... you programmed the conversion sequence so you know which interrupt number belongs to which conversion.
JW
2018-01-18 12:58 PM
Okay that makes sense, but I'm still only seeing 3 interrupts and they are all measuring 0xFFF
2018-01-18 01:09 PM
Then try only one (read: cut down code to absolute working minimum).
And try it first on the 'L476-Nucleo, you've said that worked (read: reduce unknowns).
If the minimal code works there, then move to your custom board with 'L431. If the same code won't work on 'L431, try to find the differences, in DS, RM.
JW
2018-01-18 01:41 PM
The 476 has a multimode option which I don't think is available on the 431. That's the only difference I can see between the two.
2018-01-22 07:50 AM
The difference was the VREF+ pin. VREF+ and VDDA are not double bonded on the 100LQFP package and since VREF+ was not connected externally in the design it was not being powered. Adding the below code fixed the issue:
/**Configure the VREFBUF */
HAL_SYSCFG_VREFBUF_VoltageScalingConfig(SYSCFG_VREFBUF_VOLTAGE_SCALE0); HAL_SYSCFG_VREFBUF_HighImpedanceConfig(SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE); if (HAL_SYSCFG_EnableVREFBUF() != HAL_OK) { _Error_Handler(__FILE__, __LINE__); }