just a small question on RIOT-OS on the bluepill board.
I’m not getting any ‘actual’ values when using ADC8 and ADC9. The values are somewhat constant. I’m basicly using the example as mentioned in the periph_adc test program. Only using 12 bit resolution and only ADC inputs 8 and 9. I’ve connected the inputs via a potentiometer to the 3.3V supply. I’ve verified that the input value changes via a voltmeter.
So does any have an idea what could be the problem? Has any one used the ADC’s 8 or 9 on the blue pill?
I’m a newbie on RIOT-OS so I thought that a bug report might be too much. Assumed that I probably made a mistake somewhere down the line.
I’ve `modified - changed from m10 bit to 12 bit resolution - and recompiled the perihp_adc example from the RIOT test folder. And got the same results. Exchanged the bluepill PCB with another one. Again the same results. So I get a value in the range of 1823 … 1822 for ADC 8 and 1527 … 1530 for ADC 9. No change when I modify the voltage levels at the input pins of PB0 and PB1. Changing to other pins have the identical behavior, only other values.
In conclusion I believe you were just looking at the internal temperature ref and voltage ref. Please consult the above link for mapping of ports to line numbers (it is just an array that counts up).
I did place the analogue signal on the B0 and B1 as the pinout diagram of the Bluepill indicates.
In the meantime I’ve added some ‘peek’ commands and I noticed that the ADC regular sequence register 3 (ADC_SQR3) of the STM32 was set to 0x41. Which would indicate channels 1 and 4 are to be used. Adc regular sequence number register 1 (ADC_SQR1) is however set to 0. Which would indicate 1 conversion is to be done of the regular sequence being channel 1.
When I change my test program to use ADC1 (= pin A1) instead and apply the signal level to pin A1. It works! I can see data returning that when multiplied results into the value of the signal level. So yes the ADC’s work, only why are they not the inputs that I want to use (being PB0 and PB1)?
So I would conclude at this moment that the Bluepill is/gets setup incorrect.